agent-readings / Inference and Serving Infrastructure
Draft fast, verify exactly
The one sentence
For agents, per-step latency compounds across tool loops, search, debate, retries, and self-consistency. Speculative decoding attacks the wall-clock cost of every generation without requiring a new target model.
Before this paper
Generating K tokens from an autoregressive Transformer normally requires K serial target-model invocations.
Large target-model decode steps are slow and often limited by memory bandwidth or communication rather than raw arithmetic.
Adaptive computation methods can speed some cases but often require architecture changes, retraining, or accept changed output distributions.
The paper asks whether a small approximation model can propose tokens while a large target model verifies them in a way that preserves exact target-model sampling behavior.
Core idea
Generate a speculative token block with a cheap model, run the expensive target model once over that block to score all proposed positions, accept the longest prefix allowed by a distribution-preserving rule, and sample a corrected token when a draft token is...
Run the approximation model autoregressively for gamma draft tokens.
Run the target model once on the prompt plus speculative tokens to obtain target probabilities for all draft positions.
Walk through proposed tokens in order and accept each according to the speculative sampling rule.
If all proposed tokens are accepted, sample one additional token from the target model's next-token distribution.
Action grammar
q: approximation model distribution.
p: target model distribution.
gamma: number of speculative tokens proposed per round.
draft token: token sampled from q.
Executable shape
Evidence
The paper states that decoding K tokens takes K serial runs of the large autoregressive target model.
The paper proposes sampling a speculative prefix from an efficient approximation model, then running the target model on those proposed tokens to verify them in parallel.
The authors state the speculative sampling method can generate several tokens concurrently without changing the target distribution, and Figure 1 illustrates fewer target runs...
The abstract says the method accelerates existing off-the-shelf models without retraining or architecture changes.
Claim map
Standard autoregressive decoding requires K serial target-model runs to generate K tokens.
Speculative decoding proposes several tokens with an efficient approximation model and verifies them using the target model in parallel.
The algorithm preserves the target model's output distribution rather than merely approximating it.
The method can accelerate off-the-shelf models without retraining or architecture changes.
Agent infrastructure
Speculative decoding is a latency primitive for agent loops: every model call can return faster without changing the requested target distribution.
The draft model becomes serving infrastructure. It must be co-located, versioned, monitored, and chosen per target/workload.
Exactness matters for agent reliability. Speculative decoding's appeal is preserving outputs, not merely making a cheaper model answer first.
Speedup depends on acceptance rate. Hard reasoning, long-tail domains, or mismatched draft models can reduce gains.
Caveats
The method needs a useful approximation model; a weak draft model can waste work.
The target distribution is preserved only if the sampling rule and probabilities are implemented exactly.
The headline 2x-3x speedup is workload/model/implementation-specific.
Speculative decoding reduces latency but does not reduce the semantic number of agent decisions.
Run it
No PoC yet - contributions welcome. A compact PoC could implement speculative sampling over two tiny Markov models and empirically verify output-distribution preservation.