An AI model wrote the complete set of weights for a small transformer by hand in 39 minutes, and the result solves every maze, Sudoku puzzle, and Tower of Hanoi challenge thrown at it without a single training run. The GitHub project mbzuai-oryx/LoopedWSP, published this week by researchers at Mohamed bin Zayed University of Artificial Intelligence, shows that a large language model can act as a programmer of neural networks rather than just a user of them.
What the Project Is
Looped Weight-Space Programming is a method where an LLM — in this case Anthropic’s Claude Opus 5.5 — writes the numerical weights of a transformer directly, the way a human might hand-code a sorting algorithm. The transformer is a single block designed to run in a loop. Each pass through the block advances a computation by one step: one cell further in a maze search, one move in a puzzle solution, one inference step in a graph walk. The weights never change after the LLM writes them. There is no gradient descent, no backpropagation, no training data in the usual sense. The repository, released under an MIT license, contains the weights for ten transformers, the exact prompts given to Claude, and a run.py script that executes any of them with only Python 3 and NumPy installed.
How It Works
The idea builds on Weight-Space Programming, introduced by MIT CSAIL researchers Takehi, Teoh, Zhang, and Khattab in 2026. In the LoopedWSP approach, the LLM receives a natural-language description of the algorithmic task — find the shortest path, solve a Sudoku, execute the recursive Tower of Hanoi procedure — and returns a complete weight matrix for a transformer block. That block is then executed repeatedly, or “looped,” until the problem is solved. Because the transformer implements the algorithm in its weights, a larger maze simply requires more loops, not more parameters. The same 19,936-weight maze transformer that was checked on mazes up to 45×45 goes on to solve 100% of generated 60×60 and 100×100 mazes. A version constrained to 1,000 weights used only 928 and still achieved perfect accuracy on the test set.

The Numbers Behind the Claims
On the Maze-Hard benchmark, where shortest paths exceed 110 steps, Claude Opus 5.5 answering directly in text solved 26% of test mazes. The hand-written transformer solved 100%. When the researchers reset those same weights to random values and trained the architecture on the same 1,000 training mazes using gradient descent on an H200 GPU, every run solved 0% of the test mazes. The best published trained model for the task, EBR, reaches 93.5% with roughly 1,900 times more parameters.
For Sudoku-Extreme, the transformer solved all 141,040 test puzzles, using an internal guess-and-backtrack strategy encoded in its fixed weights. By comparison, Claude 3.7 Sonnet (thinking) and DeepSeek-R1 drop to 0% success by 11 disks. On GraphWalks, the transformer processes prompts up to 1 million tokens and scores 100%, versus 66.8% for Claude Opus 5.5 itself.
What This Means for the Field
The results suggest that for certain classes of algorithmic reasoning — problems with clear procedural structure and verifiable solutions — an LLM can be a more effective “compiler” of neural weights than gradient descent. The cost of the maze transformer was about $19 in API tokens and 39 minutes of a single Claude Code session. The repository is designed for reproducibility: every prompt is preserved verbatim in the prompts/ folder, every weight matrix in weights/, and the run.py script lets anyone verify the 100% scores on their own machine. The authors cite the HRM paper for Maze-Hard and Sudoku-Extreme, BIG-Bench Hard and Extra Hard from Suzgun et al. and Kazemi et al., and The Illusion of Thinking (Shojaee et al., 2025) for Tower of Hanoi and Checker Jumping.
Who It Is For
The project targets researchers studying the intersection of LLMs and neural network initialization, educators demonstrating algorithmic reasoning in fixed-weight transformers, and developers exploring alternatives to gradient-based training for structured tasks. Because the code runs on a laptop with no GPUs, no deep-learning frameworks, and no training pipeline, it lowers the barrier to experimenting with transformer internals. The MIT license permits commercial and academic use without restriction.
Sources
Photo: Wikideas1 (CC0)




