Looped Transformers as Optimizers
Organizations: HKUST (GZ) · StepFun · SJTU · UCAS ·
Abstract
Looped Transformers provide a parameter-efficient approach to depth scaling by repeatedly applying shared Transformer blocks. Recent reasoning models have likewise highlighted the value of scaling test-time computation through longer computation trajectories. However, the principles for designing effective loop transitions remain poorly understood. We view the looped hidden state as a fast weight that is updated throughout the depth. We formulate loop transitions as local gradient-based updates, with recurrent blocks predicting implicit targets at each depth. Our framework derives loop transitions in closed form from a projection, a local objective and an optimizer update rule. Mapping representative loop transitions into this framework reveals mismatches between their transitions and projections. We first align the input maps of existing transitions. We then derive OperLoop, which combines explicit weight decay, adaptive step size and a delta objective. The aligned variants reduce training loss and improve average commonsense accuracy. OperLoop improves average generative performance over the compared looped and non-looped baselines under matched training FLOPs. These results support the framework's usefulness for loop design. We extend the analysis to additional loop models and outline a roadmap for future loop transition design.
Figures & tables
| Models | Ouro ( Zhu et al., 2025 ) | Huginn ( Geiping et al., 2025 ) | Parcae ( Prairie et al., 2026 ) | HyperLoop ( Zeitoun et al., 2026 ) |
| Original loop transitions | ||||
| Loop | ||||
| Projection | ||||
| Optimization mapping to | ||||
| Model | Param. | FLOPs | PPL | Commonsense Acc. (%) | ||||||||
| Lamb. | Wiki. | Lamb. | ARCc n | ARCe n | HellaS. n | WinoG. | PIQA n | Avg. | Avg. | |||
| Baseline | 6.56 | 13.08 | 60.16 | 40.96 | 71.13 | 64.78 | 59.51 | 76.61 | 62.19 | – | ||
| Parcae | 7.71 | 13.98 | 57.44 | 38.57 | 65.91 | 62.00 | 56.12 | 74.81 | 59.14 | – | ||
| Parcae (Aligned) | 7.41 | 13.93 | 58.59 | 37.71 | 65.53 | 62.09 | 56.91 | 74.92 | 59.29 | +0.15 | ||
| HyperLoop | 7.68 | 13.96 | 57.46 | 38.40 | 63.51 | 61.41 | 57.77 | 75.03 | 58.93 | – | ||
| HyperLoop (Aligned) | 7.35 | 13.93 | 58.63 | 35.15 | 66.67 | 62.83 | 58.56 | 74.97 | 59.47 | +0.54 | ||
| 300B Training Tokens, 4k Sequence Length | 500B Training Tokens, 4k Sequence Length | ||||||||
| Category | Dataset | Base | Loop | Base | Loop | ||||
| ( Metrics ) | 5B MoE | Parcae | HyperLoop | OperLoop | 10B MoE | Parcae | HyperLoop | OperLoop | |
| Parameters | |||||||||
| FLOPs | |||||||||
| ( PPL ) | Wikitext | 13.08 | 13.98 | 13.96 | 13.90 | 11.06 | 11.76 | 11.87 | 11.74 |
| Lambada | 6.56 | 7.71 | 7.68 | 7.21 | 4.82 | 5.20 | 5.32 | 5.14 | |
| PPL | LL Acc | EM Acc | |||||||||||
| Model | Params. | FLOPs | Wiki. | Lamb. | Com. Avg. | GSM8K | GSM8K ∗ | H.Eval | H.Eval + | MMLU | BBH ∗ | EM Avg. | |
| Baseline (5B, 18L) | 13.08 | 6.56 | 62.19 | 15.77 | 17.44 | 21.95 | 18.90 | 37.52 | 31.75 | 23.89 | - | ||
| HyperLoop (Loop 3) | 13.96 | 7.68 | 58.93 | 12.89 | 14.03 | 18.90 | 16.46 | 42.71 | 31.05 | 22.67 | -1.22 | ||
| OperLoop (Loop 3) | 13.90 | 7.21 | 59.77 | 15.85 | 17.13 | 23.78 | 20.12 | 44.41 | 32.18 | 25.58 | +1.69 | ||
| HyperLoop (Loop 6) | 13.35 | 6.51 | 61.39 | 22.44 | 27.14 | 24.39 | 20.73 | 48.25 | 35.54 | 29.75 | +5.86 | ||
| OperLoop (Loop 6) | 13.16 | 6.39 | 61.72 | 24.87 | 31.08 | 27.44 | 21.95 | 50.15 | 35.89 | 31.90 | +8.01 | ||
| Variant | Delta Obj. | Step Size Schedule | Wiki. PPL | Lamb. PPL | LL Avg. | EM Avg. |
| OperLoop (Ours) | Causal | 13.90 | 7.21 | 59.77 | 25.58 | |
| w/o Delta Obj. | Causal | 13.92 | 7.25 | 59.36 | 24.84 |
| Variant | Delta Obj. | Step Size Schedule | Wiki. PPL | Lamb. PPL | LL Avg. | EM Avg. |
| OperLoop (Ours) | Causal | 13.90 | 7.21 | 59.77 | 25.58 | |
| LR w Non-causal | Non-Causal | 13.93 | 7.15 | 59.80 | 24.02 | |
| w/o LR | 13.95 | 7.48 | 59.38 | 24.40 |
| Original Transition | ||||||
| Vanilla | ||||||
| Huginn ( Geiping et al., 2025 ) | ||||||
| Parcae ( Prairie et al., 2026 ) | {\color[rgb]{0.7266,0.1484,0.1328}\bar{\mathbf{A}}}\bm{y}_{l}+\bar{\mathbf{B}}\mathbf{e} | {\color[rgb]{0.7266,0.1484,0.1328}\mathbf{I}} | ||||
| Full-Bandwidth ∗ ( Wang et al., 2026 ) | {\color[rgb]{0.7266,0.1484,0.1328}\sigma(\mathbf{W}^{\rm g}\bm{e}_{l})\odot\mathbf{W}^{\rm u}}\bm{y}_{l} | {\color[rgb]{0.7266,0.1484,0.1328}\mathbf{I}} | ||||
| RecurrentGPT ( Hegazy et al., 2026 ) | {\color[rgb]{0.7266,0.1484,0.1328}\mathbf{W}}\ [\bm{y}_{l}+\bm{\epsilon},\bm{e}] | {\color[rgb]{0.7266,0.1484,0.1328}\mathbf{I}} | ||||
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Setting | Value |
| Model family | Architecture | Decoder-only Transformer |
| Numerics | Parameter / router / LM-head precision | BF16 / FP32 / FP32 |
| Representation | Hidden size / vocabulary size | / |
| Attention | Heads / head dimension / GQA groups | / / |
| Context | Maximum sequence length | |
| Attention pattern | Repeated every four layers | Sliding–Sliding–Sliding–Full |
| Setting | Prelude | Shared | Loops | Coda | Effective Depth | Distinct Blocks |
| 18-layer comparison (Loop3) | 4 | 4 | 3 | 2 | 18 | 10 |
| 32-layer comparison (Loop3) | 4 | 8 | 3 | 4 | 32 | 16 |
| Compute scaling (Loop6) | 4 | 4 | 6 | 2 | 30 | 10 |
| Category | Setting | Value |
| Objective | Training objective / loss | Causal LM / vocabulary-parallel cross-entropy |
| Batching | Global batch / micro batch | / sequences |
| Batching | Nominal tokens per update | |
| Precision | Training parameter precision | BF16 |
| Optimizer | Muon momentum / Nesterov | / enabled |
| Optimizer | Newton–Schulz variant / iterations | Polar Express / |