---
title: KV cache, memory hierarchy, and continuous batching
seo_title: KV cache, memory hierarchy, and continuous batching — video
description: The KV cache trades memory for less repeated compute; paging and continuous batching coordinate capacity, admission, and reuse across active requests.
keywords: KV cache, PagedAttention, continuous batching, LLM serving, GPU memory, memory hierarchy, inference
date: '2026-09-12T00:00:00+00:00'
robots: index,follow,max-snippet:-1,max-image-preview:large,max-video-preview:-1
hide:
- toc
- navigation
video_watch_page: true
---


<div class="s5-video-watch" data-s5-video-watch data-video-id="videos-series-llm-inference-engineering-economics-02-kv-cache-memory-hierarchy-continuous-batching-pagedattention-md">
  <header class="s5-video-watch__header">
    <div class="s5-video-watch__crumbs"><a href="https://5sigmas.com/en/videos/">All videos</a><span>Other topics</span><span>0:36</span></div>
    <h1>KV cache, memory hierarchy, and continuous batching</h1><p>The KV cache trades memory for less repeated compute; paging and continuous batching coordinate capacity, admission, and reuse across active requests.</p>
  </header>
  <div class="s5-video-watch__player">
    <video controls crossorigin="anonymous" preload="metadata" poster="/en/series/llm-inference-engineering-economics/02-kv-cache-memory-hierarchy-continuous-batching-pagedattention.jpg" playsinline data-s5-watch-player><source src="/en/series/llm-inference-engineering-economics/02-kv-cache-memory-hierarchy-continuous-batching-pagedattention.mp4" type="video/mp4">Your browser does not support the video element.</video>
    <p>Links containing <code>?t=</code> open the video at a specific second.</p>
  </div>
  <section class="s5-video-watch__summary" aria-labelledby="video-summary-title">
    <div class="s5-video-watch__section-head"><span class="s5-eyebrow">Video summary</span><h2 id="video-summary-title">The ideas to retain</h2></div>
    <div class="s5-video-watch__snippet-grid"><article><span>01</span><h2>What the KV cache actually stores</h2><p>In causal attention, once the model has processed a token, that token’s K and V projections do not need to be recomputed from scratch at every later decoding step. The runtime can retain…</p></article>
<article><span>02</span><h2>A useful memory formula — with explicit limits</h2><p>For an autoregressive full-attention transformer where each cacheable layer stores K and V in the standard layout, an estimate for one sequence is:</p></article>
<article><span>03</span><h2>Illustrative arithmetic, not a benchmark</h2><p>Assume a fictional architecture with:</p></article></div>
  </section>
  <section class="s5-video-watch__chapters" aria-labelledby="video-chapters-title"><div><span class="s5-eyebrow">Key moments</span><h2 id="video-chapters-title">Jump directly to a section</h2></div><ol><li><a href="?t=0" data-s5-video-seek="0"><time>0:00</time><span>The KV cache consumes capacity per sequence</span></a></li>
<li><a href="?t=12" data-s5-video-seek="12"><time>0:12</time><span>Continuous batching rebuilds the batch each step</span></a></li>
<li><a href="?t=24" data-s5-video-seek="24"><time>0:24</time><span>Paging turns capacity into assignable pages</span></a></li></ol></section>
  
  <aside class="s5-video-watch__source"><div><span class="s5-eyebrow">Context and evidence</span><h2>Continue with the full article</h2><p>The chapter develops the mechanism, primary sources, limitations and connections to the rest of the series.</p></div><a class="s5-video-watch__source-link" href="https://5sigmas.com/en/series/llm-inference-engineering-economics/02-kv-cache-memory-hierarchy-continuous-batching-pagedattention/">Read the article →</a></aside>
  <section class="s5-video-watch__related" aria-labelledby="related-videos-title"><div class="s5-video-watch__section-head"><span class="s5-eyebrow">Next step</span><h2 id="related-videos-title">Related videos</h2></div><div class="s5-video-watch__related-grid"><article><a href="https://5sigmas.com/en/videos/series/evaluating-ai-systems-production/06-observability-failure-taxonomies-production-eval-repair-feedback-loops/"><img src="https://5sigmas.com/en/series/evaluating-ai-systems-production/06-observability-failure-taxonomies-production-eval-repair-feedback-loops.jpg" alt="" loading="lazy" width="1280" height="720"><span>Other topics · 0:36</span><strong>Observability, failure taxonomies, and feedback loops</strong></a></article>
<article><a href="https://5sigmas.com/en/videos/series/evaluating-ai-systems-production/05-online-evaluation-shadow-canary-ab-guardrails-regression-gates/"><img src="https://5sigmas.com/en/series/evaluating-ai-systems-production/05-online-evaluation-shadow-canary-ab-guardrails-regression-gates.jpg" alt="" loading="lazy" width="1280" height="720"><span>Other topics · 0:36</span><strong>Online evaluation: shadow, canary, A/B, and regression gates</strong></a></article>
<article><a href="https://5sigmas.com/en/videos/series/evaluating-ai-systems-production/04-evaluacion-trayectorias-agentes-tools-exito-eficiencia-recuperacion-policy/"><img src="https://5sigmas.com/en/series/evaluating-ai-systems-production/04-evaluacion-trayectorias-agentes-tools-exito-eficiencia-recuperacion-policy.jpg" alt="" loading="lazy" width="1280" height="720"><span>Other topics · 0:36</span><strong>Agent trajectories: success, efficiency, recovery, and policy</strong></a></article></div></section>
</div>
