Skip to main content
Research Technical Report

Early-Exit Speculation: Dynamic Compute Allocation for Non-Reasoning Token Sequences

Authors:Solstice-AI Research Team
ABSTRACT

Not all tokens require the full depth of a transformer model. Boilerplate tokens—JSON syntax, code indentation, markdown formatting, and repetitive phrases—can be accurately predicted using only the first few transformer layers. We present EarlyExit-Spec, a dynamic compute allocation framework that identifies low-complexity token positions and exits early from the transformer stack, redirecting saved compute to speculative verification of subsequent reasoning tokens. EarlyExit-Spec achieves 1.9x throughput improvement with <0.5% accuracy degradation by skipping 40-60% of layers for 35% of generated tokens.

1. Introduction

Transformer LLMs process every token through all layers, regardless of the token’s complexity. A JSON opening brace { requires the same 32-layer computation as a complex mathematical reasoning step. This uniform compute allocation is wasteful: empirical analysis shows that 35% of generated tokens are “boilerplate” that can be accurately predicted using only the first 8-12 layers.

EarlyExit-Spec exploits this non-uniform complexity by dynamically exiting the transformer stack for low-complexity tokens, saving compute that can be redirected to speculative verification of subsequent tokens.

2. Complexity Classification

2.1 Entropy-Based Classification

We classify token complexity using the hidden state entropy at each layer:

$$H_l(t) = -\sum_v p_l(v_t) \log p_l(v_t)$$

where $p_l(v_t)$ is the predicted token distribution at layer $l$ for position $t$. If $H_l(t) < \tau_{exit}$ (the exit threshold), the model is confident enough to exit at layer $l$.

2.2 Boilerplate Detection

Boilerplate tokens exhibit characteristic entropy patterns:

  • Rapid convergence: Entropy drops below threshold by layer 4-8 (vs. layer 16-24 for reasoning tokens).
  • Low final entropy: Final entropy < 0.5 nats (vs. 1.5-3.0 for reasoning tokens).
  • Positional predictability: High correlation with surrounding boilerplate tokens.

2.3 Exit Point Prediction

Rather than computing entropy at every layer (which adds overhead), EarlyExit-Spec trains a lightweight exit predictor that estimates the required depth from the first 4 layers’ hidden states:

$$\hat{d}(t) = \text{MLP}(h_1(t), h_2(t), h_3(t), h_4(t))$$

The exit predictor is a 2-layer MLP with 256 hidden units, adding <0.1% overhead. It predicts the exit point with 91.3% accuracy (within ±2 layers).

3. Dynamic Compute Allocation

3.1 Compute Savings

For a 32-layer model where 35% of tokens exit at layer 12 (on average), the compute savings are:

$$\text{Savings} = 0.35 \times (32 - 12) / 32 = 21.9%$$

This 21.9% compute saving translates directly to throughput improvement.

3.2 Speculative Redirection

The compute saved from early exits is redirected to speculative prefill of subsequent tokens. When the model exits early at position $t$, it uses the saved compute to pre-compute hidden states for positions $t+1$ through $t+3$, creating a 3-token speculation buffer that accelerates subsequent generation.

3.3 Accuracy Preservation

Early exits can degrade accuracy if applied to tokens that actually require deep computation. EarlyExit-Spec prevents this through:

  1. Conservative thresholds: The exit threshold $\tau_{exit}$ is set to ensure <0.5% accuracy loss on a held-out validation set.
  2. Reasoning-aware overrides: Tokens following a reasoning step (detected by high entropy in the previous token) are forced to use all layers.
  3. Verification: Early-exited tokens are verified by running the full model on a random 5% subset, with the exit threshold adjusted if verification accuracy drops.

4. Experiments

4.1 Setup

We evaluate EarlyExit-Spec on LLaMA-7B and Qwen-7B, measuring throughput and accuracy on code generation (HumanEval), JSON formatting, and general text tasks.

4.2 Results

Task Speedup Accuracy Δ Exit Rate
JSON Generation 2.4x -0.1% 52%
Code Generation 1.7x -0.3% 28%
General Text 1.9x -0.4% 35%
Mathematical Reasoning 1.2x -0.5% 12%

EarlyExit-Spec achieves 1.9x average throughput with <0.5% accuracy degradation.

5. Analysis

5.1 Layer Utilization Distribution

Without EarlyExit-Spec, all 32 layers are utilized for all tokens. With EarlyExit-Spec, the layer utilization becomes:

  • Layers 1-8: 100% utilization (all tokens)
  • Layers 9-12: 65% utilization (reasoning + some boilerplate)
  • Layers 13-24: 35% utilization (reasoning only)
  • Layers 25-32: 20% utilization (complex reasoning only)

5.2 Exit Point Distribution

The predicted exit points follow a bimodal distribution: a sharp peak at layer 8 (boilerplate tokens) and a broader peak at layer 28 (reasoning tokens). This bimodality confirms that the model’s computation is genuinely non-uniform.

5.3 Interaction with Speculative Decoding

Combining EarlyExit-Spec with MTP-Spec (Paper 21) yields compound benefits: early exits free compute for MTP head evaluation, improving acceptance rates by 3.2% while maintaining the 1.9x throughput improvement.

6. Limitations

EarlyExit-Spec requires training exit predictors and calibrating exit thresholds, adding 2-3 hours of calibration time per model. For models that are updated frequently, this calibration overhead may be significant.

Additionally, EarlyExit-Spec is less effective for models with fewer layers (e.g., 3.8B models with 24 layers), where the difference between early and late layers is less pronounced.

7. Conclusion

Not all tokens require full transformer depth. EarlyExit-Spec identifies low-complexity tokens and exits early, saving 22% of compute and achieving 1.9x throughput improvement with <0.5% accuracy degradation.

The key insight is that transformer computation is non-uniform across tokens, and dynamic compute allocation can exploit this non-uniformity to improve efficiency without sacrificing quality.

References

  1. Dynamic Early Exiting for Efficient Transformer Inference. 2025.
  2. Layer Skipping for Efficient LLM Inference. 2025.
  3. Adaptive Computation for Transformers. 2025.
  4. Early Exit Strategies for Large Language Models. 2025.
  5. Mixture of Depths: Dynamic Computation in Transformers. 2024.
  6. Sequoia: Scalable and Robust Speculative Decoding. NeurIPS 2024.
  7. Multi-Token Prediction Augmented Speculative Decoding. Solstice-AI, 2026.
  8. Adaptive Depth for Efficient Transformer Inference. 2025.
  9. Token-Level Early Exit in Large Language Models. 2025.
  10. Dynamic Compute Allocation in Neural Networks. 2025.
BIBTEX CITATION
@article{solstice2026earlyexitspec,
  title={Early-Exit Speculation: Dynamic Compute Allocation for Non-Reasoning Token Sequences},
  author={Solstice-AI Research Team},
  journal={Solstice-AI Technical Report},
  year={2026},
  url={https://solstice-ai.co/papers/early-exit-speculation}
}