AIFeed

Looped Weight-Space Programming: use AI to set model weights

Original text(via HN AI)

Post

Ahmed Heakl on X: "Today we introduce Looped Weight-Space Programming! 🚀 We asked Claude Opus 5.5 to solve hard mazes. It got only 26% right. Then we asked it to write a transformer that solves them, setting every weight directly. It took just 39 minutes and $19. No training. The model it wrote solves 100% of our test mazes. 🧵"

Conversation

  • Ahmed Heakl@ahmedmm72234641Today we introduce Looped Weight-Space Programming! 🚀 We asked Claude Opus 5.5 to solve hard mazes. It got only 26% right. Then we asked it to write a transformer that solves them, setting every weight directly. It took just 39 minutes and $19. No training. The model it wrote solves 100% of our test mazes. 🧵2:15 PM · Nov 23, 2026·56KViews56
@ahmedmm72234641
@ahmedmm72234641
  • Ahmed Heakl@ahmedmm7223464120h8/ Our takeaway: an LLM that can't solve a problem directly may still write a tiny model that does. Blog: mbzuai-oryx.github.io/LoopedWSP/ Demo: mbzuai-oryx.github.io/LoopedWSP/demo… Code: github.com/mbzuai-oryx/Lo… With co-first author @Python8723, Abdelrahman Shaker, Fahad Khan and @KhanSalmanH.Looped Weight-Space Programming: LLM-Written Transformers for Long Algorithmic ReasoningFrom mbzuai-oryx.github.io1Ahmed Heakl@ahmedmm7223464119h9/ Claude Opus 5.5 is a co-author on this one, since it wrote every single weight by hand 😄 @AnthropicAI @claudeai1
Looped Weight-Space Programming: LLM-Written Transformers for Long Algorithmic Reasoning. Claude wrote every weight of a looped transformer by hand. It solves 100% of Maze-Hard, where Claude itself solves 26%. Tower of Hanoi with 20 disks, 1,048,575 moves and zero mistakes.
Looped Weight-Space Programming: LLM-Written Transformers for Long Algorithmic Reasoning. Claude wrote every weight of a looped transformer by hand. It solves 100% of Maze-Hard, where Claude itself solves 26%. Tower of Hanoi with 20 disks, 1,048,575 moves and zero mistakes.
  • Ahmed Heakl@ahmedmm7223464120h1/ This builds on Weight-Space Programming by @rikiyatakehi @jayden_teoh_ @a1zhang & @lateinteraction, who showed LLMs can read and edit neural weights directly. We asked something different: can an LLM write weights that implement a whole, reusable algorithm?1
  • Ahmed Heakl@ahmedmm7223464120h3/ Could gradient descent find the same solution? We trained Claude's architecture from random weights on the same mazes. It solved 0%. The best trained baseline, Energy-Based Reasoners, reached 93.5%. Curious to hear @ylecun's take on writing weights vs learning them.1
  • Ahmed Heakl@ahmedmm7223464120h2/ Claude wrote a looped transformer. One small block runs again and again, advancing a shortest-path search by one step per pass. The same weights solve 100% of our 100×100 test mazes, even though Claude only ever tested it on mazes up to 45×45.GIF
  • Ahmed Heakl@ahmedmm7223464120h5/ Tower of Hanoi next, where reasoning models start to collapse around 7–8 disks. In 27 minutes, for about $5, Claude wrote a 3,686-weight transformer that plays all 1,048,575 moves of the 20-disk puzzle with zero mistakes. One tiny block, looped two million times!
  • Ahmed Heakl@ahmedmm7223464120h4/ Then we set a cap: fewer than 1,000 weights. Claude wrote a maze transformer with 928, and it still solves 100% of our test mazes. LDT, the best trained model on Maze-Hard, uses about 1,900× more weights.
  • Ahmed Heakl@ahmedmm7223464120h7/ Perhaps the most interesting part: interpretability. What the transformer has learned is NOT a black box. Each weight is deliberately constructed to implement an algorithm. We can inspect the intermediate states, trace each step, and understand exactly how it reaches an answer.
  • Ahmed Heakl@ahmedmm7223464120h6/ Same approach on Sudoku-Extreme, GraphWalks with 1M-token prompts, and two BIG-Bench Extra Hard tasks: 100% on every test set we evaluated. The weights are readable too. Given only the weights, a fresh Claude session worked out the whole algorithm in about 2 minutes.
  • Riccardo Ali@Riccardo_Ali_12h...have you tried asking to write a Python script? I bet it would cost you even less1
@Riccardo_Ali_
@Riccardo_Ali_

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by HN AI
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗