Earlier this month, MBZUAI released LoopedWSP: 29 transformers whose weights were written analytically by Claude Opus with zero gradient descent. No training data and no optimizer, just standard attention and ReLU layers. The smallest maze solver uses 928 weights; four newer ones play chess up to 3,009 Elo with 161,000 active parameters.

Hand-compiled neural networks are easy to distrust. They often hide oversized constants that break in float32, hardcoded input shapes, or margins too thin to survive a gradient step. I cloned all 29 networks to see how a looped transformer computes, re-ran every audit in NumPy and PyTorch, and built two circuits of my own.

How a looped transformer computes

A standard transformer stacks \(L\) different blocks in depth, so deeper work costs more weights. A looped transformer keeps one small block and feeds its output back into itself \(R\) times (the same idea behind Inkling 2 Mini, stretched from three passes to hundreds).

Each loop acts like one clock cycle. Residual channels serve as named registers, attention reads from neighbors, and the ReLU layer updates local state. Press Play below to watch LoopedWSP’s 33-nonzero parity circuit walk a running XOR across an editable bit string, or open the 4-head maze solver to watch BFS expand from the goal and trace back from the start.

Inside a looped transformer. Tab 1 runs LoopedWSP's exact 33-nonzero parity weights in JavaScript — drag to orbit, morph between Looped (1×6) and Standard (6×), or flip input bits live. Tab 2 renders maze_core_19k as a 3D voxel labyrinth; drag to orbit and click open tiles to probe the four compass heads.

In parity, one head scores position \(j\) from position \(i\) via \(-50\bigl(j - (i-1)\bigr)^2\), copying left-neighbor parity c2 into scratch register c3; eight ReLUs compute c1 ⊕ c3 and clear c3, shifting the answer one token right per loop. In maze_core_19k, four heads point straight down, left, right, and up. One loop advances the BFS wave by one step, and after reaching S the shortest path traces back until the state locks onto a fixed point at loop 224 (unchanged out to loop 900).

The 2²⁴ float32 wall

I audited all 29 weight files and ran all 25 algorithmic models end-to-end in float64 and native float32, including sudoku_extreme (verified to 10,000 loops in PyTorch) and five real google-deepmind/bbeh prompts each for web_of_lies and shuffled_objects, plus a 5-loop sparse check on 471M-parameter chess_v16.

All 29 LoopedWSP networks plus our two constructions. Hover any dot in the 2²⁴ Float32 Wall to inspect its exact 32-bit IEEE-754 bit strip below, check binary-searched limits in Exact Mantissa Floors, or sort all 31 rows.

A 32-bit float has 24 mantissa bits; past \(2^{24} = 16{,}777{,}216\), the gap between representable floats (ULP) jumps to 2 and odd integers vanish. Every tested network below \(2^{24}\) passes native float32 (20 of 20 algorithmic models, and chess_v16 drifts by just \(2.8\times 10^{-13}\)). Above \(2^{24}\), four of five fail: clrs_mst_prim (\(2.0\times 10^{10}\)), web_of_lies (0 of 5 on BBEH), shuffled_objects (passes 200-token toys yet fails 0 of 5 on full 3,000-token BBEH prompts), and maze_size_1k (outputs zero path cells). Only dyck_languages survives because its huge weights sit in unused tail positions.

Switch to Exact Mantissa Floors to see each circuit’s binary-searched limit: maze_core_19k stays exact down to 9 bits (below FP16), while maze_size_1k requires 38 bits.

Exact zeros are wire insulation

Almost every parameter across the 29 models is an exact 0.0, reaching 99.97% on chess_v16 (160,878 active weights inside 470.6 million). Those zeros are wire insulation. When one residual channel carries \(i^2\) up to 16.8 million beside a 1-volt logic bit, exact zeros in the weight matrices keep high-voltage wires from shorting into logic neurons on every pass.

To test that causally, I compared adding noise only to exact zeros (active weights frozen) against perturbing only active nonzeros (exact zeros intact).

Exact zeros as circuit insulation. Left: high-voltage c5 (i²) rail crossing parity's 6×8 W₁ dielectric shield (toggle Puncture Zeros vs. Jitter Active and scrub σ below). Right: causal accuracy sweep and compounding Loop-by-Loop Drift.

Puncturing only the exact zeros kills circuits 100× to 1,000× earlier than jittering the active weights. In Loop-by-Loop Drift on chains at \(\sigma = 10^{-6}\), noise inside the zeros compounds across 17 loops to a deviation of 37.0 versus 0.051 for active-only noise (a 727× gap, and 6,400× on graph).

Why Adam rejects these weights

To see why gradient descent neither finds nor keeps hand-written solutions \(W^{\star}\), I ported parity to PyTorch (0.0 logit difference from NumPy) and ran exact backpropagation through all 16 loops.

PyTorch BPTT around W*. Tab 1: drag-to-orbit real 29×29 loss canyon around W* with live Adam replay and OOD length bars (16 → 64 bits). Switch tabs for 3D Gradient Skyscrapers (|∂L/∂W₁|) and the Recovery Basin.

Three findings stand out. First, in Gradient Anatomy, 99.995% of squared gradient energy at \(W^{\star}\) hits exact zeros (norm 64.5 versus 0.45 on all 33 active weights combined) because the \(i^2\) wire sits beside active XOR neurons in W1.

Second, Adam’s adaptive normalization turns even tiny loss into collapse. Scaling W_out by 10× drops cross-entropy to 0.0000, yet dense Adam still crashes accuracy from 100% to 55% because dividing by \(\sqrt{\hat{v}}\) blows any tiny nonzero gradient into a full step through the zero wall. Lowering the learning rate to \(10^{-4}\) hides the damage on 16-bit strings (100%), until you test 32 bits: the 0.028 leak into W1’s zeros gets multiplied by a 4× larger \(i^2\) and accuracy collapses to 48%.

Third, freeze the 139 zeros and Adam improves smoothly, cutting loss from 0.313 to 0.048 while holding 100% accuracy across 16, 32, and 64 bits. In Recovery Basin, masked Adam even heals damaged active weights from 82% back to 100% at \(\sigma = 0.001\) before the basin vanishes at \(\sigma = 0.002\). From random weights, a wide 8,642-parameter Pre-LN looped transformer trained with AdamW never clears 67% on 4-bit strings.

Shortcuts, clocks, and rescuing the 928-weight maze

To check whether the six maze models run real BFS or memorized 30×30 shortcuts, I tested three random mazes at each of seven sizes (10×10 to 40×40) plus open_room (\(1.9\times 10^{15}\) tied paths), unsolvable, and snake_405 (a 404-step corridor).

Float32 surgical rescue, 7-size generalization matrix, and snake loop budget. Step through the four rescue stages and scrub the live Math.fround() trapezoid, inspect the generalization matrix, or compare snake_405 at 1,415 vs. 1,850 loops.

In the Generalization tab, maze_core_19k solves all 21 mazes from 10×10 to 40×40, and every model handles ties and unsolvable grids cleanly. maze_size_10k looks stuck on 30×30 until you toggle Mask \n: it solves 12 of 12 smaller grids, and only its newline readout breaks off 30 columns. On snake_405, maze_size_1k stops at 67 of 403 cells only because its 1,415-loop budget spends 945 loops booting coordinates and 403 on BFS; raising \(R\) to 1,850 with zero weight edits solves all 403 cells.

Fixing maze_size_1k in native float32 revealed two stacked traps. First, a boot-up bias of −30,998,529 exceeds \(2^{24}\) (ULP = 2), so traceback never starts (0 of 20 mazes). Shrinking that gate 16× fixes boot-up, yet Fix 1 only starts traceback on loop 1057 (o = 1) and freezes forever. Near bias 64,576 (ULP = 1/256), decimal trapezoid knots ±0.4 and ±0.6 round off-grid, lifting the plateau from 1.000000 to 1.015625 (+1/64), which a 1000× gate blows into +15.625 one loop later.

Swapping in binary fractions ±0.25 and ±0.75 (with W2 = ±2) lands every knot on the 1/256 grid and drops the mantissa floor from 38 bits to 20 bits. Trimming two unused hash rows yields maze_904_fp32 (spec-compatible), and removing the unused empty-string logit yields maze_891_fp32 (891 dense, 135 nonzero). Both solve 20 of 20 test mazes plus open_room, unsolvable, and snake_405 (\(R = 1{,}850\)) in native NumPy and PyTorch float32.

Game of Life in 338 weights

Applying those rules from scratch, I wrote a 1-layer, 1-head looped transformer (338 core weights, 42 nonzero, \(d = 10\)) that runs exact Conway’s Game of Life on a 16×16 torus, one generation per loop.

Live 338-weight Conway's Game of Life transformer. Executes the unmodified matrices in JavaScript on a drag-to-orbit 3D torus and checks all 256 cells every loop against exact Life. Click tiles to inspect the wrapping 3×3 Moore kernel, or switch to Flat 16×16 / Draw to paint.

Each cell embeds eight toroidal harmonics plus its alive bit \(a_i \in \{0,1\}\). Attention scores row and column offset \(\Delta\) with a flat-topped cosine kernel,

\[f(\Delta) = \Bigl(1 + \cos\tfrac{2\pi}{H}\Bigr)\cos\tfrac{2\pi\Delta}{H} - \tfrac{1}{2}\cos\tfrac{4\pi\Delta}{H},\]

which ties on \(\Delta \in \{-1, 0, +1\}\) and drops strictly below for \(\lvert\Delta\rvert \ge 2\). Softmax averages the 3×3 Moore neighborhood into channel 9, and four ReLUs apply a dyadic trapezoid over \(u_i = 9s_i - \tfrac{1}{2}a_i \in [2.375, 3.625]\) to snap channel 8 back to 0 or 1.

Because every threshold is a binary fraction and \(\max\lvert w\rvert = 32.07\), the live matrices stay exact across FP64, FP32, FP16, and 50 chaotic generations of R-pentomino in 8-bit BF16. Switch to 10-bit clip or Zero leak to watch rounding and cross-channel leakage corrupt the board live.

Hand-written looped transformers turn out to be real, compact digital machines rather than fragile 64-bit curiosities. Twenty of twenty models below \(2^{24}\) pass native float32, maze_core_19k survives 9-bit mantissas, and 338 weights run a Turing-complete automaton in BF16 right inside a browser tab. What still separates them from learned networks is the zero-wall barrier: clean algorithmic circuits depend on sharp isolation between wires, while standard optimizers smear updates across every coordinate. Finding optimizers or routing priors that can discover isolated circuits on their own remains open.

Reproducibility & experimental methodology

All 29 models from mbzuai-oryx/LoopedWSP (10 core, 15 algorithmic more_networks, 4 chess models chess_v13–chess_v16) were audited in NumPy 2.4.6 and PyTorch 2.12.0. All 25 algorithmic models ran end-to-end (web_of_lies and shuffled_objects on 5 real google-deepmind/bbeh tasks each; sudoku_extreme verified to 10,000 loops in PyTorch float32; chess_v16 checked across 5 sparse loops, rel_l2_diff = 2.84e-13). Mantissa floors were binary-searched over bits 5–53 via IEEE-754 uint64 bit-masking (gol_338_core is exact down to 11 bits monotonically and also at 8-bit BF16).

PyTorch BPTT matched LoopedWSP’s NumPy parity logits to 0.000e+00. Maze generalization tested 3 random mazes per size across 7 sizes plus open_room, unsolvable, and snake_405. Float32 rescue was validated across 20 diverse 30×30 mazes in PyTorch float32 (with 5-maze NumPy float32 cross-check) plus open_room, unsolvable, and snake_405 at R = 1,850. Scripts live in _tools/looped-wsp/ and compile to assets/data/looped-wsp/data.json.