VI. Decoding Acceleration
Techniques that produce more useful tokens per forward pass: speculative decoding, the tooling to train drafters, and fast constrained decoding.
22 entries · 3 subsections
Editor’s pick
VI.1 Speculative Decoding 11
Fast Inference from Transformers via Speculative Decoding Paper
Introduced draft-then-verify decoding with an acceptance rule that leaves the target model's output distribution unchanged.
EAGLE-3 Paper
Predicts tokens instead of features and fuses low-, mid-, and high-layer target features via training-time test, so drafters keep improving with more data.
Accelerating Large Language Model Decoding with Speculative Sampling Paper
Concurrent DeepMind derivation of draft-and-verify decoding with a modified rejection sampler, evaluated on Chinchilla 70B.
SpecInfer Paper
Organizes draft candidates into a token tree and verifies all branches in one pass with tree attention, the basis of tree-based speculation.
Medusa Paper
Adds extra decoding heads to the target model that propose several future tokens, checked together with tree attention, with no separate drafter.
EAGLE Paper
Drafts at the feature level, with a light head that extrapolates the target's second-to-top-layer hidden states given the sampled token.
Better & Faster Large Language Models via Multi-token Prediction Paper
Trains several output heads on a shared trunk to predict future tokens at once; the extra heads double as self-speculative drafters.
SuffixDecoding Paper
Model-free drafting from suffix trees over prompts and earlier outputs, aimed at repetitive agent workloads; vLLM's suffix method calls this code.
P-EAGLE Paper
Turns EAGLE into a parallel drafter that proposes several tokens per forward pass, with a training scheme that scales to long reasoning sequences.
DFlash Paper
Uses a small block-diffusion model, conditioned on target-model features, to draft a whole block of tokens in one pass; DFlash 2 followed.
Spec-Bench Benchmark
Shared harness that compares speculative decoding methods on the same model and GPU across chat, translation, summarization, QA, math, and RAG.
VI.2 Drafter Training 4
SpecForge Library
SGLang team's framework for training EAGLE-3, P-EAGLE, and DFlash drafters online or offline, producing checkpoints that SGLang serves directly.
Speculators Library
Generates target hidden states with vLLM, trains EAGLE-3, P-EAGLE, DFlash, and DSpark drafters, and stores them in a format vLLM loads as-is.
TorchSpec Library
Disaggregated drafter training that streams target hidden states from inference engines to trainers through Mooncake instead of writing them to disk.
EAGLE (official code) Library
Authors' training and inference code with released draft weights for EAGLE-1, EAGLE-2 dynamic draft trees, and EAGLE-3.
VI.3 Structured Outputs & Constrained Decoding 7
XGrammar Library
Grammar engine that prechecks context-independent tokens to build masks cheaply; XGrammar-2 adds tag-triggered structures for tool calls.
llguidance Library
Rust engine pairing a regex-derivative lexer with an Earley parser to compute token masks per step; a backend in vLLM, SGLang, and llama.cpp.
Outlines Library
Python library that constrains generation to JSON Schema, regex, or grammars across local models and hosted APIs.
Efficient Guided Generation for Large Language Models Paper
Compiles regexes and grammars into finite-state machines and precomputes an index over the vocabulary so each masking step is cheap.
Guidance Library
Python programming model that interleaves prompts, generation, and grammar constraints in one program, with llguidance as its engine.
LM Format Enforcer Library
Enforces JSON Schema or regex output by walking a character-level parser alongside the tokenizer prefix tree; also a vLLM backend.
JSONSchemaBench Benchmark
Real-world JSON Schemas for comparing constrained-decoding engines on coverage, speed, and output quality, plus MaskBench for mask latency.