Hidden State Mixing and Gradient Detach
Hidden state mixing (HSM) and hidden state gradient detach (HSGD) are two ways to train a drafter for speculative decoding. NVIDIA researchers introduced them in a November 2026 preprint on drafters that use the target language model's hidden states. HSM changes which hidden states the drafter receives during training. HSGD changes where gradients flow during training. Both leave the inference procedure unchanged.[1]
Why training and inference differ
A recurrent multi-token prediction drafter predicts several tokens before the target model checks them. The next draft step can use hidden states from earlier draft steps. At inference, its attention can see a prefix made from target-model states followed by a tail made from the drafter's own states. Conventional training typically exposes a draft step to a sequence of states from the target alone or from one earlier draft step. The difference can matter more later in a draft, when the drafter must rely on more of its own output.[1]
EAGLE-3's training-time test explicitly recreates this mixed context during training. HSM approximates the exposure using states the training process already computes.[1][2]
How the methods work
HSM aligns the target's states and the states from earlier draft steps so that the candidates at a given position predict the same token. One implementation samples a source independently at each position. A second starts with the target states and replaces randomly selected positions after each draft step, replacing fewer positions at later steps. NVIDIA publishes HSM code in Megatron-LM and NVIDIA Model Optimizer.[1][3][4]
HSGD randomly stops backpropagation through selected connections between draft steps and through the token embeddings supplied to those steps. The values reaching a step during the forward pass stay the same, and each step still has its own prediction loss.[1]
Reported results
In joint pretraining followed by supervised fine-tuning, the authors reported higher acceptance rates with HSGD near the start of a draft and with HSM near the end. A separate experiment kept the target weights frozen and retrained the drafter using HSM with knowledge distillation. Across four Nemotron checkpoints and DeepSeek V4-Pro, the largest relative gain in mean acceptance length was 52.2% for DeepSeek V4-Pro at temperature 1 with seven draft positions on the SPEED-Bench qualitative split. That result measures tokens advanced per verification step. Actual decoding latency also depends on the cost of the draft and verification steps.[1][5]
In a four-step EAGLE-3 training comparison for Qwen3-8B on a four-GPU GB300 node, HSM used 36.3 GiB of peak reserved training memory per GPU versus 70.3 GiB for training-time test. The result measures training memory for that setup.[1]
Continue reading
- Speculative DecodingSpeculative decoding is a lossless inference acceleration technique for autoregressive transformer models in which a small, fast draft model proposes several future tokens at once and the larger target model…Linked in the introduction
- Multi-token predictionMulti-token prediction (often abbreviated MTP) is a language modeling training objective in which the model is trained to predict several future tokens at each context position rather than only the next token.Links back to this article
- Knowledge DistillationKnowledge distillation is a training method in which a student model learns from signals produced by a teacher model.Also in AI Inference
- PagedAttentionPagedAttention is a KV-cache memory management algorithm for serving large language models that applies the virtual-memory paging technique used by operating systems to the GPU, eliminating memory…Also in Model Architecture
- YaRNYaRN (Yet another RoPE extensioN method) is a compute-efficient method for extending the context window of large language models that use Rotary Position Embeddings (RoPE).Also in Model Architecture
- RadixAttentionRadixAttention is a KV cache management technique introduced in SGLang that uses a radix tree data structure to automatically share and reuse cached key-value tensors across inference requests.Also in Model Architecture
More to read
References
- ^1 ^2 ^3 ^4 ^5 ^6 ^7Galron, Y., Karimi Mahabadi, R., Ashkenazi, M., et al. Improving Tail-Augmented Speculative Drafting with Hidden State Mixing and Gradient Detach. arXiv preprint, November 25, 2026. Sections 2 through 7, Table 4 and Figure 12.
- ^Li, Y., Wei, F., Zhang, C., and Zhang, H. EAGLE-3: Scaling up Inference Acceleration of Large Language Models via Training-Time Test. March 2025. Revised April 2025.
- ^NVIDIA. Multi-token prediction implementation. Megatron-LM.
- ^NVIDIA. Speculative decoding examples. NVIDIA Model Optimizer.
- ^NVIDIA Research. SPEED-Bench: A Unified and Diverse Benchmark for Speculative Decoding. 2026.
- ^Yaniv Galron et al., Figure 1. Original image source. CC BY 4.0. License text. Original SVG rasterized on white.
Improve this article
Add missing citations, update stale details, or write a clearer explanation. Anyone can edit: changes go live when you publish, and every edit is checked by an editor.
2 revisions · v2 · 598 words · full history
Fact-checks are independent of edits: a reviewer re-verifies the article against its sources and stamps the date. How we verify
Research and drafting on this wiki are AI-assisted, under named human editorial standards. How AI is used here
Cite this page: AI Wiki. "Hidden State Mixing and Gradient Detach." aiwiki.ai, updated 29 Nov 2026. CC BY 4.0. https://aiwiki.ai/wiki/hidden_state_mixing_and_gradient_detach

