1. Looped transformers and the residual stream#

1.1. A transformer is a sum of updates#

The paper’s notation (§3.1) [YDZS26]: a sublayer is an attention or a feed-forward (FFN) module, a layer is one of each, so \(L\) layers are \(2L\) sublayers. With the PreNorm residual [XYH+20], sublayer \(i\) maps its input \(h_{i-1}\) to

\[ h_i = h_{i-1} + f_i\big(\operatorname{Norm}(h_{i-1})\big), \qquad i = 1, \dots, 2L, \tag{1} \]

and unrolling the recursion gives

\[ h_i = h_0 + \sum_{j=1}^{i} f_j\big(\operatorname{Norm}(h_{j-1})\big): \]

every update enters every later state with coefficient 1. [paper]

1.2. Looping: depth without parameters#

A looped transformer applies the whole stack \(\mathcal S = \mathcal F_{2L}\circ\dots\circ\mathcal F_1\) (with \(\mathcal F_i\) the map of eq. (1)) \(R\) times,

\[ y = \operatorname{LMHead}\circ\mathcal S^{(R)}\circ\dots\circ\mathcal S^{(1)}(h_0), \qquad \mathcal S^{(1)} = \dots = \mathcal S^{(R)} = \mathcal S, \]

so the unrolled network has an effective depth of \(2LR\) sublayers with only \(2L\) distinct ones. The idea goes back to Universal Transformers [DGV+19]; looped models learn algorithms well [YLNP24], can simulate chains of thought in latent space [SDL+25], and generalise better on controlled multi-hop reasoning tasks [KPSY26]. For the released models the configuration files give: [code]

Hide code cell source

rows = []
for name in lib.CHECKPOINTS:
    cfg = lib.config(name)
    rows.append((name, cfg["physical_layers"], cfg["loop_count"], cfg["num_hidden_layers"],
                 2 * cfg["physical_layers"], lib.effective_sublayers(cfg)))
lib.md(lib.table(rows, ["model", "physical layers L", "loops R", "effective layers LR",
                        "distinct sublayers 2L", "effective sublayers 2LR"]))

model

physical layers L

loops R

effective layers LR

distinct sublayers 2L

effective sublayers 2LR

ARLoop-0.6B

18

3

54

36

108

PreNormLoop-0.6B

18

3

54

36

108

ARLoop-1.2B

24

3

72

48

144

So the released 0.6B models run 108 sublayers built from 36 distinct ones, and ARLoop-1.2B runs 144 from 48.

In a loop, the residual stream is the only memory that carries information from one pass to the next. Everything a later pass knows about what earlier passes computed has to survive in \(h\). (The released models also re-supply each token’s identity in every pass, through the value residuals of their attention: a gated token embedding added to the attention values at alternating layers, App. A.1.)

1.3. How earlier work stabilised the loop#

design

update rule (as in the paper’s App. E)

where it comes from

PreNorm

\(h \leftarrow h + f(\operatorname{Norm}(h))\)

[XYH+20]

Sandwich norm

\(h \leftarrow \operatorname{Norm}\big(h + f(\operatorname{Norm}(h))\big)\)

Huginn [GMJ+25], Ouro [ZWH+25]

DeepLoop

\(h \leftarrow \operatorname{Norm}\big(\alpha h + f(\operatorname{Norm}(h))\big)\), \(\alpha = (2LR)^{1/2}\)

[LZG+26], after DeepNet [WMD+22]

Parcae

between loops \(s^{(r)} = \mathcal S\big(\bar A s^{(r-1)} + \bar B e\big)\), \(\bar A = \exp(\Delta A)\), \(A = \operatorname{Diag}(-\exp a)\)

[PNBKF26]

input injection

the embedding \(e\) is added back before each pass

[BSB+22], Huginn

ARLoop

softmax attention over earlier residual sources (next chapter)

[YDZS26], after [Kim26]

Huginn-3.5B trains with a random number of loops (up to 64) on 0.8T tokens; Ouro uses 4 loops and 7.7T tokens; Hyperloop [ZTHK26] is a further design in the same family. Our own latent programme used the retrofitted recurrence of [MLK+25] on a pretrained Qwen model; learned halting is examined critically in [WHT26]. [paper, digest §1; the last two references are ours, not the paper’s]

1.4. How large does the stream get?#

Under PreNorm every update is added with weight 1, and the next sublayer only sees the direction \(\operatorname{Norm}(h)\). Take the cleanest case: \(h_0\) and all updates are unit vectors, each orthogonal to everything before it. Then \(\|h_i\| = \sqrt{1+i}\), and the newest update is only a fraction \(1/\sqrt{1+i}\) of the direction the next sublayer reads. A softmax mixture of sources whose norms are at most \(B\) never exceeds \(B\) (it is a convex combination). The demo below draws such updates in the 0.6B model’s width and depth and compares three streams: the PreNorm sum, a softmax mixture over all earlier sources with random scores, and ARLoop’s block attention residuals on the 0.6B model’s actual schedule of blocks and window (constructed in The window, block by block).

Hide code cell source

demo = lib.stream_norm_demo(c06)
n = lib.effective_sublayers(c06)
s = np.arange(n + 1)                     # routing calls 0..n; call n is the read-out
final, share = demo["prenorm"][-1], 1 / demo["prenorm"][-1]
print(f"PreNorm at the read-out ({n} updates): |h| = {final:.4f} = sqrt({n + 1})")
print(f"  share of the newest update in the direction read: {share:.3f}")
print(f"softmax mixture over all sources: max |h| = {demo['mixture'].max():.4f}")
print(f"block attention residuals (0.6B schedule): max |h| = {demo['block'].max():.4f}")
print(f"  largest source norm: {demo['bound'].max():.4f} = sqrt(19)")
PreNorm at the read-out (108 updates): |h| = 10.4403 = sqrt(109)
  share of the newest update in the direction read: 0.096
softmax mixture over all sources: max |h| = 1.0000
block attention residuals (0.6B schedule): max |h| = 4.1773
  largest source norm: 4.3589 = sqrt(19)

Hide code cell source

P = lib.PALETTE
fig, ax = lib.figure(figsize=(8, 3.4))
lib.style(ax)
curves = [("PreNorm sum", demo["prenorm"], P["pn"]),                       # the PreNorm loop: gold
          ("softmax mixture, all sources", demo["mixture"], P["neutral"]),  # a generic mixture: neutral
          ("block attention residuals, 0.6B schedule", demo["block"], P["ar"])]  # ARLoop: indigo
for label, y, color in curves:
    ax.plot(s, y, color=color, lw=2, solid_capstyle="round", label=label)
    ax.annotate(f"{y[-1]:.2f}", (s[-1], y[-1]), xytext=(6, 0), textcoords="offset points",
                va="center", fontsize=9, color=P["ink"])
for b in (36, 72):
    ax.axvline(b, color=P["rule"], lw=1)
ax.set_xlabel("routing call s (loops start at 0, 36, 72; 108 is the read-out)")
ax.set_ylabel("norm of the state read")
ax.legend(frameon=False, fontsize=9, labelcolor=P["ink"], loc="upper left")
ax.set_xlim(0, n + 9)
fig.tight_layout()
plt.show()
_images/382b93c37214e31665b5f611285fa6c67db44b9ab263d230cfdf53305e2af9c4.png

With orthogonal unit updates the PreNorm stream reaches \(\sqrt{109} \approx 10.44\) after the 108 sublayers of the 0.6B model, and the newest update is only 0.096 of the direction the next sublayer reads. The softmax mixtures stay at or below the norm of their largest source: 1 for single updates, \(\sqrt{19}\approx 4.36\) for ARLoop’s first block, which holds the embedding and 18 updates [num]. Real updates are neither orthogonal nor of unit norm; E1.4 measures the stream norms of the released PreNormLoop-0.6B at the end of each loop (E1: the released checkpoints, re-measured). The point of the toy is the shape: a fixed-weight sum dilutes each new update, a learned mixture does not have to.