Looped Models are Fast Multi-Token Predictors
Organizations: EPFL · University of Maryland · KAIST
Abstract
Looped language models can adapt computation for predicting a token without a proportional rescaling in unique model parameters by adjusting the number of loops. This property has been used for self-speculative decoding, taking shallow loops as fast drafters and deep loops as verifiers, which is effective since drafting still uses full parameters. In this paper, we show that shallow loops can be also predictive of several future tokens and leverage this to drastically accelerate the inference of looped language models. To that end, we present Floodgates, a simple self-speculative decoding method that appends a block of mask tokens as a suffix and learns via low-rank adaptation to draft these tokens in parallel. Across seven models, five benchmarks, a range of batch sizes, and both greedy and sampled decoding, Floodgates is the fastest lossless decoding method in most cases, attaining up to 7.5x acceleration. Through analysis, we show that this speedup is enabled by all-depth training of looped models, with the shallow drafter's ability to leverage full-depth computation by conditioning on deep prefix cache evaluated during verification.
Figures & tables
| GSM8K | MATH-500 | HumanEval+ | MBPP+ | BBH | |||||||
| Model | Method | Greedy | Sampling | Greedy | Sampling | Greedy | Sampling | Greedy | Sampling | Greedy | Sampling |
| Ouro 1.4B | LoopSpec ∗ | 2.51 (3.1) | 2.10 (2.8) | 2.60 (3.2) | 2.34 (3.0) | 3.01 (3.7) | 2.67 (3.5) | 2.62 (3.3) | 2.23 (3.0) | 2.67 (3.3) | 2.25 (2.9) |
| LoopSpec | 2.77 (3.5) | 2.40 (3.3) | 2.81 (3.5) | 2.53 (3.4) | 3.10 (3.9) | 2.77 (3.8) | 2.83 (3.6) | 2.51 (3.5) | 2.86 (3.6) | 2.46 (3.4) | |
| WaveFront | 2.34 (3.1) | 1.85 (2.4) | 2.47 (3.2) | 2.10 (2.7) | 2.77 (3.7) | 2.31 (3.0) | 2.38 (3.2) | 2.00 (2.6) | 2.52 (3.4) | 1.96 (2.5) | |
| DAS | 1.91 (5.8) | 1.74 (5.3) | 2.07 (6.4) | 1.97 (6.0) | 2.59 (7.9) | 2.40 (7.3) | 2.06 (6.3) | 1.83 (5.6) | 2.16 (6.6) | 2.07 (6.3) | |
| DAS-Wave | 0.44 (1.8) | 0.54 (1.9) | 0.44 (1.8) | 0.53 (1.9) | 0.43 (1.8) | 0.52 (1.8) | 0.44 (1.8) | 0.50 (1.8) | 0.42 (1.7) | 0.50 (1.8) | |
| GSM8K | MATH-500 | ||||
| Model | Method | Greedy | Sampling | Greedy | Sampling |
| Ouro 1.4B Thinking | LoopSpec | 2.72 (3.3) | 2.40 (3.3) | 2.74 (3.5) | 2.47 (3.5) |
| WaveFront | 2.24 (2.9) | 2.13 (2.8) | 2.31 (3.2) | 2.18 (3.0) | |
| DAS | 1.76 (5.5) | 1.65 (5.1) | 1.97 (6.0) | 1.80 (5.5) | |
| DAS-Wave | 0.47 (1.8) | 0.47 (1.8) | 0.48 (1.9) | 0.46 (1.8) | |
| JD | 0.86 (5.3) | 0.77 (4.7) | 0.85 (5.3) | 0.76 (4.8) | |
| Drafter | Params. | Depth | GSM8K | MATH-500 |
| Separate, 1 layer | 56M | 2.55 (2.9) | 2.85 (2.9) | |
| Separate, 4 layers | 210M | 3.70 (4.5) | 4.09 (4.4) | |
| Separate, DFlash | 278M | 4.32 (5.1) | 4.05 (4.6) | |
| Floodgates | 61M | 5.48 (7.6) | 5.54 (7.0) |
| Model | Block | Layers per token | Width | |
| Ouro 1.4B, Ouro 1.4B Thinking | entire stack, layers | |||
| Ouro 2.6B, Ouro 2.6B Thinking | entire stack, layers | |||
| Recurrent Llama 3.2 | prelude , core , coda | |||
| Recurrent TinyLlama | prelude , core , coda | |||
| Huginn 3.5B | prelude , core , coda |
| Task | Problems | Shots | Max. new tokens | Stop strings |
| GSM8K | first of | Q: , end of text | ||
| MATH-500 | first of | Problem: | ||
| HumanEval+ | all | end of function | ||
| MBPP+ | all | end of function | ||
| BBH | per task, | Q , blank line, end of text |
| Ouro 1.4B | Ouro 2.6B | 1.4B Thinking | 2.6B Thinking | Rec. Llama | Rec. TinyLlama | Huginn | |
| Training sequences | |||||||
| Mask tokens | |||||||
| Drafts per pass | |||||||
| Adapter rank | |||||||
| Trained parameters | M | M | M | M | M | M | M |
| Training steps | K | K | K | K | K | K | K |
| Model | GSM8K | MATH-500 | HumanEval+ | MBPP+ | BBH | |
| Greedy decoding | ||||||
| Ouro 1.4B | 5.04 (7.5) | 4.69 (7.0) | 4.83 (7.2) | 3.01 (4.6) | 4.40 (6.6) | |
| 3.75 (7.0) | 2.89 (5.4) | 3.37 (6.3) | 2.27 (4.4) | 3.29 (6.2) | ||
| Ouro 2.6B | 5.56 (8.2) | 6.04 (9.0) | 5.57 (8.3) | 3.39 (5.2) | 5.07 (7.5) | |
| 3.43 (6.3) | 2.92 (5.4) | 3.14 (5.8) | 2.28 (4.4) | 3.15 (5.9) | ||
| Ouro 1.4B Thinking | 3.70 (5.6) | 3.68 (5.5) | – | – | – | |
| Model | Method | GSM8K | MATH-500 | HumanEval+ | MBPP+ | BBH |
| Ouro 1.4B | LoopSpec | 2.77 [2.73, 2.80] | 2.81 [2.78, 2.84] | 3.10 [3.08, 3.11] | 2.83 [2.79, 2.88] | 2.86 [2.84, 2.88] |
| Floodgates | 5.04 [4.84, 5.24] | 4.69 [4.49, 4.91] | 4.83 [4.69, 4.99] | 3.01 [2.85, 3.25] | 4.40 [4.28, 4.52] | |
| Ouro 2.6B | LoopSpec | 3.06 [3.03, 3.09] | 3.09 [3.02, 3.15] | 3.33 [3.31, 3.34] | 3.09 [3.07, 3.11] | 3.10 [3.08, 3.11] |
| Floodgates | 5.56 [5.36, 5.77] | 6.04 [5.59, 6.46] | 5.57 [5.43, 5.70] | 3.39 [3.30, 3.49] | 5.07 [4.93, 5.20] | |
| Rec. Llama 3.2 | LoopSpec | 4.61 [4.45, 4.77] | 6.11 [5.88, 6.28] | 6.03 [5.90, 6.14] | 5.41 [5.21, 5.60] | 5.65 [5.57, 5.73] |
| Floodgates | 5.04 [4.75, 5.35] | 6.97 [6.68, 7.16] | 6.91 [6.75, 7.06] | 5.84 [5.54, 6.07] | 6.62 [6.54, 6.70] |
| Model | GSM8K | MATH-500 | HumanEval+ | MBPP+ | BBH | |||||
| Ouro 1.4B | 75.0 | 74.0 | 76.0 | 73.0 | 64.6 | 64.0 | 65.1 | 65.1 | 70.9 | 71.1 |
| Ouro 2.6B | 85.0 | 85.0 | 57.0 | 59.0 | 74.4 | 74.4 | 69.3 | 69.0 | 78.9 | 80.2 |
| Recurrent Llama 3.2 | 47.0 | 45.0 | 44.0 | 41.0 | 11.6 | 11.0 | 24.3 | 23.8 | 34.3 | 34.1 |
| Huginn 3.5B | 29.0 | 29.0 | 25.0 | 26.0 | 14.6 | 14.6 | 26.2 | 26.5 | 31.9 | 32.0 |
| Recurrent TinyLlama | 38.0 | 40.0 | 41.0 | 42.0 | 14.0 | 13.4 | 23.3 | 23.0 | – | – |
| Ouro 1.4B Thinking | 87.0 | 85.0 | 88.0 | 85.0 | – | – | – | – | – | – |
| Model | GSM8K | MATH-500 | HumanEval+ | MBPP+ | BBH | |||||
| Greedy decoding | ||||||||||
| Recurrent Llama 3.2 | 46.0 | 47.0 | 41.0 | 39.0 | 11.0 | 8.5 | 23.0 | 23.0 | 37.0 | 38.5 |
| Huginn 3.5B | 27.0 | 23.0 | 25.0 | 16.0 | 14.6 | 12.2 | 27.0 | 25.4 | 31.9 | 31.1 |
| Recurrent TinyLlama | 37.0 | 40.0 | 40.0 | 39.0 | 14.0 | 14.0 | 24.1 | 24.1 | – | – |
| Sampling at temperature and top- | ||||||||||
| Recurrent Llama 3.2 | 52.0 | 50.0 | 39.0 | 31.0 | 13.4 | 11.6 | 16.9 | 11.1 | 38.5 | 36.3 |
| GSM8K | MATH-500 | HumanEval+ | MBPP+ | BBH | |||||||
| Model | Method | Greedy | Sampling | Greedy | Sampling | Greedy | Sampling | Greedy | Sampling | Greedy | Sampling |
| Recurrent Llama 3.2 | Parallel sampler † | 5.38 | 5.03 | 5.68 | 5.41 | 5.67 | 5.56 | 5.54 | 5.52 | 5.44 | 5.39 |
| Floodgates | 5.04 (20.4) | 3.28 (7.6) | 6.97 (28.5) | 4.66 (11.0) | 6.91 (28.0) | 4.69 (10.9) | 5.84 (23.5) | 4.34 (10.1) | 6.62 (27.1) | 5.13 (12.1) | |
| Huginn 3.5B | Parallel sampler † | 5.37 | 5.38 | 5.79 | 5.79 | 5.78 | 5.73 | 5.24 | 5.38 | 5.34 | 5.13 |
| Floodgates | 4.48 (19.0) | 3.16 (7.3) | 6.21 (26.6) | 4.60 (10.8) | 6.18 (26.2) | 4.70 (10.9) | 5.06 (21.4) | 3.52 (8.1) | 5.70 (24.6) | 4.48 (19.3) | |
| Recurrent TinyLlama | Parallel sampler † | 5.72 | 5.32 | 6.01 | 5.87 | 6.03 | 5.06 | 5.86 | 5.54 | prompts exceed max context length | |
| Batch size | 1 | 2 | 4 | 8 | 16 | 32 | Largest | Best |
| Ouro 1.4B, GSM8K , largest batch size 80 | ||||||||
| Plain decoding | 105 | 207 | 394 | 733 | 1,252 | 1,948 | 2,708 | |
| LoopSpec | 229 | 322 | 384 | 414 | – | – | 419 ∗ | |
| DAS | 193 | 371 | 674 | 1,183 | 1,832 | 2,502 | 3,302 | |
| Prompt lookup decoding | 206 | 387 | 662 | 1,045 | 1,460 | 1,775 | 2,079 | |
| Floodgates, fixed block | 588 | 1,099 | 1,865 | 2,980 | 3,787 | 4,463 | 4,859 | |
| Model | Decoding | GSM8K | MATH-500 | HumanEval+ | MBPP+ | BBH |
| (100) | (100) | (164) | (378) | (540) | ||
| Recurrent Llama 3.2 | Plain decoding, per-loop caches | 47.0 | 44.0 | 11.6 | 24.3 | 34.3 |
| Plain decoding, single cache | 44.0 | 39.0 | 9.8 | 24.6 | 35.2 | |
| Floodgates, single cache | 44.0 | 42.0 | 10.4 | 24.3 | 35.0 | |
| Recurrent TinyLlama | Plain decoding, per-loop caches | 38.0 | 41.0 | 14.0 | 23.3 | – |
| Plain decoding, single cache | 38.0 | 42.0 | 13.4 | 24.3 | – |
| Configuration | GSM8K | MATH-500 | tok/s |
| Floodgates, positions, , rank | 7.69 | 6.46 | 475 |
| sampled positions per sequence | 7.30 | 5.90 | 449 |
| 6.58 | 5.84 | 410 | |
| 8.26 | 6.63 | 477 | |
| rank | 7.50 | 6.23 | 465 |
| noise input instead of mask tokens | 7.54 | 6.21 | 451 |
LLM Inference Acceleration
LLM inference acceleration develops algorithms and systems that reduce language-model latency, memory use, and serving cost while preserving output quality.
See all 1,277 papers