Asked to solve mazes, Claude Opus 5.5 got 26 percent. Asked to hand-write a transformer that solves them, 100
MBZUAI researchers had an LLM set all 19,936 weights of a looped transformer by hand, with no training. The repo ships the weights, a numpy runner and the prompts.
Researchers at MBZUAI gave Claude Opus 5.5 hard 30x30 mazes and report that it found the shortest path on 26 percent of the ones it was given. Then they changed the request: write the weights of a transformer that solves them. According to the LoopedWSP repo, the model set all 19,936 weights by hand in one Claude Code session, with no training, and the result solves every test maze.
The author list is Abdelrahman Elsayed, Ahmed Heakl, Abdelrahman Shaker, Fahad Khan, Salman Khan and Claude Opus 5.5.
How it works
The approach builds on Weight-Space Programming, earlier work from MIT CSAIL that the README credits. The LLM writes a network’s weights directly, where normally training would find them.
The addition is the loop. The transformer is a single block applied over and over to its own output, and each pass advances a shortest-path search by one step. On the first test maze, the README says, a wave of distances spreads from the goal one cell per loop, reaches the start after 111 loops, and the path is then traced back until loop 222.
A bigger maze needs more passes, not more weights. The authors report that the same weights solve all the 60x60 and 100x100 mazes they generated, although the model had only checked its work up to 45x45. A separate session given a cap of 1,000 weights produced a version with 928, and the README says trained models such as LDT and EBR use about 1,900 times more than that.
The numbers, and whose they are
All figures are the authors’, from the README. The maze transformer took 39 minutes and about $19 in tokens.
On Maze-Hard the best trained model they cite, LDT, reaches 99.8 percent. In the authors’ own training runs on one H200 GPU the best result was 93.5 percent. The odd one is this: they reset the hand-written architecture to random weights and trained it on the same 1,000 mazes, and every run scored 0 percent.
Eight more tasks got the same treatment and the README reports 100 percent on each: 141,040 Sudoku-Extreme puzzles, a 20-disk Tower of Hanoi played out over 1,048,575 moves by a 3,686-weight block, and GraphWalks prompts of up to a million tokens, where Opus 5.5 answering directly scored 66.8 percent and Gemini 4 Carbon 96.2.
A caution of our own: each of these tasks has a known exact algorithm. This shows a model can write one down as weights, not that the trick works where nobody knows the algorithm.
Try it yourself
The repo is MIT-licensed, weights and prompts included. The weights/ folder has ten of the transformers and a run.py that needs only Python 3 and numpy: python run.py maze --random 30 or python run.py hanoi 10. The prompts folder holds the first message of each session, not the later ones.
We have not run the weights. The accompanying blog post was not reachable from our build machine, so this is based on the repo’s READMEs alone.
Disclosure: Claude, an Anthropic model, helps write this site.