Decoding Speed for 27B-Class LLMs: The Payoff Boundaries of Speculative Decoding
This article examines why decode speed for 27B-class LLMs deserves separate analysis, reviews the memory-bound bottleneck of autoregressive decoding, explains the draft-verify structure and cost model of speculative decoding, discusses parallel block drafting, compares short-request and long-context results, and provides an engineering evaluation framework for deciding whether to enable speculative decoding in production.
1. Problem Background: Why Decode Speed for 27B-Class Models Deserves Separate Discussion
In open-source communities, developers often discuss questions like “how many tokens/s can we reach on a given 27B-class model?” The question looks simple, but it involves a set of variables: hardware configuration, quantization precision, inference framework, batching strategy, and whether speculative decoding is enabled. On the same GPU and with the same model, throughput can differ by several times just because the decoding strategy is different.
What matters more is not peak speed on short requests, but stable speed in long-context scenarios. Take code agent applications as an example: the input context is often close to 100k tokens, and the output is often not highly regular code snippets, but free-form text that mixes natural language reasoning and tool-call instructions. Under this kind of workload, decode speed directly determines agent response latency and unit cost.
2. Where the Bottleneck of Autoregressive Decoding Lies
Standard autoregressive decoding (AR) produces only one token per forward pass. Its performance bottleneck is memory access rather than compute: when the batch is small, the GPU needs to read all model weights from GPU memory at every step, while the computation per token is relatively small. This leads to low compute utilization, and memory bandwidth becomes the practical bottleneck.
This motivates speculative decoding: if the bottleneck is that reading weights is expensive while computation is too small, can one weight read produce multiple tokens?
3. Basic Principles and Overhead Structure of Speculative Decoding
3.1 Draft-Verify Two-Stage Flow
The core flow of speculative decoding is:
- A smaller and cheaper draft model drafts several candidate tokens consecutively.
- The target model performs one forward pass to verify the entire candidate segment in parallel.
- Verification truncates at the first rejected position, keeps only the continuously accepted prefix, and adds one additional token according to the verification rule.
The key property is that as long as the verification rule is implemented correctly, usually through a correction mechanism based on rejection sampling, speculative decoding does not change the output distribution of the target model. In other words, the speedup does not come at the cost of generation quality.
3.2 An Approximate Speed Formula
Let τ denote the average number of tokens ultimately advanced per round, including the token added by the target model. The per-token latency in the decode phase can be approximated as:
average per-token latency ≈ (T_draft × N_draft + T_verify + T_other) / τ
Here, T_draft is the draft drafting time, T_verify is the target verification time, and T_other includes scheduling, sampling, KV state maintenance, and other overheads not listed separately. N_draft is the number of drafted tokens.
This formula reveals two facts that are often overlooked:
- High acceptance length is only a necessary condition, not a sufficient one. The draft and verification steps themselves must be cheap enough; otherwise, even a high τ cannot translate into net benefit.
- Verification cost accounts for a large share. Related experimental data show that on medium-sized target models, the verification stage often accounts for more than 70% of the total time per round. This means speculative decoding is essentially “using a small amount of draft time to amortize expensive verification time.”
4. Parallel Drafting: From Token-by-Token to Drafting a Whole Block in One Forward Pass
Early speculative decoding draft models still drafted tokens autoregressively one by one, so serial overhead on the draft side accumulated as the draft length increased. Later, a class of improvement ideas emerged: let the draft model draft the entire token block in one forward pass, shifting serial dependencies on the draft side into the network itself.
Specifically, in each layer of the draft model, the current prediction feature from the previous position is injected into the next position, so that dependencies between tokens are established layer by layer along network depth, rather than waiting serially for the previous token between layers. In this way, the cost of drafting N tokens is close to one forward pass, and draft overhead is greatly reduced.
Measurements for this type of approach usually include two metrics:
- Average acceptance length: about 25%–30% higher than baseline draft methods.
- End-to-end throughput: usually a relative improvement of more than 20% under mainstream inference frameworks.
5. Long Context vs. Short Requests: What the Two Sets of Data Mean
5.1 Short Requests: Peak Speed Looks Good but Is of Limited Representativeness
Short code requests often produce idiomatic snippets with strong patterns, so draft acceptance rates are naturally high, and decode speed may reach several times that of AR without speculative decoding. Such data is suitable as a reference for the capability upper bound, but it should not be directly extrapolated to production workloads.
5.2 Long Context: Gains Closer to Real Business Workloads
In multiple long continuation scenarios with roughly 100k-token contexts, even after request-level merging and normalization, overall speed can usually reach nearly 3× the AR baseline. This number is lower than the peak for short requests, but it is more informative for three reasons:
- In the later part of long outputs, generated content deviates from high-frequency patterns, and acceptance length naturally decreases.
- Under long contexts, the attention computation share in the target verification forward cost rises, making verification more expensive.
- In serving deployments, scheduling overhead and inter-batch interference further erode paper gains.
6. An Engineering Evaluation Framework
If you want to evaluate whether to enable speculative decoding in your own service, it is recommended to organize experiments according to the following framework:
# Evaluation dimensions (pseudocode)metrics = {"avg_accept_len": mean(accepted_tokens_per_round), # includes target-provided token"draft_overhead_ratio": T_draft / T_round, # draft share"verify_overhead_ratio": T_verify / T_round, # verification share"speedup_short": speed_short_spec / speed_short_ar, # short-request speedup"speedup_long": speed_long_spec / speed_long_ar, # long-context speedup}
Key criteria:
- The draft share should not be too high. If draft time exceeds one-third of the total time per round, the draft model is too heavy relative to the target model or the draft is too long. In that case, shorten the draft block or switch to a smaller draft model.
- Measure on the real workload distribution. Use a request set sampled from production traffic, not constructed benchmarks.
- Separate prefill and decode metrics. Speculative decoding only affects the decode phase; first-token latency is unaffected. Do not mix them during evaluation.
- Pay attention to quantization precision consistency. When the draft and target use different precisions, acceptance rates may change significantly, so the quantization configuration should be reported as well.
7. Summary
The value of speculative decoding is not in a single number such as “how much acceptance length improves,” but in the complete tradeoff captured by the formula: the increase in τ, the relative costs of draft and verification, and the dilution of acceptance rates by real serving workloads. For 27B-class models, mainstream parallel drafting approaches achieving nearly 3× decode speedup in long-context code agent scenarios is a relatively consistent measured level at present. Whether peak data can be reproduced depends on how “predictable” your output distribution is. Before adoption, it is recommended to run the evaluation framework in Section 6 on your own traffic and look at acceptance length, overhead ratios, and real speedup together before drawing conclusions.
