EPFL's Floodgates Turns Recurrent AI Loops Into 8.2x Faster Token Generation
Floodgates uses low-rank adapters to turn a single shallow loop of a looped language model into a parallel multi-token drafter, hitting up to 7.5x speedups.
Takeaways
- Floodgates turns a looped LM's shallow loop into a parallel multi-token drafter using LoRA adapters.
- Achieves up to 7.5x lossless acceleration across seven models and five benchmarks.
- On 4-loop Ouro models, accepts 4.6-9.0 tokens per step for 3.0-6.0x speedup.
- On 32-loop models with 24 elastic passes, accepts 19-29 tokens per step for 4.5-8.2x.
- Beats a 5-layer DFlash drafter with 4.5x fewer trained parameters on Ouro 1.4B.
- Drafter checkpoints released on Hugging Face for plug-in use.
An EPFL-led research team has introduced the Floodgates paper, which describes a self-speculative decoding method for looped language models. Floodgates uses a shallow pass through the target model to propose several future tokens, then verifies them with the full model. Across seven models and five benchmarks, it was the fastest lossless method among the compared baselines in most reported settings. Headline speedups reached 7.5× over ordinary decoding, while a 32-loop elastic-drafting configuration reached 8.2×.
Plain autoregressive inference runs the complete model to commit each generated token. Speculative decoding reduces those expensive passes by letting a cheaper drafter propose a block of tokens that the full model can check in parallel. Self-speculative methods derive that drafter from the target model, reducing the need to train and serve a separate model.
Looped language models make that arrangement especially useful. Models such as ByteDance’s Ouro checkpoints reuse a recurrent block for additional test-time computation without adding parameters. Ouro-1.4B contains a 24-layer recurrent stack, while Ouro-2.6B expands the stack to 48 layers. In the four-loop configurations evaluated by the researchers, each additional iteration reuses the same weights. Floodgates turns one inexpensive iteration into a drafter whose parameters already align with the full verifier.
One loop drafts a block
- Prepare the draft. Floodgates appends a configurable block of mask tokens to the accepted prefix.
- Run the shallow path. Draft-only low-rank adapters activate while one recurrent iteration predicts every masked position in parallel.
- Verify the proposals. The complete model scores the proposed block in one forward pass.
- Advance the sequence. Under greedy decoding, the runtime commits the matching prefix, stops at the first mismatch, uses the verifier’s prediction there, and retains the full-depth prefix cache for the next cycle.
The low-rank adapters, commonly called LoRA adapters, are small trainable matrices attached to frozen model layers. Floodgates trains these adapters for parallel drafting while leaving the verifier weights unchanged. The paper therefore classifies the method as lossless: its verification and acceptance procedure preserves the output distribution of ordinary decoding.
Why shallow passes can predict ahead
Looped pretraining applies next-token supervision at every recurrent depth, encouraging early iterations to encode information about several upcoming tokens. Floodgates uses that latent predictive capacity to fill multiple masked positions during one shallow pass.
The drafter also attends to the deep prefix cache created during the preceding verification pass. That cache contains full-depth internal states for the accepted prefix, so the shallow path can reuse rich context without recomputing the complete model for each proposal.
Longer accepted blocks drive the gains
| Model and setting | Draft depth | Accepted tokens per step | Speedup |
|---|---|---|---|
| Ouro, four-loop greedy decoding | One pass | 4.6–9.0 | 3.0–6.0× |
| 32-loop models with elastic drafting | 24 passes | 19–29 | 4.5–8.2× |
| Ouro-1.4B on GSM8K and MATH-500 | One pass, about 25% of full depth | Not specified | 5.5× and 5.5× |
| Recurrent Llama 3.2 on GSM8K and MATH-500 | One pass, about 7% of full depth | Not specified | 4.9× and 5.8× |
On Ouro-1.4B, a five-layer DFlash block drafter reached 4.3× on GSM8K and 4.1× on MATH-500. Floodgates reached 5.5× on both tasks while training about one-quarter as many drafter parameters, according to the paper.
Elastic drafting adds pretrained recurrent passes at inference time without further adapter training. The 32-loop models could spend 24 passes on drafting because each pass represented a small fraction of the verifier’s total depth. Those extra passes produced longer accepted blocks and reduced the number of full verification calls.
Wall-clock gains depend on hardware, kernels, draft length, acceptance rate, prompt shape, and verifier depth. The four-loop ranges above come from greedy decoding, so deployments using sampling or different batching policies need workload-specific measurements.
Continuous batching keeps its gains
Concurrent serving can narrow speculative-decoding gains as verification work and cache traffic increase with batch size. Floodgates avoids depth pipelining and reads the final-loop prefix cache once for each proposed block, limiting synchronization and memory overhead.
Under continuous batching on an Nvidia A100, Floodgates delivered the highest system throughput at every batch size tested on Ouro-1.4B and Ouro-2.6B. At the largest batch that fit in memory, it generated 2.1× and 2.7× as many tokens per second as ordinary decoding on the two models, respectively.
Compatibility sets the boundary
- Recurrent architecture: Floodgates requires a looped verifier with a usable shallow path. Standard decoders such as Llama 3 and Qwen require recurrent conversion and compatible training. The paper demonstrates this route with Recurrent Llama 3.2.
- Runtime support: A serving engine must append mask blocks, activate LoRA only during drafting, verify proposed blocks, apply the acceptance rule, and preserve the correct prefix cache.
- Checkpoint matching: Drafter adapters must match the base model and recurrent configuration used during training.
- Depth tuning: Deep verifiers can benefit from elastic drafting. Four-loop models generally favor a single draft pass because extra passes consume a larger share of total compute.
- Decoding policy: The headline four-loop measurements use greedy decoding. Sampling deployments must implement the paper’s lossless acceptance procedure and benchmark it under their production settings.
The researchers have released adapter checkpoints for supported Ouro and Recurrent Llama variants. These weights remove the need to retrain the base model, while serving integration remains necessary. For compatible recurrent deployments, Floodgates reduces full-model verification calls by reusing the model’s own shallow path as a parallel drafter.