Paper commentary
How to Loop Your Transformer: Loop Scaling, Specialization, and Parallel Inference
Middle-block looping gives better returns on tight compute
- Problem Reusing the same weights for every loop may limit how much deeper looping helps. Later loops act on representations that earlier loops already changed, so gains shrink as loops are added.
- Method Loop LoRA adds a small low-rank adapter to each loop on top of shared weights. The adapters let loops differ slightly while most weights stay common.
- Results Adapters improve quality over unadapted looping, with larger gains as more loops are added.

Figure 6 PL T shifts the connection between loops across tokens.Loop ℓ at token n receives the current-token embedding and the state from loopℓ−1at tokenn−1. KV sharing and G-SWA are omitted for clarity.
Original paper · CC BY 4.0 · Chanakya Ekbote, Artidoro Pagnoni, Devendra Singh Sachan, Shruti Bhosale, Mike Lewis, Maryam Fazel-Zarandi, Shashank Rajput, Sujan Kumar Gonugondla · How to Loop Your Transformer: Loop Scaling, Specialization, and Parallel Inference · Original paper figure · Extracted the figure area from page 8 of the original PDF.Where looping runs out of steam
Looping reuses one set of transformer weights several times, so the model behaves like a deeper network without new stored parameters. Each extra loop still has to be executed, so training FLOPs rise even though the parameter count and token budget stay the same. Exact sharing becomes harder to justify with more loops, because later loops act on representations that earlier loops already transformed.
The marginal gains shrink as loops are added, and at very large loop counts performance can eventually degrade.
Looping also costs time at inference, since each loop for a token needs the output of the previous loop for that same token. The model therefore has to run the loops one after another, which adds sequential computation to every generated token. That change lets multiple loop stages be evaluated in parallel during decoding.
The authors treat these effects as coupled trade-offs rather than separate choices. Changing the dependency between loops parallelizes decoding, but it also changes what each loop sees. They don't test every combination of loop count and dependency in this section, so the interaction stays an open question.
Which parts of the model get looped
The paper varies three things: the looped component, the scope of the loop, and the order in which blocks are visited. Full-Stack Looping feeds the output of the final transformer block back into the first block, so the whole stack runs again at every loop. Per-Layer Looping works differently, because each block is fed back to itself for all loops before the next block starts.
Both schedules apply the same weights across loops, so the choice only changes the order of the repeated computation.

Figure 2 Looping designs: what is repeated, where, and in what order.Top: the looped component can be the complete transformer block, attention alone, the MLP alone, or attention and the MLP separately. Bottom: full-stack looping traverses the complete transformer forL loops, whereas per-layer looping completesL loops of each block before advancing to the next. Middle-stack and middle-layer looping restrict the corresponding schedule to the central blocks. For a model containingBblocks, the first and last⌊B/3⌋blocks are run once.
Original paper · CC BY 4.0The middle-region variants loop only a contiguous group of central blocks instead of the full stack. Middle-Stack Looping feeds the output of the last block in that region back to the first, so the middle blocks loop as a group. Middle-Layer Looping loops each middle block before moving to the next one, and the outer blocks are applied once.
The looped component can also be the full block, attention alone, the MLP alone, or attention and the MLP independently. Figure 2 shows these designs, and the authors compare seven designs across five dense model scales. The authors found that the attention and MLP loop, which loops the two parts independently, degrades sharply as L increases.
Full-Stack Looping and Middle-Stack Looping avoid regression over a wider range of L.
Per-Layer Looping and Middle-Stack Looping can be competitive with Full-Stack Looping at 100M and 200M when L is 2 or less. At 300M and 500M, Full-Stack Looping and Middle-Stack Looping perform well across TPP settings and loop factors. At lower training FLOP budgets, Middle-Stack Looping gives the best return on additional compute. When compute isn't a constraint, Full-Stack Looping reaches lower absolute BPB, so the choice depends on the budget.
Giving each loop a small adapter
Full sharing keeps parameter storage low, but it also stops each loop from learning its own correction. The authors keep the main transformer weights shared and add a small loop-specific low-rank adapter to each loop. For a weight matrix W, loop ℓ uses W plus α/r times B^(ℓ) A^(ℓ), where A^(ℓ) has shape r by d_in and B^(ℓ) has shape d_out by r.
The adapters are learned specifically for each loop, so the loops differ slightly while the bulk of the weights stays common. The authors use Low-Rank Adaptation (LoRA) to build these adapters, which keeps the added parameter count small.
Loop LoRA gives each loop its own adapter, so ΔW^(ℓ) equals B_ℓ A_ℓ with no sharing of the correction. Loop Matrix instead learns an unconstrained L by L mixing matrix M, so each loop mixes a set of shared low-rank components. In Loop Matrix, the coefficient M_ℓj sets how much component j contributes to loop ℓ. Loop Softmax keeps the same mixing idea but computes the coefficients as a softmax over a learned score matrix S.
The softmax keeps each row of mixing weights normalized, which constrains the mixture compared with Loop Matrix.
The authors apply these adapters to Full-Stack Looping in their main experiments. They chose Full-Stack Looping because it generally gives the strongest absolute improvements among the designs they tested. The same adapter idea is also evaluated with other looping designs in Appendix F. Figure 5 reports DCLM BPB for 300M models with Full-Stack Looping at TPP 100.
That figure compares Vanilla, True Depth at L equal to 2, No LoRA, LoRA Matrix, LoRA Per Loop, and LoRA Softmax across loop counts of 1, 2, 4, and 8.
The adapters add only a few parameters, so the cost of specialization stays small relative to the shared model. The loop-specific adapters are a shared-weight alternative to giving each depth a separate set of weights.
Passing states across token positions
Cross-Loop Parallelism changes the dependency so that a later loop reads the previous loop's state from the preceding token, not from the same token. Loop ℓ receives the current-token embedding plus the state from loop ℓ minus 1 at position n minus 1, written as b(ℓ)n = en + h(ℓ−1)n−1. The first loop receives only the current-token embedding, so the boundary condition is set by b(1)n = en.
Instead of waiting for the same token to finish loop ℓ minus 1, the model can start loop ℓ once the previous token has produced its state. The paper states that this shift changes the dependency structure, because conventional looping cannot start the next loop until the preceding loop for that token completes.
During training, the authors use a causal shift over the whole sequence, so the model runs one loop at a time while keeping parallelism over token positions. The training objective uses the shifted state H(ℓ−1) to build B(ℓ) = E + Shift(H(ℓ−1)) for every loop from 2 to L. The training cost is not reduced, because the L loops still run one after another across the sequence.
At decoding, the states cached for token n minus 1 are already available before token n is processed. The L inputs for token n can be stacked along a batch dimension and passed through the shared Transformer in one call. Batching the loops lets parallel hardware run the L loop computations together rather than one after another. At the start of a sequence, missing predecessor states are replaced by the zero boundary state until the cache fills.
Batching does not reduce the memory needed for attention, so PLT adds a separate cache design. PLT stores one global KV cache from the first loop and shares it with all later loops. Each later loop also keeps a private cache of only its most recent w positions. Gated sliding-window attention combines the shared global output and the local output with a learned head-wise gate.
The memory cost is O(ND + (L−1)wD), instead of O(LND) when each loop stores its own full cache.
Normalizing and gating the re-injected inputs
The original shifted transition struggles because the current-token embedding and the previous-token state have very different RMS magnitudes. The authors' reading is that this mismatch changes with TPP settings and loop depth, so a fixed sum can't handle it everywhere. Raw shifted CLP can even get worse as the number of loops grows, while the shifted variants sit near the Vanilla baseline when L is 2 or fewer.
To fix this, the authors apply RMSNorm to both the current-token embedding and the previous-token state before combining them. They then mix the two normalized inputs with a gate g in the range 0 to 1 per dimension, so the weighting is learned rather than fixed. The combined input is b equal to g times the normalized embedding plus one minus g times the normalized previous-token state.
The Figure 7 runs use a fixed equal mixture, with the gate set to one half in every dimension, instead of a learned gate.
Across the evaluated TPP settings, loop counts, and PLT component configurations, the shifted variants approach the quality of Full-Stack Looping. The normalized and gated unshifted control also beats the unnormalized unshifted control and outperforms Full-Stack Looping. Keeping a separate KV cache for each loop gives the best quality among the variants, as Figure 6 illustrates the parallel loop schedule.
How the loop designs compare
The authors compared seven looping designs across five dense model scales, from 70M to 500M parameters, with TPP up to 160. They varied the loop factor L over 2, 4, 8, 16 and 32, where the design was available. Each size was tested under either a fixed TPP, which constrains the training data, or a fixed FLOP budget, which constrains training compute.
The primary metric was DCLM validation bits per byte, where lower is better. With a moderate loop factor of at most 16, looping lowered DCLM BPB relative to the no-looping model. Beyond that, the marginal gains shrink, and performance eventually degrades at very large L. So more loops don't always help, and the point where gains stop depends on both the design and TPP.
At higher TPP, increasing L gives more consistent gains, while lower-TPP runs saturate or regress sooner. Full-Stack Looping and Middle-Stack Looping avoid regression over a wider range of L. At 100M and 200M, Per-Layer Looping and Middle-Stack Looping can compete with Full-Stack Looping when L is 2 or less, depending on TPP. At 300M and especially 500M, Full-Stack Looping and Middle-Stack Looping perform well across TPP settings and loop factors.
At 300M, Full-Stack Looping achieves the lowest BPB as TPP increases.
The 200M to 500M sweeps extend only to L = 8, and the 1B sweeps reach L = 4, because looping cost grows linearly with L. Under a fixed FLOP budget the ranking changes, since some designs use compute more effectively than others. At lower training FLOP budgets, Middle-Stack Looping gives the best return on additional compute. When compute isn't limiting, Full-Stack Looping reaches lower absolute BPB.
The WikiText-103 results show the same broad pattern, with Middle-Stack Looping still attractive for small FLOP increases.
These diminishing returns raise the question of whether exact weight sharing across loops limits further gains. The authors take up that question next, using Full-Stack Looping as the base because it generally gives the strongest absolute improvements.
Do loop-specific adapters help as loops grow?
Exact weight sharing can limit deeper looping, because every loop must reuse the same transformer weights on representations that earlier loops already changed. Loop-specific specialization keeps the main weights shared and gives each loop a small low-rank adapter, so the parameter cost stays low. The authors test this with 300M Full-Stack Looping models at TPP 100, comparing exact sharing with Loop LoRA, Loop Matrix and Loop Softmax.
Loop LoRA gives each loop its own adapter, while Loop Matrix learns an unconstrained mixing matrix over the low-rank components. Loop Softmax builds the same mixing coefficients from a learned score matrix passed through a softmax.
The corrections add few parameters, so the extra stored cost stays small in these runs. The figure plots BPB against loop count, non-embedding parameter count and total training FLOPs, and the FLOPs include the corrections. Figure 5 reports that the adapters become more useful as the loop count rises. Only the 300M model at TPP 100 is shown in this figure, so the adapter effect at other scales isn't established here.
The paper's other sweeps for loop-specific specialization appear in Appendix F, where they test the approach with other looping designs.
The adapter study also feeds into the parallel analysis that follows. Shifted PLT variants sit near the Vanilla baseline at L ≤ 2 at 200M, TPP 40 and 80.
Why naive PLT loses the looping gains
PLT changes the dependency between loops, so each loop receives the current-token embedding plus the previous loop's state for the preceding token. At 200M with TPP 40 and 80, Original PLT and its intermediate variants don't recover the performance of Full-Stack Looping. Shifted variants stay near the Vanilla (No Looping) baseline when L is at most 2, while raw shifted CLP gets worse as the number of loops grows.
An unshifted control, by contrast, outperforms Full-Stack Looping in the same setting.
That mismatch varies across TPP settings and loop depths, so the higher-magnitude input can overwhelm the other when the two are added directly. To reduce this mismatch, the authors apply RMSNorm to the embedding and to the previous-token state before combining them. They combine the two normalized inputs with a gate g in [0, 1] per dimension, so the mixture is learned rather than fixed.
For Figure 7, the authors use a fixed equal mixture, with the gate set to one half.
With normalization and the gate, the shifted variants approach Full-Stack Looping quality across the TPP settings, loop counts and component configurations tested. Keeping a separate KV cache for each loop gives the best quality among the PLT variants. Figure 6 shows that PLT shifts the connection between loops across tokens, so loop ℓ at token n reads the state from loop ℓ-1 at token n-1.
Headline results at 1B
The headline comparison trains 1B models across TPP 10–160 and tracks DCLM bits per byte against training tokens. Every looping method reaches a given DCLM BPB with fewer training tokens than the fitted Vanilla baseline. The modified PLT variants show the largest relative data-efficiency gains in this comparison. A second panel compares 100M to 1B models, with Vanilla trained at TPP 160 and two-loop models trained at TPP 80.
The modified PLT and Looped variants beat Standard Looping on this compute-efficiency measure.
The right panel measures downstream quality with mean NLL-ranked accuracy on eight reasoning and question-answering tasks. Looping retains or improves this accuracy across TPP 10–160, so the extra loops don't cost downstream quality. The modified PLT variants match or exceed Standard Looping on the same accuracy metric. Task-level numbers and the efficiency calculation sit in Appendix D, which the paper points readers to.
This lets loop stages run in parallel during decoding, which removes the strict loop-by-loop order. The modifications keep the current-token embedding and normalize it separately from the previous-token state. With these changes, the authors report that parallel looping can outperform full-transformer looping. The parallel version keeps a parallelizable decoding dependency, so inference doesn't need to run loops one after another.
Applying the same normalization and gating to standard looping improves full-transformer looping further.
Where the sweeps and results stop
The 200M to 500M sweeps stop at L of 8, and the 1B sweeps stop at L of 4, because looping cost grows linearly with L. The authors note that the computational cost of looping grows linearly with L, which sets the upper range of each sweep. Within these ranges, diminishing relative improvements with L still appear, and the 1B ablations are shown in Figure 45 and Figure 46.
The FLOPs comparison also shows that Middle-Stack Looping gives the best return at lower training FLOP budgets. Full-Stack Looping reaches lower absolute BPB when compute is not a constraint, as shown in Figure 3 and Figure 46.
The adapter comparison covers only the 300M Full-Stack setting at TPP 100. Figure 5 plots DCLM BPB for that setting against loop count, non-embedding parameter count, and total training FLOPs. The authors didn't run this adapter comparison at other TPP values in this section. The other looping designs are tested with the adapters only in Appendix F.
For the 200M model at both TPP 40 and 80, Original PLT doesn't recover the performance of Full-Stack Looping. Shifted variants stay near the Vanilla baseline when L is 2 or less, so the gap is largest at few loops.
Paper info
- Authors
- Chanakya Ekbote, Artidoro Pagnoni, Devendra Singh Sachan, Shruti Bhosale, Mike Lewis, Maryam Fazel-Zarandi, Shashank Rajput, Sujan Kumar Gonugondla
- Venue
- arXiv · Preprint
- First published
- 2026-10-29
- Added
- 2026-11-1
- Updated
- 2026-10-29
- Version
- v1
- arXiv
- 2610.40325
- Category
- cs.LG · cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
Looping in transformer models reuses weights by repeatedly applying the same transformer, or parts of it, 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 with up to $1.07\times10^{21}$ FLOPs and 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. Adding loops is not uniformly beneficial: gains eventually saturate, reverse, or become unstable. This motivates asking whether forcing every loop to use 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. Looped transformers also suffer a decoding slowdown proportional to the number of loops. Parallel Loop Transformers address this by passing hidden states between loops across adjacent token positions, allowing loop stages to run concurrently. 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.
Quote from the paper
Chanakya Ekbote, Artidoro Pagnoni, Devendra Singh Sachan, Shruti Bhosale, Mike Lewis, Maryam Fazel-Zarandi, Shashank Rajput, Sujan Kumar Gonugondla (2026). How to Loop Your Transformer: Loop Scaling, Specialization, and Parallel Inference. arXiv:2610.40325v1. https://arxiv.org/abs/2610.40325v1
BibTeX
@misc{ekbote2026loop,
title = {{How to Loop Your Transformer: Loop Scaling, Specialization, and Parallel Inference}},
author = {Chanakya Ekbote and Artidoro Pagnoni and Devendra Singh Sachan and Shruti Bhosale and Mike Lewis and Maryam Fazel-Zarandi and Shashank Rajput and Sujan Kumar Gonugondla},
year = {2026},
eprint = {2610.40325},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2610.40325v1}
}