AI Infra Interviews logo
← CUDA, Triton & Kernel Engineering / 20
hardTogether AI

Implement the verification step of speculative decoding, including the rollback of the KV cache after a rejection.

Verify a drafted prefix without biasing the target distribution, then roll back rejected KV state. A six-token prefix exposes the off-by-one: nine committed tokens can have only eight valid KV entries.

Updated Oct 2026 · Learn how AI infrastructure works through explanations, worked examples and diagrams, then practise applying it to interview questions.

Verify a drafted prefix without biasing the target distribution, then roll back rejected KV state. A six-token prefix exposes the off-by-one: nine committed tokens can have only eight valid KV entries.

This answer is included with a free account. Sign in to read it and save your progress.

free account · no card needed

Work through the numbers

Change the assumptions in a free calculator, then explain what the result establishes and what still needs measurement.

UP NEXT ON YOUR JOURNEY
FEDITOR'S NOTE

Look for actual post-processor probabilities, residual correction, explicit logit indexing and separate committed-token versus computed-KV lengths. Page ownership, stopping behavior and measured round cost complete the implementation contract.

DISCUSSION · 0

No comments yet — be the first to share your approach.