Rectified Looped Transformer (RLT)
Summary (Overview)
- Novel feedback mechanism: The paper introduces Rectified Looped Transformer (RLT), which replaces direct feedback in looped Transformers with a flow-inspired linear interpolation schedule between the current state and the network's endpoint prediction.
- Theoretical guarantees: RLT provides depth-uniform bounds on state magnitudes (constant in loop depth ) and reduces worst-case perturbation amplification from exponential () to polynomial () under a uniform Lipschitz condition.
- Empirical improvements: RLT consistently achieves lower perplexity than Standard Looped Transformer (SLT) across multiple depths (K=2, 4, 8) and evaluation corpora (The Pile, FineWeb-Edu, OpenWebText), with gains of up to 5.5% in perplexity reduction.
- Enhanced robustness: RLT demonstrates greater tolerance to input perturbations, inference-depth mismatches (both fewer and more loops), and quantization, while maintaining more stable hidden-state norms across loops.
- Zero additional cost: These gains require no extra trainable parameters or recurrent block evaluations—only elementwise interpolation between states.
Introduction and Theoretical Foundation
Background and Motivation
Looped Transformers repeatedly apply a shared stack of layers to increase effective computational depth without increasing physical parameters. This makes recurrence depth an additional axis for scaling language models. However, the standard direct-feedback formulation (SLT) applies the entire change from current state to network prediction at every loop, which can lead to:
- Hidden-state scale growth as recurrence deepens
- Perturbation amplification
- Performance degradation at larger recurrent depths (as shown by STARS)
Key Insight
The paper draws inspiration from rectified flow (Liu et al., 2023), which uses linear interpolation between source and target samples as training paths. RLT treats each loop's network output as an endpoint prediction and combines it with the current input state through a remaining-time interpolation schedule.
Core Formulation
The looped computation is associated with a uniform time grid on :
The shared Transformer stack performs one loop of computation:
where is the input state, is the hidden output, and is the feedback coefficient.
SLT uses direct feedback (), while RLT uses the remaining-time schedule:
The weight increases from to , forming a smoothly interpolated trajectory from to the final prediction .
Methodology
Architecture
- Base model: GPT-2-style looped Transformer with time and step-size conditioning via AdaLN-style modulation
- Default configuration: 3 shared layers × 8 loops (3 ⊗ 8), 278M physical parameters
- Supervision: Uniform all-step next-token prediction with loss
- Readout: with cross-entropy loss
Training Setup
- Dataset: Deduplicated The Pile (6.88B tokens)
- Optimization: 14,000 steps, peak learning rate , global batch size 480 sequences of 1,024 tokens
- Evaluation: Perplexity on The Pile, FineWeb-Edu, OpenWebText; zero-shot accuracy on 10 benchmarks (COPA, HellaSwag, LAMBADA, OpenBookQA, PIQA, RACE, SciQ, ARC, Social IQA, WinoGrande)
Theoretical Analysis Framework
The analysis establishes:
- State norm bounds under time-dependent residual control
- Perturbation amplification bounds under Lipschitz conditions
- Fixed-point residual decay for nonexpansive networks
Empirical Validation / Results
Language Modeling Performance
At matched training and inference depths ():
| Variants | Structure | Pile PPL | FWE PPL | OWT PPL | Avg Acc (%) |
|---|---|---|---|---|---|
| K = 8 | |||||
| SLT | 3 ⊗ 8 | 11.08 | 27.58 | 25.39 | 44.36 |
| RLT | 3 ⊗ 8 | 10.82 | 26.74 | 24.61 | 43.53 |
| K = 4 | |||||
| SLT | 3 ⊗ 4 | 11.76 | 29.76 | 27.30 | 42.38 |
| RLT | 3 ⊗ 4 | 11.27 | 28.14 | 25.88 | 43.30 |
| K = 2 | |||||
| SLT | 3 ⊗ 2 | 12.49 | 32.24 | 29.52 | 41.56 |
| RLT | 3 ⊗ 2 | 12.44 | 32.04 | 29.33 | 41.31 |
RLT reduces perplexity by 4.2–5.5% at K=4 across corpora. LAMBADA accuracy improves by 5 percentage points at both K=2 and K=4.
Recurrent Stability Results
Hidden-state scale: SLT exhibits pronounced scale accumulation (mean ratio relative to reaches 5.08 by loop 8), while RLT maintains 0.65—consistent with the theoretical bound in Corollary 1.2.
Perturbation robustness: RLT shows smaller output displacements under input noise and better preserves predictive performance under per-loop perturbations. At , output perturbations increase Pile cross-entropy by 0.61 nats/token for RLT vs. 2.86 for SLT.
Quantization robustness: RLT retains its perplexity advantage across W8A16, W4A16, and W8A8 quantization settings at all inference depths.
Inference-Depth Adaptation
For models trained with :
| Model | Pile PPL | FWE PPL | OWT PPL | Avg Acc (%) |
|---|---|---|---|---|
| K_test = 4 | ||||
| SLT | 13.01 | 33.62 | 30.87 | 42.95 |
| RLT | 11.76 | 29.56 | 27.06 | 41.96 |
| K_test = 2 | ||||
| SLT | 21.60 | 69.18 | 62.04 | 39.24 |
| RLT | 13.85 | 35.82 | 32.81 | 40.76 |
At , RLT achieves PPL 17.72 vs. 57.72 for SLT, and average accuracy 42.88% vs. 38.05%.
Theoretical and Practical Implications
Theoretical Results
Theorem 1 (State norm bounds): Under the residual control condition :
- SLT bound: — unbounded growth
- RLT bound: — uniformly bounded
Theorem 2 (Perturbation amplification): Under uniform Lipschitz bound :
- SLT: — exponential
- RLT: — polynomial
Proposition 3 (Fixed-point convergence): For nonexpansive networks, RLT achieves:
Practical Implications
-
Stable scale enables decoding techniques: RLT's stable representation scales support effective contrastive decoding (accuracy gains up to 44.45% from 42.73% baseline) and guidance during recurrence (0.76 percentage point gain at ).
-
Flexible inference budgets: RLT supports a broader range of inference depths, making it practical for adaptive computation scenarios where the loop count may vary.
-
Quantization-friendly: The controlled state norms make RLT more amenable to low-precision inference.
Conclusion
RLT introduces a simple yet effective feedback mechanism for looped Transformers: interpolate between the current state and each loop's endpoint prediction according to remaining time. This design:
- Separates prediction from state advancement, preventing uncontrolled accumulation of changes
- Provides theoretical guarantees of bounded state norms and polynomial (rather than exponential) perturbation amplification
- Achieves consistent empirical gains in perplexity, robustness, and latent stability without additional parameters or compute
The work highlights state feedback as a crucial design choice for jointly improving language modeling quality and the stability of latent recurrent computation. Future directions may include exploring adaptive interpolation schedules, extending to other recurrent architectures, and scaling to larger models and datasets.
Related papers
- Library of Layers (LoL): Adaptively Ordering Transformer Layers at Runtime
Library of Layers lets a router dynamically reorder transformer layers per input, matching dense, looped, and sparse MoE baselines while enabling interpretable, controllable routing paths.
- Rethinking "RL Generalizes, SFT Memorizes": The Role of SFT Data
SFT matches or beats RL on out-of-distribution reasoning when trained on data from a model close to the base and scaled to RL's total rollout budget.
- SkillDuet: Co-Evolving Models and Skills through Response Feedback
SkillDuet co-evolves model parameters and reusable textual skills via response-based Strength scoring, achieving state-of-the-art 98.57% on ALFWorld and 92.97% on WebShop.