---
title: Speculative decoding and prefix caching
seo_title: Speculative decoding and prefix caching — video
description: Speculative decoding proposes several cheap tokens and the target model verifies them; prefix caching reuses prefill work when the prefix truly matches.
keywords: speculative decoding, prefix caching, KV cache reuse, TTFT, TPOT, acceptance rate, draft model, inference latency
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-04-speculative-decoding-prefix-caching-latency-optimisations-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>Speculative decoding and prefix caching</h1><p>Speculative decoding proposes several cheap tokens and the target model verifies them; prefix caching reuses prefill work when the prefix truly matches.</p>
  </header>
  <div class="s5-video-watch__player">
    <video controls crossorigin="anonymous" preload="metadata" poster="/en/series/llm-inference-engineering-economics/04-speculative-decoding-prefix-caching-latency-optimisations.jpg" playsinline data-s5-watch-player><source src="/en/series/llm-inference-engineering-economics/04-speculative-decoding-prefix-caching-latency-optimisations.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>Start from the latency budget again</h2><p>For an autoregressively served request, we can keep the decomposition from chapter 4.1:</p></article>
<article><span>02</span><h2>Prefix caching reuses state from a previously computed prefix</h2><p>In an autoregressive Transformer, prefill produces K/V state for input tokens. If a later request begins with exactly the same prefix under the runtime&#x27;s identity contract, that K/V state…</p></article>
<article><span>03</span><h2>A hit only covers the state that is actually reusable</h2><p>Let a request contain Lin input tokens and let Lhit tokens be covered by reusable KV state. Define a token-weighted reuse ratio:</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 draft proposes a block of tokens</span></a></li>
<li><a href="?t=12" data-s5-video-seek="12"><time>0:12</time><span>The verifier accepts a prefix and rejects the rest</span></a></li>
<li><a href="?t=24" data-s5-video-seek="24"><time>0:24</time><span>A prefix hit avoids repeated prefill</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/04-speculative-decoding-prefix-caching-latency-optimisations/">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>
