LoopAhead: Speculating Ahead for Faster Decoding in Looped Language Models
Problem Statement
Looped Transformers save parameters, but they decode slowly: each token needs many sequential passes through the same layers, with repeated weight access. Existing pipelined self-speculative methods draft from early-loop predictions and advance tokens at staggered depths in one batch. However, they draft only one step ahead from early-loop features and waste compute verifying branches that turn out wrong, which limits the achievable speedup.
Key Novelty
- A Lookahead Drafter (LAD): a lightweight head on early-loop states that predicts multiple future tokens, not just the next one, giving a longer speculative horizon.
- Complementary depth roles: early loops draft, intermediate and deeper loops give feedback to prune or pause unpromising branches, and the full-depth model makes the final lossless accept/reject decision.
- Depth-aware branch scheduling that cuts computation spent on verifying incorrect speculative branches inside the pipelined, asynchronous batch.
Evaluation Highlights
- Up to 7.82x decoding speedup over standard autoregressive decoding of looped Transformers.
- Preserves the target model's output distribution (lossless speculative decoding).
Signal Assessment
Methodology
- Attach a lightweight Lookahead Drafter to early-loop hidden states of the looped Transformer and train it to predict multiple future tokens (a tree or set of draft branches).
- Pipeline the decoding: tokens at different recurrent depths are advanced asynchronously in the same batch, so drafting and deeper-loop computation overlap.
- Use deeper-loop predictions as intermediate feedback to decide which draft branches to continue expanding and which to pause, saving compute on likely-wrong branches.
- Verify with the full-depth model under a standard speculative acceptance rule, so the final tokens follow the target model's exact output distribution.
System Components
Lightweight module that reads early-loop states and drafts multiple future tokens, extending the speculation horizon beyond next-token early exits.
Uses intermediate-depth predictions to rank draft branches, continuing promising ones and pausing likely-incorrect ones to avoid wasted verification compute.
Batches tokens at different recurrent depths together, so weight loads are amortized across drafting, refinement and verification work.
Runs the complete looped model and accepts or rejects drafts losslessly, preserving the target distribution.
Results
| Metric/Benchmark | Baseline | This Paper | Delta |
|---|---|---|---|
| Decoding speedup vs. autoregressive | 1.0x (autoregressive looped decoding) | Up to 7.82x | +6.82x (up to) |
| Speedup vs. prior pipelined self-speculative decoding | Single-step early-loop drafting (no exact figure in abstract) | Higher (multi-token lookahead + branch pausing) | Positive (not quantified in abstract) |
| Output fidelity | Target model distribution | Target model distribution preserved | Lossless (no quality loss) |
| Wasted verification compute | Verifies all speculative branches | Pauses low-confidence branches via deeper-loop feedback | Reduced (qualitative) |
Key Takeaways
- In looped or recurrent-depth models, early-loop states are useful for more than next-token drafting. A small multi-token head on them can yield long speculative lookahead nearly for free, with no separate draft model.
- Intermediate depths can act as cheap 'soft verifiers' that prune speculative trees before full-depth verification. This general idea could carry over to early-exit and layer-skip speculative decoding in standard LLMs.
- Batching tokens at staggered recurrent depths amortizes memory-bound weight access. This makes looped Transformers far more attractive for latency-sensitive deployment, such as agent loops and on-device inference, without sacrificing exact output distribution.
Abstract
Looped Transformers improve parameter efficiency by repeatedly applying the same Transformer layers. However, generating each token still involves sequential computation and repeated access to model weights, leading to high decoding latency. Recent pipelined self-speculative decoding methods reduce this delay by drafting tokens from early-loop predictions and asynchronously advancing tokens at different recurrent depths in the same batch, but they do not fully exploit early-loop features for longer lookahead and still spend computation verifying incorrect speculative branches. We introduce \method, a speculative decoding framework for looped transformers that enables earlier drafting of future tokens and assigns complementary roles to different recurrent depths. A lightweight lookahead drafter (LAD) predicts multiple future tokens with early-loop states, and deeper-loop feedback helps decide which draft branches to continue and which to pause, while the full-depth model makes the final token decisions. LoopAhead achieves up to 7.82x decoding speedup over autoregressive decoding while preserving the target model's output distribution.