Looped Models are Fast Multi-Token Predictors: Floodgates

Summary (Overview)

  • Floodgates is a novel self-speculative decoding method for looped language models that achieves up to 7.5× acceleration over autoregressive decoding, outperforming all prior lossless decoding methods.
  • The method adapts a single loop iteration via low-rank adapters (LoRA) to draft multiple future tokens in parallel from mask tokens, while attending to the deep prefix cache (final-loop key-value cache) computed during verification.
  • Floodgates leverages two key insights: (1) all-depth training of looped models makes shallow loops predictive of several future tokens, and (2) conditioning on the deep prefix cache allows the shallow drafter to access full-depth computation "for free."
  • The method includes elastic drafting, which uses additional passes of the pretrained loop to refine drafts on deep models (32+ loops), and an adaptive verification budget for high-throughput batched serving.
  • Evaluated across 7 looped models and 5 benchmarks (GSM8K, MATH-500, HumanEval+, MBPP+, BBH), Floodgates is the fastest lossless method in most settings under both greedy and sampled decoding.

Introduction and Theoretical Foundation

Background: The Autoregressive Bottleneck

Autoregressive (AR) transformer language models generate text sequentially, where each token's hidden state must attend to all previous tokens' hidden states. This creates a serialized bottleneck in generation speed. However, due to local regularities in natural language, many upcoming tokens are predictable, which speculative decoding exploits.

The Drafter Capacity Problem

Standard speculative decoding uses a fast drafter (either a separate small network or a subset of layers) to propose tokens that the full model verifies. However, these drafters suffer from a fundamental limitation:

"The drafters are usually prevented from using the full knowledge encoded in all layers of the model, leading to a limited verification rate of their drafts."

Looped Language Models as a Solution

Looped language models process each token through a shared block of layers repeatedly:

zrt=fθ(zr−1t;cr<t),r=1,…,R\mathbf{z}_r^t = f_\theta\big(\mathbf{z}_{r-1}^t; \mathbf{c}_r^{<t}\big), \qquad r = 1, \ldots, R

where zrt∈Rd\mathbf{z}_r^t \in \mathbb{R}^d is the hidden state at loop rr, and cr<t\mathbf{c}_r^{<t} denotes the context (keys and values) at loop rr. The deep prefix cache cR<t\mathbf{c}_R^{<t} represents the model's full-depth representation of all earlier tokens.

Key Theoretical Insights

  1. All-depth supervision: Looped models are trained with losses at every loop depth:
Lloop(θ):=Ex[∑t∑r=1RλrCE⁡(g(zrt),xt+1)]\mathcal{L}_{\text{loop}}(\theta) := \mathbb{E}_{\mathbf{x}}\left[\sum_{t}\sum_{r=1}^{R}\lambda_r \operatorname{CE}\left(g(\mathbf{z}_r^t), \mathbf{x}^{t+1}\right)\right]

This pressures each future token to be predicted as early as possible, encouraging shallow hidden states to carry information about future tokens.

  1. Deep prefix cache access: The shallow drafter can attend to the final-loop cache cR<t\mathbf{c}_R^{<t} (computed during verification) "for free," providing full-depth context representations without additional computation.

Methodology

Drafting Mechanism

Floodgates appends kk mask tokens (learnable vectors m∈Rd\mathbf{m} \in \mathbb{R}^d) after the current token and runs the shared block once over all slots in parallel:

(z^t,z^t+1,…,z^t+k)=fθ((z0t,m,…,m);cR<t),qj=g(z^t+j)(\hat{\mathbf{z}}^t, \hat{\mathbf{z}}^{t+1}, \ldots, \hat{\mathbf{z}}^{t+k}) = f_\theta\big((\mathbf{z}_0^t, \mathbf{m}, \ldots, \mathbf{m}); \mathbf{c}_R^{<t}\big), \qquad \mathbf{q}^j = g(\hat{\mathbf{z}}^{t+j})

The draft distributions qj\mathbf{q}^j are read out with the output head gg.

Training Objective

The drafter is trained with a cross-entropy objective applied jj tokens ahead:

L(ϕ,m)=Ex,t[∑j=1kwjCE(g(z^t+j),xt+j)]\mathcal{L}(\phi, \mathbf{m}) = \mathbb{E}_{\mathbf{x}, t}\left[\sum_{j=1}^{k} w_j \mathsf{CE}\big(g(\hat{\mathbf{z}}^{t+j}), \mathbf{x}^{t+j}\big)\right]

where:

  • x∼D\mathbf{x} \sim \mathcal{D} comes from the model's own generations
  • wj∝e−(j−1)/4w_j \propto e^{-(j-1)/4} (exponentially decaying weights prioritizing earlier positions)
  • ϕ\phi are low-rank adapters (LoRA) active only during drafting
  • The base model weights θ\theta and output head gg remain frozen (ensuring lossless decoding)

Elastic Drafting

For deep models (32+ loops), Floodgates refines drafts through iterative passes:

(z^t,…,z^t+W)←fθ((z^t+j,Edj)j=0W;cR<t),dj←argmax(g(z^t+j))(\hat{\mathbf{z}}^t, \ldots, \hat{\mathbf{z}}^{t+W}) \leftarrow f_\theta\big((\hat{\mathbf{z}}^{t+j}, \mathbf{E}_{d^j})_{j=0}^{W}; \mathbf{c}_R^{<t}\big), \qquad \mathbf{d}^j \leftarrow \mathrm{argmax}\big(g(\hat{\mathbf{z}}^{t+j})\big)

Each pass costs only E/WE/W effective loops per position. The number of elastic passes EE is a hyperparameter selected on held-out problems.

Adaptive Verification Budget (Batched Serving)

For concurrent serving, Floodgates selects the optimal number of drafts M∗M^* to verify:

M⋆=argmax⁡M∈{B,2B,…,kB}B+∑(b,j)∈SMπb,jT(M)M^{\star} = \underset{M \in \{B, 2B, \ldots, kB\}}{\operatorname{argmax}} \frac{B + \sum_{(b,j) \in \mathcal{S}_M} \pi_{b,j}}{T(M)}

where πb,j=∏i=1jαb,i\pi_{b,j} = \prod_{i=1}^{j} \alpha_{b,i} estimates acceptance probability for slot jj of sequence bb.

Empirical Validation / Results

Main Results (Batch Size One)

Table 1: Speedup over plain decoding on A100 (greedy decoding)

ModelMethodGSM8KMATH-500HumanEval+MBPP+BBH
Ouro 1.4BFloodgates5.04×4.69×4.83×3.01×4.40×
LoopSpec2.77×2.81×3.10×2.83×2.86×
DAS1.91×2.07×2.59×2.06×2.16×
Ouro 2.6BFloodgates5.56×6.04×5.57×3.39×5.07×
LoopSpec3.06×3.10×3.33×3.09×3.10×
Recurrent Llama 3.2Floodgates5.04×6.97×6.91×5.84×6.62×
LoopSpec4.61×6.11×6.03×5.41×5.65×
DAS-Wave4.56×5.98×5.92×5.19×5.84×
Huginn 3.5BFloodgates4.48×6.21×6.18×5.06×5.70×
DAS-Wave4.23×5.38×5.45×4.57×5.20×

Key findings:

  • Floodgates is the fastest lossless method on every model and task under greedy decoding
  • On 4-loop Ouro models: accepts 4.6–9.0 tokens/step, decoding 3.0–6.0× faster (no prior method exceeds 3.4×)
  • On 32-loop models: accepts 19–29 tokens/step with elastic drafting, reaching 4.5–8.2× speedup
  • Under sampling: fastest in 16 of 24 settings (LoopSpec wins on some Recurrent models)

Ablation: All-Depth Supervision and Full-Parameter Sharing

Table 3: Floodgates vs. separate drafters on Ouro 1.4B

DrafterParams.DepthGSM8KMATH-500
Separate, 1 layer56M1%2.55×2.85×
Separate, 4 layers210M4%3.70×4.09×
Separate, DFlash278M5%4.32×4.05×
Floodgates61M25%5.48×5.54×

Floodgates uses 4.5× fewer trained parameters than DFlash yet achieves 27% higher speedup, because it leverages all pretrained parameters of the target model.

Ablation: Deep Prefix Cache Conditioning

Table 4: Final-loop cache vs. first-loop cache

BenchmarkFinal loop cR<t\mathbf{c}_R^{<t}First loop c1<t\mathbf{c}_1^{<t}
Recurrent Llama 3.2
GSM8K4.93× (5.9)4.35× (5.2)
MATH-5006.47× (7.8)5.89× (7.1)
Ouro 1.4B
GSM8K5.04× (7.5)4.42× (6.6)
MATH-5004.69× (7.0)4.05× (6.1)

The deep prefix cache provides 10–32% faster decoding across benchmarks.

Elastic Drafting Across Verifier Depths

  • On shallow verifiers (4–16 loops): single-pass drafting (E=0E=0) is fastest
  • On deep verifiers (32–64 loops): speedup peaks at 16–24 elastic passes
  • Floodgates outperforms DAS-Wave by 63–89% at 4 passes, 37–49% at 8 passes

High-Throughput Batched Serving

  • On Ouro 1.4B: 2.1× plain decoding throughput at largest batch (5,805 tokens/s)
  • On Ouro 2.6B: 2.7× plain decoding throughput (2,827 tokens/s)
  • Adaptive verification budget improves throughput by 19% (Ouro 1.4B) and 54% (Recurrent Llama 3.2) at largest batch sizes

Theoretical and Practical Implications

Theoretical Implications

  1. All-depth training creates multi-token predictive states: The paper demonstrates that supervising every loop depth encourages shallow hidden states to encode information about future tokens, not just the immediate next token.

  2. Deep prefix cache enables full-depth computation access: A single shallow loop can leverage the model's complete computation by attending to the final-loop cache, effectively decoupling drafting cost from parameter access.

  3. Looped models resolve the drafter capacity tradeoff: In dense models, drafters must choose between speed (few parameters) and accuracy (many parameters). Looped models break this tradeoff by reducing computation (fewer loops) while keeping all parameters.

Practical Implications

  1. Lossless acceleration: Floodgates preserves the exact output distribution of the target model, making it safe for production deployment.

  2. Memory efficiency: Unlike pipelined methods (LoopSpec, WaveFront) that require multiple per-depth prefix caches, Floodgates reads only the final-loop cache once per step, making it suitable for concurrent serving.

  3. Minimal training overhead: Only low-rank adapters (61M params vs. 278M for DFlash) are trained, with the base model frozen.

  4. Compatibility with cross-loop cache sharing: Floodgates can be combined with shared-cache techniques, scaling batch sizes from 16 to 320 on Huginn 3.5B.

Conclusion

Floodgates demonstrates that looped language models are naturally suited for fast multi-token generation once their shallow loops are trained to look ahead. The key contributions are:

  1. A simple self-speculative decoding framework that adapts a single loop via low-rank adapters to draft multiple tokens in parallel
  2. Elastic drafting for deep models that optimizes the cost-acceptance tradeoff
  3. Adaptive verification budgets for high-throughput batched serving

The findings suggest that all-depth training and deep prefix conditioning are essential for effective multi-token drafting, and that looped architectures may be a promising direction for building faster inference systems without sacrificing model quality.

Future directions could include:

  • Extending Floodgates to other looped architectures
  • Exploring adaptive elastic drafting budgets during decoding
  • Investigating whether all-depth supervision could be improved to further enhance multi-token prediction at shallow depths

Related papers