Looped Transformers Explained: Recurrent Depth, Weight Sharing and Adaptive Computation in LLMs
On 20 November 2026, Thinking Machines Lab shipped an open-weight coding model whose most interesting number is not its benchmark score. Inkling 2 Mini stores 24 transformer layers but executes 48 of them for every token, because its middle 12 layers run three times with the same weights. That design has a name: looped transformers. It matters now because the industry has spent three years scaling parameters and tokens, and looping offers a third axis — depth you pay for in compute, not in memory or download size. It also changes things that serving teams care about: FLOPs per token, KV cache size, latency, and how you train without the gradient blowing up. This post explains where the idea came from, how the mechanism works, what it costs in hard arithmetic, and where it breaks.
What this covers: the lineage from Adaptive Computation Time and the Universal Transformer to recurrent-depth LLMs; parameters versus FLOPs versus depth; input injection and truncated backpropagation; halting; KV cache strategies; combining loops with Mixture-of-Experts; and a runnable PyTorch looped block.
Context and Background
A standard decoder-only LLM is a stack of distinct layers. Layer 17 has its own attention and feed-forward weights, used exactly once per token. Depth, parameter count and compute are welded together: add a layer and you add all three. Looped transformers break that weld by applying one block — or a contiguous group of layers — repeatedly, so effective depth grows while stored parameters stay fixed.
The idea is older than most current LLM tooling. Alex Graves introduced Adaptive Computation Time (ACT) for recurrent networks in March 2016, letting a model learn how many internal steps to take per input. In July 2018, Dehghani, Gouws, Vinyals, Uszkoreit and Kaiser published the Universal Transformer, which recurs a single transformer block over depth, adds a per-position halting mechanism, and reported a 0.9 BLEU gain over the Transformer on WMT14 English-German plus a state-of-the-art result on LAMBADA. The authors also showed that, under certain assumptions, the model is Turing-complete, which a fixed-depth Transformer is not.
The encoder world tried weight sharing purely for compression. ALBERT (Lan et al., 2019) shared all layers and shrank a BERT-base-shaped model from 108M to 12M parameters. The cost was accuracy: on the paper’s ablation, all-shared ALBERT-base averaged 80.1 versus 81.6 not-shared with 128-dimensional embeddings, and most of the drop came from sharing the feed-forward weights rather than attention. ALBERT is a useful warning. Sharing weights saves memory, but it does not save compute; ALBERT-xxlarge had fewer parameters than BERT-large yet trained at roughly 0.3x its throughput.
The modern revival has a different motivation: reasoning. Giannou et al. (2023) showed that a 13-layer transformer, placed in a loop with hand-set weights, can emulate a small instruction-set computer, a calculator and a linear-algebra library. Saunshi et al. (ICLR 2025) argued that reasoning depends mostly on depth rather than parameters, and that a k-layer model looped L times nearly matches a kL-layer model on synthetic reasoning tasks. Geiping et al. (2025) then trained a 3.5B recurrent-depth language model on 800B tokens. Later in 2025 came the Ouro looped language models (1.4B and 2.6B parameters, trained on 7.7T tokens) and Mixture-of-Recursions from KAIST and Mila researchers with Google co-authors.
If you already know how Mixture-of-Experts decouples parameters from per-token compute, looping is the mirror image. MoE stores many parameters and activates few. Looping stores few parameters and activates them many times.
How Looped Transformers Work: The Reference Architecture
Looped transformers reuse a shared block of layers several times per token, feeding each pass’s output back as the next pass’s input. This gives a model more effective depth — and more compute per token — without adding stored parameters. Most modern designs wrap the loop between unique “prelude” and “coda” layers and re-inject the original input on every pass.

Figure 1: The prelude–core–coda pattern used by recurrent-depth and looped transformer LLMs. Only the core block is reused; the halting check decides how many passes to run.
The diagram shows the data path for one token position. Tokens are embedded and processed by a few prelude layers with their own weights, which map raw embeddings into a working representation. That representation, called the injected input e, is fed into the shared core block on every pass together with the current latent state. After each pass a controller either stops — because a fixed loop budget is spent or a halting signal fires — or sends the state back through the same core. Finally, coda layers with unique weights turn the latent state into something the LM head can decode into logits.
Why the loop sits in the middle
Early weight-sharing work looped the whole stack. Recent designs leave the first and last layers unshared, and the evidence favours that. The Mixture-of-Recursions paper (Bae et al., 2025) compared four sharing schemes — Cycle, Sequence, Middle-Cycle and Middle-Sequence — and reported that “Middle-Cycle consistently achieves the lowest validation loss.” Geiping et al. used a (2, 4, 2) shape: two prelude layers, a four-layer recurrent core and two coda layers. Inkling 2 Mini’s public config loops layers 6 through 17 out of 24.
The intuition is a division of labour. Bottom layers do tokenisation-adjacent work: resolving subwords, local syntax and positional features. Top layers specialise in producing a distribution over a 200,000-token vocabulary. Neither job benefits from repetition. The middle of the network is where representations are refined, and refinement is naturally iterative. Saunshi et al. make the same point from theory: many reasoning problems have iterative algorithms, and a loop is a cheap way to express them.
Input injection keeps the loop anchored
A naive loop computes s_{i+1} = core(s_i). After enough passes, the state can drift away from what the prompt actually said, because each pass only sees its predecessor’s output. Input injection fixes this by giving the core the original signal every time: s_{i+1} = core(s_i, e). The Universal Transformer did something similar by re-adding position and timestep embeddings on every recurrence.
How you combine s_i and e matters. Geiping et al. concatenate the state and the injected embedding, then map the result back to the hidden size with a learned adapter matrix; they report that concatenation worked better than simple addition at scale. They also start from a random latent state rather than from e, which forces the model to treat the state as a scratchpad that converges from noise rather than a copy of the input. Inkling 2 Mini’s config exposes a gate_rank of 64 on the loop, which suggests a low-rank gated injection or mixing step, but the model card does not document it; treat that reading as unverified.
Without injection, looped transformers tend to show two failure modes. One is representational collapse, where every pass maps to roughly the same vector and extra loops add nothing. The other is divergence, where hidden-state norms grow with every pass and later iterations produce garbage. Injection plus normalisation inside the block is the standard defence against both.
Weight sharing in LLMs: parameters, FLOPs and depth become three numbers
In a conventional dense model you can quote a single size. In looped transformers you need three. Unique parameters set memory footprint and download size. Effective depth is the number of layer applications per token. FLOPs per token scale with parameters touched per layer application times effective depth.
Here is a worked, illustrative example with a dense core. Take a hidden size d = 4096 and a standard block with roughly 12d² weights (4d² for attention projections, 8d² for a 4x feed-forward). That is about 201M parameters per layer. A model with 8 unique layers stores about 1.61B non-embedding parameters. Loop the whole thing four times and each token passes through 32 layer applications. Forward compute is about 2 FLOPs per parameter per application, so roughly 2 × 201M × 32 ≈ 12.9 GFLOPs per token, ignoring attention-score cost. That matches a 32-layer dense model of about 6.4B non-embedding parameters — at a quarter of the memory.
Training is where the bill arrives. The common 6N FLOPs-per-token rule uses N as the parameters touched per token, so the looped transformer trains like the 6.4B model, not the 1.61B one. Weight sharing compresses storage. It does not compress arithmetic.
Deeper Analysis: Training, Halting and the Inkling 2 Mini Case
The theory is neat; the engineering decides whether a looped transformer trains at all and whether it is cheap to serve. Three questions dominate: how to backpropagate through many passes, how to decide how many passes to run, and what happens to the KV cache.
Case study: Inkling 2 Mini’s layer schedule
Inkling 2 Mini is the most visible production looped model so far, so it is worth reading its published numbers carefully. According to the Inkling 2 Mini model card and Hugging Face listing, it is a 24-layer decoder-only transformer with sparse MoE feed-forward layers: 128 routed experts per layer, 8 active per token, and no shared expert. It has 26.4B total parameters and 3.4B active per pass. The middle 12 layers run three times with shared weights, for 48 layer applications per token. Context length is up to 1M tokens; the license is Apache 2.0; the checkpoint is about 20GB using NVFP4 and MXFP8 mixed precision.

Figure 2: How Inkling 2 Mini turns 24 stored layers into 48 layer applications per token. Only the middle 12 layers loop.
The figure makes the accounting explicit. Six prelude layers run once, the twelve-layer core runs three times, and six coda layers run once: 6 + 36 + 6 = 48. The model card states that each extra pass adds about 1.0B active parameters, giving 5.4B “effective active” parameters per token. That figure is the right one for compute planning. Using the 2N forward rule, decode costs roughly 10.8 GFLOPs per token in matrix multiplies, versus about 6.8 GFLOPs if the core ran once. That ratio — about 1.6x — is the price of the loop at inference time, before counting attention over long contexts.
The headline benchmark is SWE-bench Verified (bash only) at 79.2%. This is vendor-reported on the model card; I could not find an independent reproduction at the time of writing. The card also lists 77.9% on SWE-bench Pro v2 (Hard), 86.6% on GPQA Diamond and 49.3% on ARC-AGI-2, again self-reported. If you evaluate agent models yourself, our guide to trajectory-level agent evaluation and pass@k on SWE-bench covers how to check numbers like these before you trust them.
One design choice stands out: the loop count is fixed. The config sets num_passes to 3 and is_varloop to false. Inkling 2 Mini is a looped transformer without per-token adaptive halting. It buys a constant 1.6x compute multiplier on the core, not a dial that scales with problem difficulty.
Training looped transformers with truncated backpropagation
Backpropagating through r passes stores r sets of activations and multiplies r Jacobians together. Memory grows linearly with r, and gradients can explode or vanish just as they did in classical RNNs. Geiping et al. use a pragmatic fix: for each training sequence they sample a loop count from a log-normal Poisson distribution with mean 32, run all passes forward, but let gradients flow only through the last k = 8 passes.

Figure 3: Top: training samples a loop count and backpropagates through only the last k passes. Bottom: inference keeps looping until the state stops changing or a budget is spent.
The top half of the figure is the training loop. Early passes run under no-gradient mode, so they cost forward FLOPs but no stored activations. The last k passes are recorded and differentiated. Memory therefore stays fixed at k passes regardless of how deep the sampled recurrence was, which is what let a 3.5B model train at a mean depth of 32 core iterations on up to 4,096 AMD MI250X GPUs on the Frontier supercomputer.
Sampling r rather than fixing it has a second benefit. The model learns to produce useful states at many depths, so at inference you can choose the depth. Geiping et al. report GSM8K chain-of-thought accuracy of zero at r = 1 for their final model, rising to 34.80% flexible / 42.08% strict at r = 32. That is the core claim of recurrent-depth work: test-time compute scales by adding loops, with no extra tokens emitted. The abstract describes gains “at a test-time computation load equivalent to a 50-billion-parameter model.”
The trade-off is a train–test mismatch. The gradient never sees the early passes directly, so the model learns them only through their effect on later states. If you push inference far beyond the training distribution of r, quality can plateau or degrade.
Adaptive computation time: halting from ACT to convergence checks
Fixed loop counts are simple. Adaptive halting is where the “adaptive computation” in the title comes from, and it has a long history.
Graves’s ACT adds a sigmoid halting unit h = σ(W_h s + b_h) after every internal step. Steps continue until the cumulative halting probability reaches 1 − ε, with ε = 0.01 in the paper. The leftover mass, called the remainder R, becomes the weight of the final step. Outputs and states are mean-field averages weighted by these probabilities, which keeps everything differentiable. A ponder cost ρ = N + R is added to the loss with a time-penalty coefficient τ. The paper notes that results are sensitive to τ, which is chosen by grid search — a known pain point.
The Universal Transformer applied ACT per position, so easy tokens can stop early while hard tokens keep iterating. Their states are then copied forward unchanged, which is wasteful on GPUs: the batch still executes the block for every position, and halted ones are just masked.
Recurrent-depth LLMs mostly use a simpler, training-free exit. Geiping et al. stop iterating for a token when the KL divergence between successive output distributions drops below 5 × 10⁻⁴. No halting head is trained; the model simply runs until its prediction stops changing. Ouro, by contrast, trains depth allocation with an entropy-regularised objective. Mixture-of-Recursions goes furthest: lightweight routers assign each token its own recursion depth, either by “expert-choice” (each depth picks its top-k tokens) or “token-choice” (each token picks a depth up front).
Halting granularity is the key systems question. Per-sequence halting batches cleanly. Per-token halting saves FLOPs on paper but creates ragged work that GPUs handle poorly unless you compact active tokens between passes — which is exactly what MoR’s expert-choice routing does.
A minimal looped block in PyTorch
The code below is a complete, runnable toy: a prelude block, a two-layer shared core with concatenation-based input injection and a random initial state, a coda block and an LM head. In fixed-loop mode it uses truncated backpropagation, running early passes under torch.no_grad(). In halting mode it implements Graves-style ACT per position with a mean-field output and a ponder cost. It is written for clarity, not speed; it has no KV cache and recomputes full attention every pass.
import torch
import torch.nn as nn
class Block(nn.Module):
"""Pre-norm transformer block (causal self-attention + MLP)."""
def __init__(self, d, n_heads, mlp_mult=4):
super().__init__()
self.ln1 = nn.LayerNorm(d)
self.attn = nn.MultiheadAttention(d, n_heads, batch_first=True)
self.ln2 = nn.LayerNorm(d)
self.mlp = nn.Sequential(
nn.Linear(d, mlp_mult * d), nn.GELU(), nn.Linear(mlp_mult * d, d))
def forward(self, x, mask):
h = self.ln1(x)
a, _ = self.attn(h, h, h, attn_mask=mask, need_weights=False)
x = x + a
return x + self.mlp(self.ln2(x))
class LoopedCore(nn.Module):
"""Shared core reused n_loops times, with input injection and optional ACT halting."""
def __init__(self, d, n_heads, n_layers=2, halting=False):
super().__init__()
self.adapter = nn.Linear(2 * d, d) # concat(state, e) -> d
self.layers = nn.ModuleList(Block(d, n_heads) for _ in range(n_layers))
self.norm = nn.LayerNorm(d)
self.halting = halting
if halting:
self.halt = nn.Linear(d, 1)
def step(self, s, e, mask):
x = self.adapter(torch.cat([s, e], dim=-1)) # input injection
for layer in self.layers:
x = layer(x, mask)
return self.norm(x)
def forward(self, e, mask, n_loops=4, grad_loops=2, eps=0.01):
B, T, _ = e.shape
s = torch.randn_like(e) * 0.02 # random initial latent state
if not self.halting:
n_free = max(n_loops - grad_loops, 0)
with torch.no_grad(): # truncated backprop: no graph
for _ in range(n_free):
s = self.step(s, e, mask)
for _ in range(n_loops - n_free): # gradients flow through these
s = self.step(s, e, mask)
return s, torch.zeros(B, T, device=e.device)
# ACT-style per-position halting with mean-field output (Graves 2016)
cum = torch.zeros(B, T, device=e.device)
ponder = torch.zeros(B, T, device=e.device)
out = torch.zeros_like(e)
running = torch.ones(B, T, dtype=torch.bool, device=e.device)
for i in range(n_loops):
s = self.step(s, e, mask)
h = torch.sigmoid(self.halt(s)).squeeze(-1)
halt_now = running & (cum + h >= 1 - eps)
if i == n_loops - 1: # hard cap: halt everyone left
halt_now = running.clone()
remainder = 1 - cum
p = torch.where(halt_now, remainder, torch.where(running, h, torch.zeros_like(h)))
out = out + p.unsqueeze(-1) * s
ponder = ponder + running.float() + torch.where(halt_now, remainder, torch.zeros_like(h))
cum = cum + torch.where(running & ~halt_now, h, torch.zeros_like(h))
running = running & ~halt_now
if not running.any():
break
return out, ponder # ponder = N + R per position
class TinyLoopedLM(nn.Module):
def __init__(self, vocab, d=256, n_heads=4, halting=False):
super().__init__()
self.emb = nn.Embedding(vocab, d)
self.prelude = Block(d, n_heads)
self.core = LoopedCore(d, n_heads, n_layers=2, halting=halting)
self.coda = Block(d, n_heads)
self.head = nn.Linear(d, vocab, bias=False)
def forward(self, idx, n_loops=4, grad_loops=2):
T = idx.shape[1]
mask = torch.triu(torch.ones(T, T, dtype=torch.bool, device=idx.device), 1)
e = self.prelude(self.emb(idx), mask)
s, ponder = self.core(e, mask, n_loops=n_loops, grad_loops=grad_loops)
return self.head(self.coda(s, mask)), ponder
if __name__ == "__main__":
torch.manual_seed(0)
vocab, tau = 1000, 0.01 # tau = ACT time penalty
for halting in (False, True):
model = TinyLoopedLM(vocab, halting=halting)
idx = torch.randint(0, vocab, (2, 64))
logits, ponder = model(idx[:, :-1], n_loops=6, grad_loops=2)
loss = nn.functional.cross_entropy(logits.reshape(-1, vocab), idx[:, 1:].reshape(-1))
loss = loss + tau * ponder.mean()
loss.backward()
n_params = sum(p.numel() for p in model.parameters())
print(f"halting={halting} params={n_params:,} loss={loss.item():.3f} "
f"mean_ponder={ponder.mean().item():.2f}")
Three details are worth calling out. First, the parameter count is identical whether you run 1 loop or 60; only n_loops changes compute. Second, in halting mode the code still executes the core for positions that have already halted and simply stops adding them to the output — exactly the GPU-friendly but FLOP-wasteful behaviour of the original Universal Transformer. A production system would gather the still-running tokens into a smaller batch between passes. Third, the halting branch backpropagates through every pass. Combining ACT with truncated backprop is possible, but you must decide how the ponder cost’s gradient reaches the passes you detached, and the published recipes differ.
To try test-time depth scaling with this toy, train with a randomly sampled n_loops per batch — for example, drawn between 2 and 8 — then evaluate the same checkpoint at 2, 4, 8 and 16 loops. A model trained at a single fixed depth usually degrades when run deeper, which is why recurrent-depth papers randomise depth during training.
KV Cache and Serving Cost of Looped Transformers
Looped transformers save weight memory, but the KV cache is a separate budget, and looping can quietly multiply it. Every attention layer application needs keys and values for prior tokens. If a layer runs three times per token, an implementation must decide whether each pass gets its own cache entries or whether passes share them.

Figure 4: KV cache options for a looped attention layer, from exact but memory-hungry per-pass caching to routed caching that only stores keys and values for tokens still active.
The figure lays out four published or obvious strategies. A per-pass cache stores separate keys and values for every loop iteration, which preserves exact training-time semantics but multiplies cache memory by the loop count. A shared cache stores only the first pass’s KV and reuses it later, which keeps memory equal to an unlooped model but means later passes attend to stale representations. Geiping et al. use rolling slots: a fixed per-token budget of k entries, where iteration i writes slot i mod k, so with a budget of 16 the 17th iteration overwrites the first. They report this did not noticeably hurt MT-Bench scores. Mixture-of-Recursions offers two variants: recursion-wise caching, where only tokens routed to a depth store KV at that depth, and recursive KV sharing, which caches only at the first recursion.
Worked KV arithmetic for Inkling 2 Mini
The public config.json lets us estimate cache size, with the caveat that how each runtime implements looped caches is not documented. The text model uses 8 KV heads with a head dimension of 128. In BF16, one layer’s K and V for one token take 2 × 8 × 128 × 2 bytes = 4,096 bytes.
Twenty of the 24 layers are listed as local, sliding-window attention with a 1,024-token window. The remaining four — layers 5, 11, 17 and 23 — appear to be global. Two of those, 11 and 17, sit inside the looped core spanning layers 6–17.
- Shared-cache reading: four global layer caches × 4 KiB = 16 KiB per token. At 1,048,576 tokens that is 16 GiB.
- Per-pass reading: two unlooped global layers plus two looped ones × 3 passes = 8 layer caches, or 32 KiB per token — 32 GiB at 1M tokens.
- Local layers: with a 1,024-token window, 20 local layer caches cost about 80 MiB per sequence, or about 160 MiB if the 10 looped local layers keep per-pass caches.
These are my illustrative estimates, not measurements. They show why the hybrid local/global design matters. If all 24 layers were global and every looped layer kept per-pass caches, the count would be 12 + 12 × 3 = 48 layer caches — 192 GiB at 1M tokens. The sliding-window layers make long context feasible; the loop decides whether the global cache is 16 GiB or 32 GiB. Add a roughly 20GB checkpoint and a full 1M-token context does not fit the 32GB recommendation under either reading, so treat million-token use as a workstation or server workload. Cache quantisation to FP8 would halve these figures. KV-compression techniques such as multi-head latent attention and grouped-query attention are complementary to looping, not alternatives.
MoR’s paper quantifies the routed-cache trade-off. With recursion-wise caching, KV memory is roughly (Nr + 1) / 2Nr of a vanilla model, where Nr is the number of recursions. With recursive KV sharing it falls to about 1/Nr, but KV memory traffic stays at vanilla levels because every recursion still reads the full cache. The authors report up to 2.06x inference throughput for an MoR-4 configuration at maximum batch size, at the 135M–1.7B scales they studied.
Decode is bandwidth-bound, and loops re-read weights
There is a common misconception that looping is “free” at inference because the weights are already in memory. On a GPU, decode at small batch sizes is limited by memory bandwidth, not arithmetic. Each layer application streams its weights from HBM through the compute units. A 12-layer core of a mid-sized model is far larger than on-chip SRAM or L2, so the second and third passes stream the same weights again.
For Inkling 2 Mini, the effective 5.4B active parameters per token is the number to use for bandwidth, not 3.4B. As an illustrative calculation, at roughly 4.5 bits per weight for an NVFP4-style format, 5.4B parameters is about 3.0 GB of weight traffic per decoded token at batch size 1. On a device with around 270 GB/s of memory bandwidth, that caps single-stream decode near 90 tokens per second before attention and overheads. An unlooped 3.4B-active model would cap near 140. The loop buys quality per stored byte, not speed per token.
Larger batches change the picture, because weight reads are amortised across many sequences while compute grows. That is why looped transformers suit high-throughput serving better than single-user latency. The inference SLO trade-offs between TTFT, TPOT and goodput apply directly: a looped model raises per-token compute, so it lowers peak TPOT headroom at a fixed hardware budget.
Looping meets Mixture-of-Experts
Inkling 2 Mini combines looping with sparse MoE. Each looped layer routes each token to 8 of 128 experts on every pass. The model card does not say whether a token tends to pick the same experts on each pass, but in a standard implementation the router reads the current hidden state, so different passes can activate different experts. That makes each pass more than a repetition — it is closer to a fresh, sparsely chosen computation over the same expert pool.
The combination has an appealing economic logic. MoE lets total parameters grow without growing per-token compute. Looping lets per-token compute grow without growing total parameters. Together they give designers two independent dials: knowledge capacity via experts and reasoning depth via loops. The Medium analysis of the release frames it as looping “for reasoning, not knowledge”; that matches the theory from Saunshi et al., who report a reasoning-versus-memorisation dichotomy in looped transformers.
The cost is serving complexity. Expert-parallel deployments already have to balance load across devices. Looping triples the number of routing events per token in the core, so any expert hot-spotting is amplified. If you deploy across GPUs, the trade-offs in tensor, expert and data parallelism for MoE inference apply three times over in the looped section.
Latent loops versus chain-of-thought tokens
Looping is a form of test-time compute, and it competes with the dominant form: emitting reasoning tokens. The two scale differently. Chain-of-thought adds sequence length, so each extra reasoning token adds a full forward pass and a new KV entry in every layer. Looping adds depth per token, so it adds FLOPs and, under per-pass caching, KV entries only in looped layers — but no extra tokens.
A rough, illustrative comparison clarifies the shape. Suppose a task needs 2,000 extra reasoning tokens on an unlooped model at 6.8 GFLOPs per token. That costs about 13.6 TFLOPs plus 2,000 extra KV positions per layer. A looped transformer answering in 500 tokens pays a 1.6x multiplier, or 4.0 extra GFLOPs per token: about 2 TFLOPs for the answer. But the multiplier also applies to prefill. A 10,000-token prompt adds 40 TFLOPs of loop overhead before the first output token — far more than the reasoning tokens saved. Looping wins on short-prompt, reasoning-heavy work and can lose on long-context retrieval, where most tokens need reading, not thinking. Launch commentary claims Inkling 2 Mini needs fewer output tokens to reach answers; I have not found a published token-efficiency measurement, and latent computation is harder to inspect. The interpretability concerns in our chain-of-thought faithfulness fact-check get sharper when reasoning moves into hidden states you cannot read.
Looping also pairs naturally with speculative decoding. A looped model contains its own cheaper draft: run the core fewer times to propose tokens, then verify with more iterations. Geiping et al. demonstrate exactly this as “zero-shot self-speculative decoding,” with no separate draft model. Gains depend on how often the shallow and deep passes agree, and a fixed-loop model such as Inkling 2 Mini was not trained to produce useful outputs at shallower depth, so treat this as a design option to benchmark, not a guaranteed speed-up.
Looped Transformers Compared to Other Ways of Adding Compute
Looped transformers are one of several architectural answers to the same question: how do you get more useful computation per stored parameter or per emitted token? The table below compares them on the dimensions that matter for deployment. Entries describe mechanisms, not benchmark wins.
| Approach | Stored params | Compute per token | KV cache effect | Adaptive per input? | Main risk |
|---|---|---|---|---|---|
| Dense deep stack | Grows with depth | Grows with depth | One cache per layer | No | Memory and cost |
| ALBERT-style full sharing | Fixed, small | Grows with depth | One cache per layer application | No | Accuracy loss, mostly from shared FFN |
| Universal Transformer + ACT | Fixed | Varies per position | Depends on halting | Yes, learned halting | Tuning τ, ragged GPU work |
| Recurrent depth, prelude–core–coda | Fixed | Chosen at inference | Rolling or per-pass | Yes, convergence exit | Train–test depth mismatch |
| Mixture-of-Recursions | Fixed | Routed per token | Only active tokens cached | Yes, router | Causality and load balance in routing |
| Mixture-of-Experts | Large | Fixed, small | Unchanged | Routing only | Expert load balance |
| Chain-of-thought tokens | Unchanged | Grows with tokens | Grows with tokens | Yes, by length | Latency, verbosity |
The useful reading is that these are composable. Inkling 2 Mini is MoE plus a fixed loop. MoR is a loop plus routing. Nothing prevents a model from using MoE, a routed loop and chain-of-thought together, and the frontier is likely to explore exactly that. A related family — linear-attention and state-space models — recurs over the sequence dimension instead of depth; our comparison of RWKV, Mamba and linear attention covers that axis, and the two kinds of recurrence are orthogonal.
Trade-offs, Gotchas, and What Goes Wrong
The first gotcha is accounting. Vendors and papers quote the smallest flattering number. “3.4B active” is true per pass, but 5.4B is what you pay. “1.61B parameters” in a looped transformer can be a 6B-class compute bill. Always ask for effective layer applications per token and FLOPs per token, not just parameter counts.
Training stability is the second. Deep loops behave like deep RNNs. Without input injection and normalisation inside the block, hidden-state norms can grow with each pass. Geiping et al. document two failed runs at full scale before their main run. In the first, the correlation of hidden states across tokens went to 1.0 — a representation collapse. In the second, validation perplexity was the same at 1 or 32 recurrences, because the model had learned to ignore the incoming state. The fix was a return to the sandwich block format and a lower peak learning rate. This is an architecture where small choices — concatenation versus addition, initial-state distribution, normalisation placement — decide whether training converges at all. Budget for ablations.
Third, depth extrapolation is not guaranteed. A model trained at three fixed passes will not reliably improve at six. Even models trained with sampled depth have a ceiling, and running far beyond the training distribution can make outputs worse. Treat inference depth as a hyperparameter to validate per task.
Fourth, per-token halting is hard on hardware. Token-level adaptive depth produces ragged work that leaves GPU lanes idle unless you compact active tokens between passes. MoR’s expert-choice routing solves load balance but can leak information from future tokens during training, so it needs an auxiliary router or loss to stay causal. Token-choice routing avoids the leak but needs balancing losses.
Fifth, tooling lags. The Inkling 2 Mini model card itself warns that local runtime support for looped transformers is new and that speed varies by runtime. Quantisation recipes, KV cache layouts, kernel fusion and serving schedulers all assume each layer runs once. Expect bugs, mismatched cache semantics between training and inference, and inconsistent benchmark numbers across runtimes.
Finally, sharing weights reduces capacity. ALBERT’s ablation is the clearest public evidence that sharing FFN weights costs accuracy. Looped transformers trade knowledge capacity for depth. That is the right trade for multi-step reasoning and probably the wrong one for knowledge-heavy recall, which is why pairing loops with MoE experts is attractive.
Practical Recommendations
If you are evaluating a looped transformer for production, start with the compute and memory math rather than the leaderboard. Compute FLOPs and weight bytes per token from effective active parameters, not the headline. Then estimate KV cache under both shared and per-pass assumptions, and confirm which one your runtime actually uses by measuring memory at two context lengths.
Benchmark the model in your own serving stack at your real batch sizes. Looped transformers look best at high batch, where weight reads are amortised, and worst for single-user, latency-sensitive decode. Test several loop counts if the model allows it, and check whether the vendor’s chosen depth is actually optimal for your tasks.
If you are training your own looped transformer, copy what has worked publicly. Keep unique prelude and coda layers and loop the middle. Inject the input on every pass, preferably by concatenation plus a projection. Sample the loop count during training and use truncated backpropagation through the last few passes to bound memory. Add adaptive halting only once a fixed-depth model trains stably, and prefer a training-free convergence exit before a learned halting head.
Checklist:
- [ ] Convert “active parameters” into effective active parameters × loop count before planning capacity.
- [ ] Measure KV cache growth at two context lengths to infer the runtime’s loop-cache policy.
- [ ] Benchmark TPOT at batch 1 and at your target batch; expect the gap to be wider than for unlooped models.
- [ ] Validate quality at more than one loop count on your own evaluation set.
- [ ] Re-run vendor benchmarks you depend on; label vendor numbers as self-reported in internal docs.
- [ ] For training: middle-cycle sharing, input injection, sampled depth, truncated backprop, norm inside the block.
Frequently Asked Questions
What is a looped transformer?
A looped transformer is a transformer that applies the same block of layers several times per token instead of passing through distinct layers once. Each pass takes the previous pass’s hidden state, and usually the original input, and refines it. The result is more effective depth and more compute per token without more stored parameters. Modern versions loop only the middle layers, keeping unique input and output layers, and may decide adaptively how many passes to run.
How is a looped transformer different from a Universal Transformer?
The Universal Transformer, introduced by Dehghani et al. in 2018, is an early looped transformer. It recurs one block over depth and uses per-position Adaptive Computation Time to halt. Today’s looped LLMs keep the recurrence but usually change the recipe: they loop a multi-layer middle section between unique prelude and coda layers, inject the input every pass, train with sampled depth and truncated backprop, and often use fixed loop counts or simple convergence-based exits instead of learned ACT halting heads.
Do looped transformers reduce inference cost?
They reduce memory for weights, not compute. A looped transformer with few stored parameters still performs a full forward pass through its core on every loop, so FLOPs per token scale with loop count. Decode is often bandwidth-bound, and the shared weights are re-read on each pass, so per-token latency at small batch sizes is usually higher than for an unlooped model with the same stored size. The benefit is better quality per gigabyte of weights.
What is Adaptive Computation Time?
Adaptive Computation Time, proposed by Alex Graves in 2016, lets a recurrent network learn how many internal steps to take per input. A sigmoid halting unit outputs a probability after each step; steps continue until the cumulative probability reaches 1 minus a small epsilon. Outputs are probability-weighted averages of the step states, and a ponder cost proportional to steps used is added to the loss, controlled by a time-penalty coefficient that must be tuned.
How does looping affect the KV cache?
Every pass through a looped attention layer produces new keys and values. If the runtime stores a separate cache per pass, cache memory for looped layers multiplies by the loop count. Alternatives include sharing the first pass’s cache, rolling a fixed number of slots per token, or caching only tokens still active at each depth, as Mixture-of-Recursions does. Each saves memory at some cost in fidelity or memory traffic, so check which policy your runtime implements.
Is Inkling 2 Mini’s 79.2% SWE-bench Verified score independently verified?
Not at the time of writing. The 79.2% SWE-bench Verified (bash only) figure comes from Thinking Machines Lab’s own model card for Inkling 2 Mini, released on 20 November 2026, alongside other self-reported coding and reasoning scores. Benchmark results depend on agent scaffolding, tool configuration and run settings, so treat vendor numbers as a starting point. Re-run the evaluation in your own harness before relying on it for a model selection decision.
Further Reading
- Mixture-of-Experts LLM architecture — the complementary technique for decoupling total parameters from per-token compute.
- Multi-head latent attention vs GQA vs MQA for KV cache compression — how to shrink the cache that looping can multiply.
- Speculative decoding architecture for LLM inference — draft-and-verify decoding, which pairs naturally with shallow and deep loop counts.
- RWKV vs Mamba vs linear attention — recurrence over the sequence instead of over depth.
- External: Geiping et al., Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approach (arXiv 2502.05171).
- External: Bae et al., Mixture-of-Recursions (arXiv 2507.10524).
By Riju — about
