Self-Speculative Decoding Accelerates Lossless Inference in Any-Order and Any-Subset Autoregressive Models

Gabe Guo, Stefano ErmonICLR 2026

TL;DR

Researchers have unlocked a "free lunch" for any-order language models by introducing Any-Subset Speculative Decoding (ASSD). By allowing a model to act as its own "draft" speculator, they achieved lossless, parallel token generation that is mathematically guaranteed to be as fast as or faster than standard sequential decoding. Remarkably, this approach allows small models to outperform much larger ones on complex infilling tasks.

What Problem Does This Paper Address?

Most state-of-the-art Large Language Models (LLMs) are "left-to-right" autoregressive models. While powerful, they have two major flaws:

  1. Speed: They generate tokens one-by-one, which is computationally inefficient and limits throughput.
  2. Flexibility: They struggle with "infilling" (predicting missing text in the middle of a block) because they are fundamentally not designed to look at context to the right of the cursor.

Discrete diffusion models were proposed as a parallel alternative, but they suffer from a "fidelity gap." To generate tokens quickly, they assume tokens are independent of each other during a single step. This assumption only holds for tiny steps; in practice, parallel sampling causes the output to drift away from the true data distribution.

The authors revisit a "forgotten" class of models: Any-Subset Autoregressive Models (AS-ARMs). These models can predict tokens in any order, but until now, they lacked a principled way to sample tokens in parallel without losing quality.

Methods: Any-Subset Speculative Decoding (ASSD)

The paper introduces ASSD, a novel algorithm designed specifically for AS-ARMs to overcome the limitations of both left-to-right and diffusion models.

The "Self-Speculation" Trick

In traditional speculative decoding, a tiny "draft" model guesses several tokens, and a large "oracle" model verifies them. ASSD realizes that an AS-ARM can play both roles simultaneously:

  • Drafting: The model predicts multiple tokens in parallel by assuming they are independent (which is fast, but potentially inaccurate).
  • Verification: Because of its unique architecture, the same model can calculate the joint probability of those guessed tokens in a single forward pass using a specialized "causal-like" attention mask.

Mathematical Guarantees

The authors prove two critical properties of ASSD:

  1. Lossless Generation: The output distribution is mathematically identical to sampling one token at a time.
  2. Efficiency Guarantee: Unlike standard speculative decoding—which can actually be slower than normal decoding if the draft model is inaccurate—ASSD is guaranteed never to require more neural network calls than the number of tokens it generates.

Key Insights

  • The Power of $2^N$: While "Any-Order" models theoretically have $N!$ (factorial) ways to order a sequence, AS-ARMs use a "recursive binary lattice" to reduce this to $2^N$ subsets. This makes the training objective manageable while keeping the model flexible enough for any infilling task.
  • The "Free" Speculator: You don't need to train a separate draft model. The AS-ARM's ability to switch between independent parallel prediction and joint density estimation via attention masking provides the speculator for free.
  • The "First Token" Lemma: A subtle but vital insight is that in every iteration of the ASSD loop, the first speculated token is always accepted. This ensures the algorithm never "wastes" a forward pass.

Key Results

  • State-of-the-Art Infilling: On the ROCStories benchmark, the 110M parameter AS-ARM outperformed other models of similar size (like SEDD and MDLM) and even beat larger models on several metrics.
  • Punching Above Its Weight: In code generation (HumanEval), the 110M XLNet-Code model nearly matched the performance of DiffuLLaMA, a model roughly 60 times larger (6.7B parameters).
Comparison of XLNet-Code and DiffuLLaMA on code generation
  • Speedups & Zero Quality Loss: ASSD provided a consistent speedup over sequential decoding. Generative perplexity and entropy remained statistically identical to sequential sampling, confirming the "lossless" nature of the algorithm. While the raw wall-clock speedup was around 10-15% for smaller models, it reached 50% on larger 340M parameter models when combined with KV-caching.
Performance comparison of ASSD against sequential decoding

Limitations and Future Work

  • Optimization Gap: The current implementation does not yet use highly optimized kernels like FlashAttention, which are standard in GPT-style models. This means that while the number of calls is lower, the raw wall-clock time isn't yet beating the most optimized sequential engines.
  • Scaling: The study focused on models under 1 billion parameters. Future work is needed to see if these benefits hold as models scale to the 7B-70B parameter range.
  • KV-Caching Complexity: Implementing KV-caching for any-order models is more complex than for left-to-right models, and the authors found it only became significantly helpful as the model size and sequence length increased.

Summary updated

BibTeX
@inproceedings{guo2026self,
  author = {Gabe Guo and Stefano Ermon},
  title = {{Self-Speculative Decoding Accelerates Lossless Inference in Any-Order and Any-Subset Autoregressive Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=hZnibTOke7},
}
Figure