Manuscript Offprint

arXiv:2610.40325

How to Loop Your Transformer: Loop Scaling, Specialization, and Parallel Inference

Chanakya Ekbote, Artidoro Pagnoni, Devendra Singh Sachan, Shruti Bhosale, Mike Lewis, Maryam Fazel-Zarandi, Shashank Rajput, Sujan Kumar Gonugondla

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Chanakya Ekbote1,2,†^{1,2,\dagger}, Artidoro Pagnoni1,∗^{1,*}, Devendra Singh Sachan1^{1}, Shruti Bhosale1^{1}, Mike Lewis1^{1}, Maryam Fazel-Zarandi1^{1}, Shashank Rajput1,∗^{1,*}, Sujan Kumar Gonugondla1,∗^{1,*}

1^{1}FAIR at Meta, 2^{2}MIT

†^{\dagger}Work done at FAIR/Meta, ∗^{*}Equal contribution

Looping in transformer models reuses weights by repeatedly applying the same transformer, or parts of it, to token representations, effectively making the model deeper without increasing its parameter count. Whether looping is useful depends on which constraint dominates: model size, training compute, or autoregressive inference efficiency. We study these trade-offs jointly in dense decoder-only transformers trained from scratch, varying which parts of the model are looped, how many loops are applied, and how information is passed between loops. Our experiments span models with up to 1B parameters, trained on up to 155B tokens using up to 1.07×10211.07 \times 10^{21} training FLOPs, with up to 32 loops. We find that looping the full transformer generally gives the strongest quality at a fixed parameter budget, whereas looping a middle block of layers gives a better return when training FLOPs are constrained. These trade-offs also depend on the number of loops: adding loops is not uniformly beneficial, and gains eventually saturate, reverse, or become unstable. This saturation motivates asking whether forcing every loop to use exactly the same weights limits the benefit of deeper looping. We address this by adding small loop-specific low-rank adapters that improve quality, with larger gains as more loops are added. A separate practical concern for looped transformers is the sequential dependency during autoregressive generation, which causes a slowdown proportional to the number of loops. Parallel Loop Transformers address this limitation by passing information between loops across adjacent token positions via hidden states, allowing loop stages to run concurrently during decoding. However, in our experiments the original formulation does not consistently retain the quality gains of ordinary looping. We find that preserving the current-token embedding and separately normalizing it and the previous-token hidden state before combining them recovers strong performance across model scales and training budgets. Together, these results show that effective looping requires matching the design to the resource constraint and inference setting.

Date: October 2026

Correspondence: Sujan Kumar Gonugondla at sujan@meta.com

Meta

1 Introduction

Looping in transformer models reuses weights by repeatedly applying the same transformer, or selected parts of it, to token representations, allowing the model to behave like a deeper network without storing a new set of parameters at every ‘depth’ (Dehghani et al., 2018; Saunshi et al., 2025; Geiping et al., 2025). This makes looping attractive when model size is constrained, but the additional depth is not free: every extra loop must still be executed. As a result, a design that uses parameters efficiently may not use training compute efficiently. Prior work reflects this trade-off, showing that repeated shared computation can recover some of the benefits of additional depth, while adding independently parameterized layers can be preferable when training compute is constrained (Schwethelm et al., 2026; Prairie et al., 2026). The same weight reuse, however, raises another question as more loops are added. In ordinary looping, every loop applies the same weights, even though later loops operate on representations that have already been transformed several times. This suggests that exact weight sharing may give diminishing returns with deeper looping. Prior work has relaxed this constraint by giving each loop iteration a different low-rank adapter while keeping the main transformer weights shared (Bae et al., 2025).

Figure

Figure

Figure

Method

Method

Method

Method

Figure 1 Looping can improve data and compute efficiency (in over-trained regimes) while retaining downstream quality. We compare Vanilla (no looping), Standard Looping (repeatedly applying the same Transformer sequentially), and our modified versions Parallel Loop Transformer (PLT) (Wu et al., 2025) and Looped Transformers. Left: for 1B models trained across TPP 10–160, all looping methods achieve a given DCLM (Li et al., 2024) bits-per-byte (BPB) value with fewer training tokens than the fitted Vanilla baseline, with the modified PLT variants providing the largest relative data-efficiency gains. Center: across model sizes from 100M to 1B, we compare Vanilla models trained at TPP = 160 with two-loop models trained at TPP = 80. All looping methods achieve a given DCLM BPB with fewer training FLOPs than the fitted Vanilla baseline, and the modified PLT and Looped variants are more efficient than Standard Looping. Right: for 1B models across TPP 10–160, looping retains or improves mean NLL-ranked accuracy across eight reasoning and question-answering tasks; the modified PLT variants match or exceed Standard Looping. See Appendix D for the efficiency calculation and task-level results.

Looped transformers also suffer from a separate issue during autoregressive generation: each loop for a token still depends on the output of the previous loop, so the model must execute them one after another, increasing the sequential computation required to generate each token. Parallel Loop Transformers (PLTs) reorganize this dependency by passing hidden states from one loop to the next across adjacent token positions, allowing multiple loop stages to be evaluated in parallel during decoding (Wu et al., 2025). This change alters the information available to each loop, and recent work reports that gains can decrease as more parallel loops are added (Yang et al., 2026). This leaves open what information the shifted transition must preserve for parallel looping to remain effective at greater loop depth. Together, these studies show that looping is not a single design choice but a set of coupled trade-offs. Repeating more of the model can make better use of a fixed parameter budget but requires more training compute; reusing the same weights across more loops can make exact sharing increasingly restrictive; and changing the dependency between loops can parallelize sequential looping while also changing the information available to each loop. These trade-offs may also change with model scale and training budget. Despite prior work studying these choices in different settings, it remains unclear which conclusions generalize and how the choices interact. We therefore study them within a common training from-scratch setting across model scales and training budgets, and ask:

References (35)