Looped Weight-Space Programming: Claude Writes Weights

Looped weight-space programming: a small looped transformer written by an LLM solving a maze

A research team has had an AI model skip training altogether and write a neural network by hand. The technique, called looped weight-space programming, produced a maze solver that got every test maze right, using Claude Opus 5.5 for 39 minutes at a cost of $19.

The maze experiment

The researchers began with a plain test. Given hard mazes, Claude Opus 5.5 found the correct answer only 26% of the time. So they changed the job. Instead of solving mazes, the model had to author a transformer that does it, choosing the value of each weight directly.

The program it wrote is a looped transformer. A single small block repeats, and every repetition pushes a shortest-path search forward by one step. Claude checked it only on mazes up to 45×45. Even so, the finished weights cleared every 100×100 maze in the test set.

The idea extends earlier Weight-Space Programming work from Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab. That research showed language models can read and modify the weights of a network. The new question is bigger: can a model produce weights for a complete algorithm that gets reused across inputs?

Training could not match it

The team ran a fair comparison. They took the same architecture, started from random weights and trained it on the same mazes. It solved none of them. The strongest trained system they compared against, Energy-Based Reasoners, reached 93.5%.

Next came a size limit of under 1,000 weights. Claude produced a 928-weight maze transformer that still handled every test maze. The best trained model on the Maze-Hard benchmark, LDT, is roughly 1,900 times larger.

Tower of Hanoi at 20 disks

Tower of Hanoi was the second puzzle. Reasoning models are known to break down around 7 or 8 disks. Claude spent 27 minutes and about $5 writing a transformer of 3,686 weights. That network plays out all 1,048,575 moves of the 20-disk version with no errors, which means a single tiny block runs about two million times.

The authors say the same method scored 100% on each test set they evaluated for these tasks:

  • Sudoku-Extreme
  • GraphWalks, with prompts of 1M tokens
  • two BIG-Bench Extra Hard tasks

Weights you can read

For the researchers, the best part is transparency. A trained network is normally opaque. Here, every weight was placed on purpose to carry out one piece of the algorithm. Anyone can look at the intermediate states, follow each step and see how the network reaches its answer.

They checked this by handing only the weights to a new Claude session. It reconstructed the entire algorithm in around 2 minutes, which suggests another model can audit these programs quickly.

Why the cost figures matter

Two prices stand out in the thread: $19 for the maze solver and about $5 for the Tower of Hanoi network. Training a model on these tasks involves repeated runs and tuning, while here a single session with the model produced a finished program. The authors also describe the result as inspectable from the start, since each step of the algorithm maps to specific weights. A team that wants to verify what a network does could read it directly, rather than probing it from outside.

How to read the claims

All figures here come from the authors’ own social media thread. The thread gives no detail about how each benchmark was set up, and the results have not been independently reproduced. The tasks also share a trait: each follows a clear, repeatable procedure. Puzzles like mazes, Sudoku and Hanoi can be turned into a small loop, which may not hold for open-ended work.

Within that scope, the contrast is hard to ignore. On these problems, a model that wrote weights beat training from scratch by a wide margin, for a bill of a few dollars per program. The authors also asked Yann LeCun for his view on writing weights versus learning them.

What the team tackles next

After mazes, the team moved to Tower of Hanoi, then reported Sudoku, long-prompt graph tasks and BIG-Bench Extra Hard. No code release or follow-up schedule was announced. The open question for looped weight-space programming is how far it reaches past tasks with a clean, step-by-step structure, and whether other models can repeat Claude’s results.

Source: X (formerly Twitter)

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.