Next Token or Vector? Learning How Far to Decode
Organizations: Microsoft · University of Massachusetts Amherst
Abstract
Standard autoregressive decoding advances one token at a time, even when several upcoming tokens can be predicted together. We propose CADENCE (Context-Adaptive DEcoding), a generation method that learns both what to draft and how far to draft. Gaussian prediction heads represent future spans as continuous latent vectors, and a shared decoder converts the selected vector into token predictions in parallel. A learned router selects the prediction length from the model's own hidden states and predicted Gaussian parameters, adapting generation granularity to the current context with single-token generation as a fallback. The backbone verifies each proposed continuation and retains the prefix that matches its greedy predictions. Experiments with Llama-3.1-8B-Instruct on Alpaca, GSM8K, and HumanEval show that router-selected positions yield higher draft acceptance than applying the corresponding prediction length everywhere. CADENCE achieves up to 1.3x higher generation throughput than standard greedy decoding.
Figures & tables
| Method | Prediction | Length control |
|---|---|---|
| CALM | Chunk vector | Fixed chunk size |
| CoLaR | Reasoning latent | Prompted compression |
| MEDUSA | Token tree | Configured tree |
| EAGLE-3 | Token tree | Confidence-based tree selection |
| DFlash | Token block | Configured block size |
| SpecDec++ | Token chain | Learned stopping |
| Context-only router | Gaussian-enhanced router | ||||||
| Horizon | Draft | Token acc. | Full acc. | Token acc. | Full acc. | ||
| 2 | 1.70 | 84.8% | 69.5% | 1.74 | 87.1% | 74.3% | |
| 3 | 2.27 | 75.5% | 49.8% | 2.38 | 79.3% | 58.6% | |
| 4 | 2.68 | 67.1% | 35.4% | 2.74 | 68.5% | 40.0% | |
| 5 | 2.85 | 56.9% | 21.5% | 3.02 | 60.5% | 31.3% | |
| 6 | 3.27 | 54.6% | 25.1% | 3.57 | 59.4% | 30.7% | |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Exact-match label | ||||||
| Router | 0 | 1 | 2 | 3 | 4 | 5 |
| 0 | 35.0 | 12.3 | 4.4 | 1.1 | 0.3 | 0.1 |
| 1 | 3.9 | 13.8 | 3.3 | 1.0 | 0.3 | 0.1 |
| 2 | 2.4 | 3.2 | 6.8 | 1.5 | 0.4 | 0.1 |
| 3 | 1.1 | 1.1 | 1.0 | 2.1 | 0.4 | 0.1 |
| 4 | 0.2 | 0.4 | 0.2 | 0.2 | 0.6 | 0.1 |
LLM Inference Acceleration
LLM inference acceleration develops algorithms and systems that reduce language-model latency, memory use, and serving cost while preserving output quality.
See all 1,033 papers