Information Flow in Looped Transformers
Overview
This note started from Shiwei Liu’s blog post, From Model Compression to Looped Transformers [1], and Thinking Machines Lab’s release of Inkling 2 Mini on Tinker [2]. Pruning studies show that many deep layers in large language models barely change the hidden state (Curse of Depth [3]). Inkling 2 Mini loops its middle 12 layers 3 times to get 48-layer depth in half the weights.
The direction we care about here pushes that idea much further — a tiny core reasoning model (2 layers, ~7M parameters) that runs hundreds or thousands of loops at test time, spending extra FLOPs only when a problem is hard [4], [5], [6]. That is the exact regime studied in Scaling to Tens of Thousands of Test-Time Iterations with Loop-Native Attention Residuals (InfiLoop) [6], whose architecture, training setup, and ablation design on Sudoku-Extreme [7] we directly build on.
As mapped out in Looped Transformers: Architecture, Training, and Inference [8] and InfiLoop [6], two things break when you push a tiny core to very high loop counts (N_test >> N_train):
- Signal washout vs. memory growth. Overwriting a single hidden vector
hon every pass erases useful intermediate steps. Keeping all past passes in memory for softmax attention fixes recall, but memory grows linearly with loop count (14 MB → 1,098 MBat160segments). - Latent overthinking. All
Ttokens in an input loop through the shared layers together. Easy tokens finish early; hard tokens need many passes. Extra passes keep editing tokens that were already right, flipping solved answers back to wrong.
Both failures come down to information flow: what state crosses from Pass p-1 to Pass p, and how each pass updates that state. Following InfiLoop’s ablation methodology [6], we hold the 2-layer core (6.8M parameters, trained for 12 segments = 504 layer visits) completely fixed, roll it out to 160 segments (6,720 layer visits = 13.3× training depth), and change only the cross-loop state mechanism.
Summary of what we found: replacing a single running-average vector (InfiLoop, 21.04%) with a small float32 state matrix S ([dk, D]), split into S_attn and S_mlp and updated inside every layer by the delta rule (v - k @ S) [9]:
- Doubles exact puzzle accuracy at full compute (
21.04% → 42.63%), while adding only+1.9%FLOPs per pass. - Uses
39×fewer FLOPs to beat the baseline ceiling: at116 GFLOPs/board(4segments), our model already solves33.64%of boards, beatingInfiLoopat4,566 GFLOPs/board(21.04%). - Stops latent overthinking (
Lost@160 = 0.00%): out of827boards solved at training depth,0boards break when looped13.3×longer (6,720layer visits).
Why Loop a Small Reasoning Core?
1. The Curse of Depth in Deep Transformers
In a standard Pre-LN Transformer, every layer normalizes its own input, runs Attention and MLP, and adds the result back onto the unnormalized residual stream x [3]:
# x: [B, T, D] residual stream at layer l
h = rms_norm(x) # [B, T, D] scaled back to ~1
delta = block(h) # [B, T, D] update of size ~1
x_next = x + delta # [B, T, D] x grows larger at every layer!By layer 40, x can have a scale of 100 while delta still has a scale of 1. Adding 1 onto 100 barely moves x. Deep layers turn into near no-ops, wasting both parameter memory and FLOPs [1], [3]. Attention Residuals [10] fix this along physical depth by normalizing earlier depth chunks first and taking a learned softmax average over them.
2. Looping as Reasoning Under a FLOP Budget
Saunshi et al. [4] show that a small looped Transformer running N iterations can reproduce N steps of chain-of-thought reasoning directly inside its [B, T, D] hidden state, without emitting intermediate text tokens. Under a fixed FLOP budget, looping gives two advantages:
- Tiny weight footprint: a
2-layer core looped24times performs48layer visits with24×fewer layer weights than a48-layer model. - Test-time compute scaling: easy inputs can stop after a few passes (
~100 GFLOPs), while hard multi-step inputs can run100+passes (~4,500 GFLOPs) using the exact same weights [5], [6].
3. Attention Residuals (Vertical) vs. Loop State (Horizontal): How They Complement Each Other
A looped model has two different depth axes, and they need different mechanisms:
Vertical axis (
m = 0 .. M-1, inside one pass) — Attention Residuals [10]: Instead of adding every layer onto one unnormalized sumx, each layer normalizes earlier depth blocks first and mixes them with a learned softmax query:# V: [num_blocks, B, T, D] earlier depth blocks inside the current pass K = rms_norm(V) # equal scale per depth block p = F.softmax(einsum('nbtd,d->btn', K, query), -1) # [B, T, num_blocks] x_in = einsum('btn,nbtd->btd', p, K) # [B, T, D] bounded input!This stops the Curse of Depth inside a deep block (for example, Inkling 2 Mini [2] groups its
12Core layers into two6-layer buckets with Attention Residuals).Horizontal axis (
p = 0 .. N-1, across passes) — Loop State: You cannot simply run Attention Residuals across allN = 160passes (6,720layer visits), because storing every past pass on a shelf grows GPU memory linearly (14 MB → 1,098 MBin our A100 benchmark) and turns compute quadratic (O(N²)). Across passes, you need a fixed-size state that carries forward useful steps and edits out wrong ones.
The two ideas are complementary, not competing: Attention Residuals keep a deep M-layer core well-scaled vertically, while loop state carries reasoning horizontally across N passes in O(1) memory. Because our testbed uses a tiny M = 2-layer core (too shallow for vertical variance blowup), plain vertical residuals (x = rms_norm(x + u)) are enough vertically — letting us isolate 100% of our ablation on horizontal information flow.
4. Can Token Early-Exit (MoR) Avoid Overthinking Instead?
One natural question is: if latent overthinking happens because easy tokens keep looping after they are already solved, why not just stop looping easy tokens early — as in Mixture-of-Recursions (MoR) [11]?
Early-exiting does protect the exited tokens from later edits, because a router physically drops them out of the active tensor ([B, 8, D] → [B, 4, D] → [B, 2, D]):
# Inkling 2 Mini / Ours: ALL T=8 tokens loop together on every pass
Pass 0: x is [B, 8, D] --> Q, K, V are [B, 8, D] (every token sees all 8 tokens)
Pass 1: x is [B, 8, D] --> Q, K, V are [B, 8, D] (every token sees updated K, V of all 8)
Pass 2: x is [B, 8, D] --> Q, K, V are [B, 8, D]
# Mixture-of-Recursions (MoR): active token count shrinks each pass
Pass 0: active = [0..7] --> Q is [B, 8, D] # router keeps 4 hardest tokens
Pass 1: active = [2,5,6,7] --> Q is [B, 4, D] # tokens [0,1,3,4] exited!
Pass 2: active = [5,7] --> Q is [B, 2, D] # only [5,7] still run!Look at what the 2 remaining hard tokens [5, 7] (Q [B, 2, D]) see inside Softmax Attention on Pass 2 [11]:
- Recursion-wise KV (
K, Vis[B, 2, D]): Tokens[5, 7]can only attend to[5, 7]— the6already-solved tokens ([0, 1, 2, 3, 4, 6]) are invisible! On a Sudoku board, hard empty squares would lose sight of the clues and solved neighbors they depend on. - First-pass KV sharing (
K_0, V_0is[B, 8, D]): Tokens[5, 7]attend to Pass 0’s frozenK_0, V_0— so if neighbor square6was solved on Pass 1, square7on Pass 2 still sees square6as blank (Pass 0). - Test-time depth scaling (
N = 160):MoRtrains a fixed router per pass (router[0 .. N_train-1]), which does not extend to160test segments, and the hard tokens[5, 7]that stay in the loop still need a non-washing-out state across passes.
Keeping all T tokens in [B, T, D] while updating state S by the delta rule (err = v - k @ S) gives both benefits at once: hard tokens keep seeing freshly updated neighbors on every pass, while already-solved tokens hit err = 0 so their stored state stays locked (Lost@160 = 0.00%).
Information Flow Across Loop Passes
Every looped Transformer has two information pathways:
- Vertical flow (
m = 0 .. M-1, inside one pass): how layers pass activations downward inside a single pass. - Horizontal flow (
p = 0 .. N-1, across passes): what state carries forward from Passp-1into Passp.
Recent architectures make very different choices on the horizontal axis:
| Architecture | Cross-pass state per token | How Pass p updates state |
What happens when N is large (N = 160) |
|---|---|---|---|
Carry-Last (Huginn) [5] |
1 vector [1, D] |
Overwrites h <- Block(h + x0) |
Input x0 stays sharp, but intermediate drafts from earlier passes are overwritten. |
| Inkling 2 Mini [2] (AttnRes + 1-Pass Bank) | 2 vectors [2, D] |
Resets to Prelude; passes bank = [B2, B3] from Pass p-1 via 4 gated controllers (Q, K, V, MoE) |
Clean separate gating for Attention and MoE at N = 3, but overwrites bank every pass (Pass 0 is gone by Pass 2). |
Step-Indexed Highway (MeSH) [12] |
K slots [K, D] |
Learned router W[p] per pass, adds M += w * h |
W[p] is not trained for p >= N_train; + w * h grows without bound (10.2× drift). |
| InfiLoop [6] | 1 vector [1, D] |
Running weighted average num = b*num + w(z)*z |
Constant memory at any N, but mixes Attention & MLP into 1 vector and w(z) never checks if stored state is already solved. |
Ours: Per-Layer State S |
2 matrices 2 × [dk, D] |
Separate S_attn & S_mlp, updated at every layer by S = a*S + b*outer(k, v - k@S) |
Constant memory, separate Attention/MLP channels, writes only the difference v - k@S. |
Interactive M × N Information Flow
All five tabs below are drawn on the same 2-layer Core × N-pass grid (in Inkling 2 Mini, the 2 core rows correspond to its two 6-layer Core blocks B2 and B3). Click through the five designs and hover (or click to pin) any block in Pass 2 or Pass N-1:
Our Proposal: Maintaining State S Across Passes
Look at why Inkling 2 Mini and InfiLoop complement each other:
- Inkling 2 Mini recognizes that Attention (where to look) and MLP / MoE (local token deduction) need separate cross-pass gates, but its
bankonly stores the single previous passp-1. - InfiLoop [6] keeps a running memory across all passes
0 .. p-1in constant space, but collapses everything into1vector and adds new candidates (+ w(z) * z) without checking what memory already holds.
We combine the strengths of both using a per-token state matrix S updated by the delta rule [9]. First, here is the high-level M × N loop structure when S sits purely between passes (our starting prototype):
# B = batch, T = tokens (81 squares), D = hidden size (512), dk = state rows (8)
# M = shared layers (2), N_passes = loop iterations (12 in train -> 160 in test)
def state_read(x, S, W_q):
"""Read a [B, T, D] vector from per-token state matrix S [B, T, dk, D]."""
q = F.normalize(rms_norm(x) @ W_q.T, p=2, dim=-1) # [B, T, dk]
return torch.einsum('btk,btkd->btd', q, S) # [B, T, D]
def state_delta_write(v, S, cell):
"""Update S [B, T, dk, D] by writing ONLY the difference (v - k @ S)."""
vn = rms_norm(v) # [B, T, D]
k = F.normalize(vn @ cell.W_k.T, p=2, dim=-1) # [B, T, dk]
alpha = torch.sigmoid(vn @ cell.W_a.T + cell.alpha_bias) # [B, T, dk] retention
beta = torch.sigmoid(vn @ cell.w_b.T + cell.beta_bias) # [B, T, 1] step size
S = alpha.unsqueeze(-1) * S # [B, T, dk, D]
pred = torch.einsum('btk,btkd->btd', k, S) # [B, T, D] what S holds at key k
err = v - pred # [B, T, D] 0 when v matches pred!
S = S + beta.unsqueeze(-1) * torch.einsum('btk,btd->btkd', k, err)
return S
def forward_pass_level(tokens, N_passes):
x0 = tok_emb(tokens) # [B, T, D] original input clues
h = x0
S = torch.zeros(B, T, dk, D, dtype=torch.float32) # [B, T, dk, D]
for p in range(N_passes):
x = h + x0 # [B, T, D] re-inject input clues
for m in range(M): # plain M-layer Transformer vertically
x = rms_norm(x + layers[m].softmax_attn(x))
x = rms_norm(x + layers[m].mlp(x))
S = state_delta_write(x, S, cell) # update S at end of pass
h = (1 - g) * x + g * state_read(x, S, cell.W_q)
return lm_head(h)As our ablations below will show, updating a single shared S only at the end of the pass (A1 above) is not enough: x mixes Attention and MLP outputs into the same matrix, causing interference. Splitting S into S_attn + S_mlp and moving the write-then-read step inside every layer (A3) turns the loop into a much stronger reasoning core in 15 lines:
def delta_step(v, S, cell):
"""Write-then-read on S_attn or S_mlp in float32.
v: [B, T, D] layer output (a_out or m_out)
S: [B, T, dk, D] per-token state matrix (S_attn or S_mlp)
"""
vn = rms_norm(v) # [B, T, D]
k = F.normalize(vn @ cell.W_k.T, p=2, dim=-1) # [B, T, dk]
q = F.normalize(vn @ cell.W_q.T, p=2, dim=-1) # [B, T, dk]
alpha = torch.sigmoid(vn @ cell.W_a.T + cell.alpha_bias) # [B, T, dk]
S = alpha.unsqueeze(-1) * S # [B, T, dk, D]
pred = torch.einsum('btk,btkd->btd', k, S) # [B, T, D]
err = v - pred # [B, T, D]
beta = torch.sigmoid(vn @ cell.w_b.T + cell.beta_bias) # [B, T, 1]
S = S + beta.unsqueeze(-1) * torch.einsum('btk,btd->btkd', k, err) # write outer(k, err)
o = torch.einsum('btk,btkd->btd', q, S) # read q @ S
g = torch.sigmoid(vn @ cell.w_g.T + cell.g_bias) # [B, T, 1]
return (1.0 - g) * v + g * o, S
# Full M x N forward pass (A3: Per-Layer S_attn + S_mlp):
S_attn = torch.zeros(B, T, dk, D, dtype=torch.float32)
S_mlp = torch.zeros(B, T, dk, D, dtype=torch.float32)
for p in range(N_passes):
x = h + x0
for m in range(M):
a_out = layers[m].softmax_attn(x) # [B, T, D] token-to-token attention
u_attn, S_attn = delta_step(a_out, S_attn, attn_cell) # [B, T, D] update & read S_attn
x = rms_norm(x + u_attn)
m_out = layers[m].mlp(x) # [B, T, D] per-token MLP
u_mlp, S_mlp = delta_step(m_out, S_mlp, mlp_cell) # [B, T, D] update & read S_mlp
x = rms_norm(x + u_mlp)
h = xWhy does err = v - pred stop latent overthinking? Because once a token settles on an answer, its layer output v matches what S already predicts (pred = k @ S), so err = v - pred shrinks to 0 automatically and later passes leave S alone.
How State S Differs from MeSH
At first glance, MeSH (Memory-as-State-Highways) [12] also keeps a [K, D] buffer per token across loop passes. Why does MeSH drop to 16.31% at 160 segments on Sudoku-Extreme while our state S (A3) reaches 42.63%?
Compare the two update rules side by side:
# --- MeSH (Yu et al., ICLR 2026) ---
# M: [B, T, K, D] updated once per pass with step-indexed routers
r = min(p, N_train - 1) # p >= N_train has NO trained router!
ww = F.softmax(rms_norm(h) @ W_write[r].T, dim=-1) # [B, T, K]
M = M + ww.unsqueeze(-1) * h.unsqueeze(-2) # purely ADDITIVE: never subtracts old errors!
wr = F.softmax(rms_norm(h) @ W_read[r].T, dim=-1) # [B, T, K]
out = rms_norm(torch.einsum('btk,btkd->btd', wr, M))
# --- Ours (Per-Layer State S, A3) ---
# S_attn, S_mlp: [B, T, dk, D] updated at EVERY layer with shared weights
k = F.normalize(rms_norm(v) @ W_k.T, p=2, dim=-1) # shared W_k works at pass 12 or pass 160
S = alpha.unsqueeze(-1) * S # decays old rows cleanly
pred = torch.einsum('btk,btkd->btd', k, S) # checks what S already holds at key k
S = S + beta.unsqueeze(-1) * torch.einsum('btk,btd->btkd', k, v - pred) # writes ONLY (v - pred)Four specific differences separate them:
- Shared weights vs. step-indexed weights (
W[p]):MeSHtrains a separate routerW_write[p], W_read[p]for each loop stepp = 0 .. N_train - 1. PastN_train = 12(out atp = 160),MeSHhas no trained routers for those steps and must clampr = 11. OurW_k, W_q, W_a, w_bare shared across all passes and route purely by content, so Pass160works the exact same way as Pass2. - Delta overwrite (
v - k @ S) vs. blind addition (M + w * h):MeSHonly adds intoMand never erases. Over160segments,Mgrows10.2×in L2 drift (0.59 → 6.04) and loses−4.85%of individual squares (72.49% → 67.64%). Our update subtractspred = k @ Sfirst: wrong early guesses get overwritten, and finished squares (v == pred) receive a0update. - Separate
S_attnandS_mlpvs. one shared buffer:MeSHwrites the combined end-of-pass vector into one bufferM. SplittingSintoS_attn+S_mlpalone adds+20.4points in our ablation (A1 → A2). - Every layer vs. end of pass:
MeSHupdates once between passes; updating inside every layer soLayer 1immediately readsLayer 0’s write adds another+16.9points (A2 → A3).
Experimental Setup and FLOP Budget
Methodology and Dataset (Sudoku-Extreme)
We use the exact training setup and codebase from InfiLoop [6] on Sudoku-Extreme [7]:
- Why Sudoku-Extreme fits looped reasoning: each
9×9board is a sequence of81tokens (clues'1'..'9'or blank'_'), and the model predicts'1'..'9'for all81squares at once. Every board contains a mix of easy squares (7–8neighbors already given, solvable on Pass 1) and hard squares (needing20–40chained eliminations across rows, columns, and3×3boxes). - Controlled training: every method uses the exact same
2-layer Transformer backbone (D = 512,H = 8heads,6.8Mparameters, identical random seed991231), trained on1,000base puzzles (1Msymmetry-augmented boards,batch = 384,14,400steps) with12loop segments (504layer visits). - Test-time depth rollout (
2,048unseen boards): we run a single forward pass per board from1segment (0.08×training depth) out to160segments (13.3×training depth =6,720layer visits) and track three metrics [8]:- Exact Board %: percentage of
2,048puzzles with all81 / 81squares solved. Lost@160↓ (Overthinking): out of puzzles already solved at12segments (1×), what%break when looped to160segments.Gained@160↑ (Extra Reasoning): out of puzzles still unsolved at12segments (1×), what%get newly solved by looping to160segments.
- Exact Board %: percentage of
Counting Matrix-Multiply FLOPs per Pass
To compare methods fairly under a compute budget, we count all matrix-multiply operations (1 multiply-add = 2 FLOPs) for one call of our M = 2-layer block (D = 512, T = 97 tokens including 16 prefix tokens, SwiGLU width 3D = 1536, dk = 8):
- Attention matmuls (
2layers):qkv,QK^T,PV,W_o=16·D² + 8·T·D=4.59MFLOPs / token - MLP matmuls (
2layers):gate_upanddown=36·D²=9.44MFLOPs / token - Shared backbone total:
52·D² + 8·T·D=14.01MFLOPs / token / call (28.54 GFLOPs/ puzzle / segment)
Adding the matrix ops inside each cross-pass state update (W_k, W_q, W_a, k @ S, outer(k, err), q @ S):
| Method | State kept / token | Loop-update FLOPs / token | Total FLOPs / token / call | Total over R calls |
|---|---|---|---|---|
carry_last [5] |
512 nums (D) |
0 |
14.01M (1.00×) |
O(R) |
infiloop (B0) [6] |
513 nums (D + 1) |
3.6K |
14.02M (1.00×) |
O(R) |
full_attn (attend all r calls) |
r · 512 (grows!) |
~2·r·D (grows!) |
17.45M @ r=3360 (1.25×) |
O(R²) |
gd_single_pass (A1) |
4,096 nums (8·D) |
55.3K |
14.07M (1.004×) |
O(R) |
gd_dual_pass (A2) |
8,192 nums (2·8·D) |
110.6K |
14.12M (1.008×) |
O(R) |
gd_dual_layer (A3, Ours) |
8,192 nums (2·8·D) |
274.4K |
14.28M (1.019×) |
O(R) |
gd_dual_layer_pred (A4) |
8,192 nums (2·8·D) |
278.5K |
14.29M (1.020×) |
O(R) |
Nearly 98% of all FLOPs sit in the shared Attention and MLP layers. Even updating both S_attn and S_mlp inside every layer (A3) adds only +1.9% FLOPs per pass (29.09 vs 28.55 GFLOPs per segment).
Ablation Results
Hover across the chart below to compare methods at any test-time FLOP budget (29 GFLOPs to 4.6 TFLOPs per puzzle), or switch tabs to inspect overthinking (Lost@R), newly solved puzzles (Gained@R), and GPU state memory:
1. Accuracy Under Matched FLOP Budgets
Because A3 (29.09 GFLOPs/seg) and B0: InfiLoop (28.55 GFLOPs/seg) spend almost identical FLOPs per segment, comparing them across compute budgets shows how much better information flow buys per FLOP:
| Test Compute Budget / Puzzle | Loop Segments | B0: InfiLoop [6] |
A2: Pass-End S_attn + S_mlp |
A3: Per-Layer S_attn + S_mlp (Ours) |
|---|---|---|---|---|
~58 GFLOPs |
2 (0.17×) |
2.59% |
2.88% |
13.62% |
~116 GFLOPs |
4 (0.33×) |
10.69% |
13.82% |
33.64% |
~345 GFLOPs (train budget) |
12 (1.0×) |
20.07% |
23.49% |
40.38% |
~1,390 GFLOPs |
48 (4.0×) |
21.53% |
25.54% |
42.43% |
~4,600 GFLOPs |
160 (13.3×) |
21.04% (drops) |
25.73% |
42.63% |
At 116 GFLOPs (4 segments), A3 already solves 33.64% of unseen boards — +12.6 percentage points higher than InfiLoop even when InfiLoop spends 4,568 GFLOPs (39× more FLOPs). And as we scale compute from 345 GFLOPs to 4,650 GFLOPs, InfiLoop peaks early and drops back down, whereas A3 climbs at every single checkpoint (40.38% → 42.63%).
2. Controlled 5-Arm State-Flow Ablation (B0 → A4)
To see which design choice drives the gain, each row below changes one piece at a time on the exact same 6.8M backbone (float32 state S, dk = 8, 14,400 training steps):
| Arm | Cross-Pass State | S Split |
Where S Updates |
beta Gate |
1× (12) |
4× (48) |
13.3× (160) |
Lost@160 ↓ |
Gained@160 ↑ |
Cell@160 |
|---|---|---|---|---|---|---|---|---|---|---|
| B0 | infiloop [6] |
1 running-avg vector | End of pass | w(v) only |
20.07% |
21.53% |
21.04% |
3.41% |
2.08% |
65.24% |
| A1 | gd_single_pass |
1 shared S [8, D] |
End of pass | sigmoid(vn @ w_b) |
18.31% |
8.30% |
5.32% |
70.93% |
0.00% |
72.92% |
| A2 | gd_dual_pass |
S_attn + S_mlp |
End of pass | sigmoid(vn @ w_b) |
23.49% |
25.54% |
25.73% |
0.83% |
3.19% |
75.82% |
| A3 | gd_dual_layer |
S_attn + S_mlp |
Every layer | sigmoid(vn @ w_b) |
40.38% | 42.43% | 42.63% | 0.00% | 3.77% | 80.89% |
| A4 | gd_dual_layer_pred |
S_attn + S_mlp |
Every layer | sigmoid(vn@w_b − pn@w_p) |
37.65% |
38.92% |
39.11% |
0.00% | 2.35% |
80.18% |
What each step teaches us:
B0(InfiLoop,21.04%): Solves20.07%at training depth, peaks at36segments (21.68%), and then loses3.41%of its solved boards by segment160while individual square accuracy drops−9.06%(74.30% → 65.24%).A1(1sharedSat pass end,5.32%— a useful failure): Writing the end-of-pass hidden vectorxinto a singleSoutside the residual block fails at high loop counts. Attention routing updates and MLP digit updates overwrite the same subspace insideS, flipping1–2squares per board (Cell@160stays72.92%, while81/81exact solve drops to5.32%).A1 → A2(SeparateS_attnandS_mlp,5.32% → 25.73%): Giving Attention and MLP their ownSmatrices inside the residual stream — still updated only once per pass — fixes the collision (+20.41points overA1,+4.69points overB0, and4×lowerLost@160).A2 → A3(UpdateSinside every layer,25.73% → 42.63%,0extra parameters):A3has the exact same parameter count asA2(6,885,416params) and+1.1%FLOPs, yet jumps+16.90points and reachesLost@160 = 0.00%. WhenLayer 0writes intoS_attn, S_mlp,Layer 1immediately reads that updated memory inside the same pass instead of waiting for the next pass.A3 → A4(Testing an explicit- pred @ w_pbrake insidebeta,39.11%vs42.63%): We also tested subtractingrms_norm(pred) @ w_pinsidebetaso high confidence inpredwould forcebeta -> 0. On a tiny150-step4×4Sudoku sanity test,A4beatA3(65.6%vs46.9%). On full14,400-step9×9training, however,A3already achievesLost@160 = 0.00%becauseerr = v - k @ Snaturally goes to zero whenvagrees withS. Adding a second brake insidebeta(A4) keepsLost@160 = 0.00%too, but makes late multi-step updates slightly too cautious (Gained@160 = 2.35%vs3.77%). The simpler delta rule wins.
3. Earlier 7-Method Baseline Survey & Precision Lesson
Before running the controlled B0–A4 ladder above, we ran a broad 7-method baseline survey (click 7-Method Baseline Survey in the chart above):
| Baseline Method | State per Token | 1× (12) |
4× (48) |
13.3× (160) |
Lost@160 ↓ |
Gained@160 ↑ |
|---|---|---|---|---|---|---|
last_lookup (recursive 1-slot delta) |
[1, D] |
23.14% | 27.00% | 27.20% | 0.42% | 5.40% |
kda_loop (v1) (8-slot bfloat16 delta) |
[8, D] |
19.43% |
20.90% |
20.85% |
0.50% | 1.88% |
carry_last [5] |
[1, D] |
18.46% |
20.70% |
20.85% |
0.00% |
2.93% |
infiloop [6] |
[1, D] |
20.21% |
21.24% |
20.61% |
7.73% |
2.45% |
loom_ema (uniform running average) |
[1, D] |
21.04% |
20.61% |
20.41% |
8.12% |
1.36% |
window_8 (8-pass sliding window) |
[8, D] |
11.33% |
15.87% |
16.89% |
0.00% |
6.28% |
mesh [12] |
[8, D] |
16.89% |
16.60% |
16.31% |
4.05% |
0.12% |
That first sweep taught us a critical implementation lesson that unlocked A3:
- Never keep loop state
Sinbfloat16. Inkda_loop (v1),Swas stored inbfloat16, where the gap between numbers near1.0is2^-7 ≈ 0.0078. Whenever a gated stepbeta * errwas smaller than0.004,bfloat16addition roundedS + stepright back toS— freezing66%–97%ofScoordinates. KeepingSinfloat32(torch.autocast(..., enabled=False)) costs just+305 MBof GPU memory and lets small multi-pass refinements accumulate cleanly across6,720layer visits.