Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Explain how a prefix-cache hit changes the latency profile of a request, and whether that change makes speculative decoding more, less, or equally valuable for the same request. Argue from where each technique actually saves time.
Prefix cache saves prefill, speculation saves decode. They are orthogonal, and speculation's relative win on a cache-hit request is unchanged. The two stack and you want both for long-prefix RAG.
Think of a long bus trip in two parts: a slow scenic drive to the city (prefill), then a fast highway run home (decode). A prefix cache is like a teleporter that skips the scenic drive when you have made the same trip before; it has nothing to do with how fast the highway part goes. Speculative decoding is a faster engine for the highway run; it has nothing to do with whether you teleported there or drove. If you teleport in and then drive home, the faster engine still gives you the same time savings on the highway as it would after a normal scenic drive. The two improvements affect different legs of the same trip, so they stack rather than overlap.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: phase decomposition + cache saves prefill + speculation saves decode + orthogonality argument + composition in RAG + monitoring each phase.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming that a cache hit reduces the value of speculation because total request time is shorter. The relative speedup of speculation is set by decode-step cost and acceptance rate, neither of which the cache touches.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.