Loop-Count Schedules in Looped Transformers: An Empirical Study
Abstract
Looped transformers apply one block of layers several times with shared weights, trading parameters for repeated computation. We study how the schedule of the loop iteration count R during training determines whether each extra pass acts as a full layer or as a small correction, using a controlled ladder of 46M-110M-parameter models trained on 2B tokens with learned residual gates on every loop pass and three schedules: R fixed to 2, R sampled uniformly from {1,...,6}, and R sampled from {2,3,4}. We find that the lower bound of the sampling range is the decisive choice. If the sampled range includes R=1, so that some training steps run the block only once and compute the loss on that single pass, the gates collapse to 0.1-0.5 and each additional pass becomes a small correction to the first; if the range starts at R=2, so that every training step runs the block at least twice, the gates stay at 0.6-0.9 and each pass keeps the strength of a full layer, while the model can still be run at any R from 2 up to twice the largest trained value with validation loss within a few hundredths of a nat of its best. The {2, 3, 4} schedule gives the best looped model, 2.909 nats against 2.951 for the parameter-matched plain model, and degrades by only 0.038 nats when run at twice its trained depth. We further show that under a fixed R the direction of the residual stream converges geometrically beyond the trained depth while the loss diverges, which refines a recent finding that static-depth training does not converge, and that reusing the first pass's keys and values on later passes costs 0.01-0.03 nats in every regime while making the per-token iteration uniformly contractive and halving the inference cache. The loop recovers about a third of what real depth provides at equal parameters. The code, trained weights, and per-token traces are released.
Figures & tables
| block | fixed R=2 | ||
|---|---|---|---|
| 0 | 0.31 / 0.18 | 0.41 / 0.10 | 0.47 / 0.17 |
| 1 | 0.54 / 0.43 | 0.31 / 0.30 | 0.47 / 0.52 |
| 2 | 0.84 / 0.60 | 0.33 / 0.38 | 0.65 / 0.55 |
| 3 | 0.97 / 0.71 | 0.40 / 0.45 | 0.81 / 0.75 |
| 4 | 1.00 / 0.96 | 0.46 / 0.37 | 1.00 / 0.83 |
| 5 | 0.63 / 0.91 | 0.12 / 0.37 | 0.49 / 0.89 |
| schedule | R=1 | R=2 | R=3 | R=4 | R=5 | R=6 | R=8 |
|---|---|---|---|---|---|---|---|
| fixed R=2 | 4.956 | 2.919 | 3.011 | 3.140 | — | 3.749 | — |
| 3.001 | 2.932 | 2.918 | 2.916 | 2.918 | 2.921 | 2.932 | |
| 4.602 | 2.927 | 2.909 | 2.911 | 2.918 | 2.926 | 2.947 |
| metric, schedule | p2 | p3 | p4 | p5 | p6 | p7 | p8 |
|---|---|---|---|---|---|---|---|
| , fixed R=2 | 0.020 | 0.009 | 0.006 | 0.004 | 0.003 | — | — |
| , | 0.0034 | 0.0025 | 0.0021 | 0.0017 | 0.0015 | 0.0013 | 0.0011 |
| , | 0.0168 | 0.0068 | 0.0051 | 0.0035 | 0.0024 | 0.0017 | 0.0012 |
| , fixed R=2 | 0.229 | 0.172 | 0.150 | 0.135 | 0.124 | — | — |
| , | 0.104 | 0.090 | 0.082 | 0.076 | 0.071 | 0.066 | 0.062 |
| , | 0.195 | 0.136 | 0.124 | 0.109 | 0.095 | 0.084 | 0.076 |
| regime | fresh | static | cost | tok/s |
|---|---|---|---|---|
| 3 blocks, fixed R=2 | 3.055 | 3.071 | +0.016 | 86.1k 87.6k |
| 3 blocks, | 3.041 | 3.067 | +0.026 | 57.5k 59.3k |
| 6 blocks, fixed R=2 | 2.917 | 2.929 | +0.012 | 51.6k 52.8k |
| 6 blocks, | 2.916 | 2.933 | +0.017 | 28.5k 30.7k |
| 6 blocks, | 2.908 | 2.924 | +0.016 | 32.4k 34.7k |
| model | non-emb params | passes | val loss | tok/s |
|---|---|---|---|---|
| plain_3 | 21.2M | 1 | 3.112 | 131.5k |
| looped_3, fixed R=2 | 21.2M | 2 | 3.055 | 86.1k |
| looped_3, , R=4 | 21.2M | 4 | 3.041 | 57.5k |
| plain_6 | 42.5M | 1 | 2.951 | 88.9k |
| looped_6, fixed R=2 | 42.5M | 2 | 2.919 | 51.6k |
| looped_6, , R=3 | 42.5M | 3 | 2.909 | 32.4k |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| run | R=1 | R=2 | R=3 | R=4 | R=5 | R=6 | R=8 | best | tok/s |
|---|---|---|---|---|---|---|---|---|---|
| plain_3 | 3.112 | 3.112 | 131.5k | ||||||
| looped_3, fixed R=2 | 5.685 | 3.055 | 3.288 | 3.668 | 4.970 | 3.055 | 86.1k | ||
| looped_3_skv, fixed R=2 | 4.737 | 3.071 | 3.259 | 3.512 | 4.288 | 3.071 | 87.6k | ||
| looped_3_rs, | 3.229 | 3.079 | 3.048 | 3.041 | 3.041 | 3.045 | 3.059 | 3.041 | 57.5k |
| looped_3_skv_rs, | 3.196 | 3.092 | 3.072 | 3.067 | 3.068 | 3.072 | 3.084 | 3.067 | 59.3k |
| plain_6 | 2.951 | 2.951 | 88.9k |
| run | R=1 | R=2 | R=3 | R=4 | R=5 | R=6 | R=8 | best | tok/s |
|---|---|---|---|---|---|---|---|---|---|
| plain_6_s43 | 2.952 | 2.952 | 89.0k | ||||||
| looped_6_s43, fixed R=2 | 4.866 | 2.920 | 3.016 | 3.138 | — | 3.434 | — | 2.920 | 50.9k |
| looped_6_rs_s43, | 3.001 | 2.932 | 2.918 | 2.915 | 2.917 | 2.921 | 2.932 | 2.915 | 30.7k |
| looped_6_r234_s43, | 4.647 | 2.928 | 2.910 | 2.912 | 2.918 | 2.927 | 2.948 | 2.910 | 34.7k |
| schedule | p2 | p3 | p4 | p5 | p6 | p7 | p8 |
|---|---|---|---|---|---|---|---|
| fixed R=2 | 1.094 | 1.095 | 1.093 | 1.092 | 1.089 | — | — |
| 1.058 | 1.052 | 1.049 | 1.047 | 1.045 | 1.044 | 1.042 | |
| 1.089 | 1.074 | 1.076 | 1.073 | 1.067 | 1.061 | 1.057 |
| model | best R | fineweb | code | math |
|---|---|---|---|---|
| plain_3 | 1 | 3.321 | 1.868 | 2.688 |
| plain_6 | 1 | 3.159 / 3.160 | 1.722 / 1.719 | 2.516 / 2.517 |
| plain_12 | 1 | 3.025 | 1.605 | 2.379 |
| looped_3, fixed R=2 | 2 | 3.264 | 1.815 | 2.625 |
| looped_3_skv, fixed R=2 | 2 | 3.279 | 1.836 | 2.647 |
| looped_3_rs, | 4 | 3.248 | 1.807 | 2.620 |
| run | block 0 | block 1 | block 2 | block 3 | block 4 | block 5 |
|---|---|---|---|---|---|---|
| looped_3, fixed R=2 | 0.99 / 0.29 | 0.98 / 0.70 | 1.00 / 0.91 | |||
| looped_3_skv, fixed R=2 | 0.53 / 0.38 | 0.79 / 0.79 | 1.00 / 0.94 | |||
| looped_3_rs, | 0.59 / 0.17 | 0.58 / 0.54 | 0.58 / 0.72 | |||
| looped_3_skv_rs, | 0.47 / 0.16 | 0.32 / 0.45 | 0.81 / 0.68 | |||
| looped_6, fixed R=2, seed 42 | 0.28 / 0.15 | 0.50 / 0.40 | 0.81 / 0.65 | 0.98 / 0.72 | 1.00 / 0.96 | 0.67 / 0.91 |
| looped_6, fixed R=2, seed 43 | 0.34 / 0.22 | 0.58 / 0.45 | 0.89 / 0.55 | 0.96 / 0.69 | 1.00 / 0.96 | 0.59 / 0.91 |
| run | p2 | p3 | p4 | p5 | p6 | p7 | p8 |
|---|---|---|---|---|---|---|---|
| looped_6_rs, seed 42 | 0.11 | 0.25 | 0.34 | 0.43 | 0.50 | 0.57 | 0.65 |
| looped_6_rs, seed 43 | 0.10 | 0.27 | 0.36 | 0.44 | 0.50 | 0.56 | 0.62 |
| looped_6_skv_rs | 0.44 | 0.48 | 0.54 | 0.59 | 0.63 | 0.71 | 0.80 |
| looped_6_r234, seed 42 | 0.00 | 0.03 | 0.10 | 0.24 | 0.36 | 0.42 | 0.50 |
| looped_6_r234, seed 43 | 0.01 | 0.07 | 0.15 | 0.26 | 0.37 | 0.46 | 0.55 |
| looped_6_skv_r234 | 0.05 | 0.13 | 0.21 | 0.29 | 0.38 | 0.46 | 0.52 |