Learning from Recurrence: Internalizing Depth-Induced Preferences in Looped Language Models
Organizations: University of Wisconsin-Madison · Microsoft
Abstract
A looped language model repeatedly applies the same block to its hidden state before predicting each token. The number of passes is its recurrent depth. Increasing this depth gives the model more computation per token with the same parameters. Can the shared block learn from the predictions it makes at greater depth? Following prior work, we retrofit pretrained OLMo-2-1B with a shared recurrent block and continue mid-training over varying recurrent depths. In the four-pass model, additional passes mainly redistribute probability among tokens that already rank highly after one pass. We use the continuations generated at greater depth to train only the shared block through a single pass, without reference answers or correctness filtering. We call this transfer preference write-back. Write-back further improves one-pass and multi-pass accuracy on most tasks. At their target depths, the updated models outperform a non-recurrent control matched for mid-training data and token budget on all six mathematical reasoning benchmarks, with a mean relative gain in accuracy of up to 46.2% across tasks. At four-pass inference, one-pass training outperforms full-depth training on the same targets in the model with input injection. This advantage disappears in the matched model without injection. On GSM8K, using the updated block only on passes two through four recovers nearly the entire four-pass gain, showing that an update learned in one pass can improve later applications of the same block.
Figures & tables
| Model | GSM8K | GSM1K | SVAMP | GSM-Symbolic | ASDiv | AQuA-RAT | Avg. | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Depth | 1 | 1 | 1 | 1 | 1 | 1 | vs. control | ||||||
| Non-looped control | 44.05 | – | 39.83 | – | 56.50 | – | 37.42 | – | 59.39 | – | 10.24 | – | – |
| Mean depth 4 | 40.86 | 56.18 | 36.93 | 51.12 | 52.40 | 63.30 | 31.82 | 43.56 | 55.44 | 64.82 | 14.17 | 16.93 | +26.5% |
| (+27.5%) | (+28.3%) | (+12.0%) | (+16.4%) | (+9.1%) | (+65.4%) | ||||||||
| + Self-distillation | 48.52 | 62.70 | 44.65 | 54.36 | 56.40 | 64.70 | 36.92 | 47.64 | 59.09 | 66.55 | 12.20 | 18.11 | +34.9% |
| (+42.3%) | (+36.5%) | (+14.5%) | (+27.3%) | (+12.1%) | (+76.9%) | ||||||||
| Model | Supervision | Trainable | Learning | GSM8K | GSM1K | ||
|---|---|---|---|---|---|---|---|
| parameters | depth | 1 | 4 | 1 | 4 | ||
| Non-looped ( ) | – | – | – | 44.05 | – | 39.83 | – |
| + SSD self-training | Own samples | Full | 1 | 42.23 | – | 37.43 | – |
| + Gold-answer SFT | Gold | Full | 1 | 44.73 | – | 40.17 | – |
| + Sequence KD | paths | Full | 1 | 47.46 | – | 40.83 | – |
| + EOPD | teacher | Full | 1 | 45.72 | – | 39.50 | – |
| Model | Depth | GSM8K | GSM1K | SVAMP | Avg. | ||||
|---|---|---|---|---|---|---|---|---|---|
| Teacher | Training | Depth 1 | Depth | Depth 1 | Depth | Depth 1 | Depth | gain | |
| Mean depth 4 | – | – | 40.86 | 56.18 | 36.93 | 51.12 | 52.40 | 63.30 | – |
| + Self-distillation | 4 | 1 | 48.52 | 62.70 (+11.6%) | 44.65 | 54.36 (+6.3%) | 56.40 | 64.70 (+2.2%) | +6.7% |
| 4 | 4 | 37.83 | 56.86 (+1.2%) | 37.18 | 51.04 ( 0.2%) | 52.00 | 62.20 ( 1.7%) | 0.2% | |
| 4 | 4 † | 37.53 | 56.63 (+0.8%) | 35.44 | 49.96 ( 2.3%) | 51.50 | 61.30 ( 3.2%) | 1.5% | |
| Mean depth 8 | – | – | 22.59 | 56.33 | 20.50 | 52.53 | 39.90 | 66.00 | – |
| Model | Injection | Trajectories | Training depth | GSM8K | GSM1K | SVAMP | Avg. | |||
| Depth 1 | Depth | Depth 1 | Depth | Depth 1 | Depth | gain | ||||
| Mean depth 4 | ✓ | – | – | 40.86 | 56.18 | 36.93 | 51.12 | 52.40 | 63.30 | – |
| + Self-distillation | ✓ | own | 1 | 48.52 | 62.70 (+11.6%) | 44.65 | 54.36 (+6.3%) | 56.40 | 64.70 (+2.2%) | +6.7% |
| ✓ | own | 4 | 37.83 | 56.86 (+1.2%) | 37.18 | 51.04 ( 0.2%) | 52.00 | 62.20 ( 1.7%) | 0.2% | |
| Mean depth 4 | ✗ | – | – | 43.90 | 50.80 | 38.42 | 45.31 | 54.90 | 58.70 | – |
| + Self-distillation | ✗ | own | 1 | 47.16 | 52.39 (+3.1%) | 42.90 | 45.31 (+0.0%) | 54.60 | 56.50 ( 3.7%) | 0.2% |
| Model | Checkpoint | GSM8K | GSM1K | |||
|---|---|---|---|---|---|---|
| Depth 1 | Depth | Depth 1 | Depth | |||
| Mean depth 4 (ours) | 4 | Original | 40.86 | 56.18 | 36.93 | 51.12 |
| Write-back | 42.76 (+4.6%) | 60.50 (+7.7%) | 39.50 (+7.0%) | 51.54 (+0.8%) | ||
| Retro-OLMo | 16 | Original | 29.49 | 45.87 | 24.65 | 43.07 |
| Write-back | 33.97 (+15.2%) | 48.60 (+6.0%) | 30.04 (+21.9%) | 45.23 (+5.0%) | ||
| Retro-LLaMA | 8 | Original | 25.63 | 46.17 | 24.15 | 43.98 |
| Model | Setting | GSM8K | GSM1K | SVAMP | Avg. | |||
| Depth 1 | Depth | Depth 1 | Depth | Depth 1 | Depth | gain | ||
| Mean depth 4 | – | 40.86 | 56.18 | 36.93 | 51.12 | 52.40 | 63.30 | – |
| + Self-distillation | teacher depth 4 | 48.52 | 62.70 (+11.6%) | 44.65 | 54.36 (+6.3%) | 56.40 | 64.70 (+2.2%) | +6.7% |
| teacher depth 1 | 38.06 | 59.29 (+5.5%) | 36.18 | 51.95 (+1.6%) | 53.10 | 63.60 (+0.5%) | +2.5% | |
| Mean depth 32 | – | 4.09 | 57.01 | 3.24 | 53.36 | 19.70 | 67.70 | – |
| + Self-distillation | teacher depth 32 | 31.84 | 62.09 (+8.9%) | 26.39 | 54.36 (+1.9%) | 36.20 | 65.70 ( 3.0%) | +2.6% |
| Model | Knowledge (2) | Exams (2) | Commonsense (4) | Science QA (3) | Reading (3) | Open QA (3) | All (17) |
|---|---|---|---|---|---|---|---|
| Non-looped control | 29.63 | 35.69 | 69.65 | 61.26 | 61.42 | 46.56 | 53.94 |
| Mean-depth-4 Looped LM | 32.39 (+9.0%) | 39.97 (+12.0%) | 70.04 (+0.6%) | 66.01 (+8.6%) | 67.20 (+10.5%) | 47.45 (+1.5%) | 56.88 (+6.3%) |
| + Self-distillation | 32.72 (+10.5%) | 40.07 (+12.3%) | 69.87 (+0.3%) | 65.91 (+8.6%) | 67.95 (+12.3%) | 47.59 (+2.4%) | 57.02 (+6.9%) |
| Mean-depth-8 Looped LM | 34.34 (+17.5%) | 41.65 (+16.7%) | 69.91 (+0.4%) | 67.27 (+10.8%) | 64.94 (+6.8%) | 46.32 ( 2.6%) | 56.90 (+6.8%) |
| + Self-distillation | 34.36 (+17.0%) | 41.62 (+16.6%) | 70.28 (+1.0%) | 67.47 (+11.1%) | 65.26 (+7.7%) | 46.43 ( 2.1%) | 57.09 (+7.1%) |
| Mean-depth-32 Looped LM | 34.04 (+16.5%) | 41.86 (+17.3%) | 70.14 (+0.8%) | 67.02 (+10.5%) | 63.56 (+3.1%) | 45.89 ( 3.3%) | 56.58 (+6.0%) |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Input injection | Optimizer | Backpropagation |
|---|---|---|---|
| Non-looped control | ✗ | AdamW | single fixed pass |
| Mean-depth-2 Looped LM | ✓ | Muon | every pass |
| Mean-depth-4 Looped LM | ✓ | Muon | every pass |
| Mean-depth-4 Looped LM, no injection | ✗ | Muon | every pass |
| Mean-depth-8 Looped LM | ✓ | AdamW | last eight passes |
| Mean-depth-32 Looped LM | ✓ | AdamW | last eight passes |
| Input: Looped LM with shared core and remaining parameters ; prompts ; | |
| teacher depth ; training depth ; number of epochs | |
| Expose: the frozen model generates targets at teacher depth | |
| for do | |
| greedy continuation of under , at most 512 tokens, kept unfiltered | |
| Incorporate: update only the shared core through passes |
| Setting | Value |
| Updated parameters | shared recurrent block (268M of 1.49B) |
| Objective | completion-only next-token cross-entropy |
| Optimizer | AdamW, , no weight decay |
| Learning rate | ; 10 linear warmup steps, then cosine decay |
| Batch | 16 sequences |
| Gradient clipping | global norm 1.0 |
| Benchmark | Questions | Shots | Token limit |
|---|---|---|---|
| GSM8K test ( Cobbe et al., 2021 ) | 1,319 | 8 | 512 |
| GSM1K ( Zhang et al., 2024 ) | 1,205 | 8 | 512 |
| SVAMP ( Patel et al., 2021 ) | 1,000 | 8 | 512 |
| GSM-Symbolic, main ( Mirzadeh et al., 2025 ) | 5,000 | 8 | 1,024 |
| ASDiv ( Miao et al., 2020 ) | 2,305 | 8 | 512 |
| AQuA-RAT ( Ling et al., 2017 ) | 254 | 4 | 512 |
| Comparison | GSM8K | GSM1K | SVAMP | GSM-Symbolic | ASDiv | AQuA-RAT |
|---|---|---|---|---|---|---|
| + Self-distillation minus Looped LM | ||||||
| Mean depth 4 | [4.2, 8.8] | [1.1, 5.5] | [ , 3.9] | [3.0, 5.3] | [0.5, 3.0] | [ , 6.3] |
| Mean depth 8 | [4.4, 8.6] | [1.2, 5.8] | [ , 1.4] | [2.3, 4.5] | [0.5, 3.0] | [ , 4.3] |
| Mean depth 32 | [2.7, 7.6] | [ , 3.6] | [ , 0.6] | [1.9, 4.4] | – | [0.0, 11.0] |
| Looped LM minus non-looped control | ||||||
| Mean depth 4 | [9.6, 14.6] | [8.7, 13.8] | [4.0, 9.7] | [4.9, 7.3] | [3.9, 6.9] | [2.0, 11.8] |
| Pass | |||||||
|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | Accuracy (%) | Change | 95% CI | Repaired / broken |
| ✗ | ✗ | ✗ | ✗ | 56.18 | – | – | – |
| ✓ | ✗ | ✗ | ✗ | 56.25 | [ , 1.4] | 39 / 38 | |
| ✗ | ✓ | ✓ | ✓ | 62.47 | [4.0, 8.6] | 164 / 81 | |
| ✓ | ✓ | ✓ | ✓ | 62.70 | [4.2, 8.8] | 165 / 79 | |
| Control | Mean-depth-4 | Mean-depth-8 | Mean-depth-32 | ||||||
| Task | Shots | Metric | Depth 1 | Looped LM | + Self-dist. | Looped LM | + Self-dist. | Looped LM | + Self-dist. |
| Knowledge | |||||||||
| MMLU | 5 | accuracy | 43.92 | 48.17 | 48.44 | 50.14 | 50.43 | 49.69 | 49.66 |
| MMLU-Pro | 5 | accuracy | 15.33 | 16.61 | 16.99 | 18.54 | 18.28 | 18.38 | 17.91 |
| Exams | |||||||||
| AGIEval | 3 | accuracy | 36.10 | 40.02 | 40.07 | 42.67 | 42.69 | 42.58 | 41.83 |