TL;DR
Loop Transformers save memory by reusing the same neural network block over and over for each token, but all those extra loops make text generation painfully slow. This paper explores Speculative Loop, a training-free trick where the model drafts several tokens using just a few loop iterations and then verifies them all at once at full depth. It delivers $1.83\times$–$1.93\times$ speedups across three model families—and reveals a surprising catch: drafting more accurate tokens can actually make your model slower.
What Problem Does This Paper Address?
Standard Transformers stack dozens of unique layers. Loop Transformers (like Huginn, Parcae, and Ouro) take a different approach: they apply a single shared block repeatedly—say, 32 times—to pack more computation into each token without growing the parameter count.
The catch? Every loop iteration sits directly on the critical path of autoregressive decoding. Huginn-3.5B, for instance, runs its 4-layer block 32 times per token, totaling 132 layer passes.
Speculative decoding is a popular fix for slow generation: a cheap "drafter" guesses the next few tokens, and the expensive "target" model checks them in a single parallel pass. Usually, this requires training or loading a separate, smaller draft model. Loop Transformers, however, already have a built-in dial for compute: loop depth. You can stop the loop early and use the checkpoint's existing output head (its native readout) to guess tokens. While prior work noted this possibility, nobody had systematically measured how many loop iterations a drafter should actually run—or how draft depth and draft window size interact to determine real-world speed.
Methods
The authors implement Speculative Loop in both vLLM and PyTorch:
- Shallow Drafting: Starting from the last verified token, the model runs only $t < T$ loop iterations to propose $k$ tokens sequentially.
- Full-Depth Verification: The full model ($T$ iterations) processes all $k$ proposals (plus a bonus position) in one causal, batched forward pass. It accepts the longest matching prefix and emits a target correction (or bonus token), preserving the exact output distribution of the full model.
In vLLM, verification recomputes the full loop from scratch. In PyTorch, the authors also test state reuse (continuation): if the first $t$ iterations don't depend on the stopping depth and only read cache entries from iteration $t$ or earlier, the verifier can skip the first $t$ loops and resume from the saved draft states.
To make sense of the trade-offs, the authors model the cost per emitted token as $L(t, k) = C(t, k) / \tau(t, k)$, where $C$ is the total round cost (drafting $k$ tokens at depth $t$ plus verification) and $\tau$ is the expected number of tokens emitted per round.
Datasets
The authors evaluate on four public benchmarks (with a 256-token budget and greedy decoding):
- MT-Bench (all 80 first-turn dialogue prompts)
- HumanEval (100 code generation prompts)
- GSM8K (100 mathematical reasoning prompts)
- Alpaca (100 instruction-following prompts)
For comparing against trained drafters (EAGLE-1 and EAGLE-3) on Huginn, those baseline drafters were trained on a 9,000-conversation corpus.
Key Insights and Ideas
- Higher acceptance does not mean higher throughput: On Huginn's HumanEval workload (with window $k=6$), doubling draft depth from $t=4$ to $t=8$ boosts the average accepted tokens $\tau$ from $4.89$ to $6.03$. Yet overall speedup drops from $2.302\times$ to $2.057\times$. Why? Every extra draft iteration has to be paid at all $k$ draft steps, and the extra accepted tokens don't pay back that cost.
- Depth and window size must be tuned together: On MT-Bench, widening the draft window from $k=4$ to $k=6$ hurts throughput at $t=4$, but helps at $t=8$. You can't pick $t$ and $k$ independently.
- Longer prefixes don't beat a cheaper trained drafter: At $t=8$ on Huginn, Speculative Loop retains much longer prefixes than a trained EAGLE-1 drafter ($\tau = 6.73$ vs. $3.04$ on HumanEval). Still, EAGLE-1 is faster ($2.485\times$ vs. $2.052\times$) because EAGLE-1 spends far less compute per proposal.
Key Results
- Consistent vLLM speedups (full recomputation): Across the four benchmarks, mean speedups are $1.854\times$ on Huginn-3.5B ($T=32, t=8, k=6$), $1.929\times$ on Parcae-1.3B ($T=8, t=1, k=8$), and $1.830\times$ on Ouro-1.4B ($T=4, t=1, k=4$). HumanEval sees the biggest gains, peaking at $2.267\times$ on Ouro.
- PyTorch latency: Mean decoding time per output token drops from $166.0\text{ ms}$ to $85.1\text{ ms}$ on Huginn, $55.3\text{ ms}$ to $30.3\text{ ms}$ on Parcae, and $46.2\text{ ms}$ to $28.0\text{ ms}$ on Ouro.
- Batch-size scaling: On Huginn, as batch size grows from $B=1$ to $B=16$, speedup narrows ($2.050\times$ to $1.942\times$ on HumanEval; $1.884\times$ to $1.625\times$ on MT-Bench) but remains well above standard autoregressive decoding.
Limitations and Future Work
The experiments were run on a single GPU type (NVIDIA L20), using greedy decoding, with batch sizes up to 16. Non-greedy sampling, long-context generation, and tensor-parallel serving remain untested. Additionally, this study uses a fixed draft depth $t$ for every token; the authors note that an adaptive drafter—one that stops early on easy tokens and loops deeper on hard ones—is a promising next step.
Summary updated