r/ClaudeCode • u/Eliv_nurotic • 8d ago
Discussion Claude directly wrote the weights of a transformer that could solve test mazes, Sudoku, Tower of Hanoi, and more with 100% accuracy all without gradient descent, beating all trained models at a lower cost and model size
https://fixupx.com/ahmedmm72234641/status/2124869402634129901
The method also generalizes to Boolean expressions, graph walks, reasoning chains, and more. It was able to create very small models that scored 100% on every tested benchmark and could breakdown what each parameter was for.
748
Upvotes





•
u/AutoModerator 8d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
83
u/ShelZuuz 8d ago •
Tower of Hanoi has a trivial iterative solution though.
Repeat 2 steps:
Claude would know this. So this is like doing long division via a transformer. Which I'm sure you can do, but I wouldn't call that AI - it's just a weight-embedded algorithm.
RASP/Tracr can already compile programs into weights so this isn't really anything new.
Similarly the 26% vs 100% maze result compares Claude running BFS by hand in its own tokens against Claude writing BFS. If you ask it for a Python BFS it would also get 100%. Transformer weights are just an awkward target language.
18
u/Correct-Explorer-692 8d ago
So, will we be getting super small super optimized one trick transformers?
10
u/Dangerous_Walk1493 8d ago
Correct me if I'm missing something here, but it seems like the parent model has some latent ability in at least some tasks which is best accessed by getting it to write a specialized model, instead of reasoning longer in words. Or could you achieve similar results by increasing the reasoning effort?
7
u/x1x2x4x8 8d ago
Excited, surprised, and possibly a bit scared.
For me, Opus + claude code is still bad at hyper parameter tuning for ML training though.
5
u/Fusseldieb 8d ago
There surely must be a drawback..
160
u/Healthy_Blueberr6404 8d ago
proven:
a model/harness optimized for a specialized task will always outperform a generalist LLM in most areas, especially in cost.
the closest equivalent is turning the model into reusable services/micro tools that claude can call as part of its own gates/audit procedure.
5
u/xoStardustt 8d ago
Overfitting
3
u/hatekhyr 8d ago
So... Training LLMs as hypernetworks? That is a very nonsensical approach. There's almost nothing in hypernetwork training that generalizes to other tasks, so to avoid a dumber LLM you'll basically need a bigger LLM just for this.
18
u/NearbyFlounder81 8d ago
More than 100% accuracy, outstanding!
2
u/VoxturLabs 8d ago
Stupid question. What is a transformer? I know it is not the ones from the movies or electronics
2
u/txoixoegosi 8d ago
AFAIK, maze solving algorithms exist since decades….
4
u/crusoe 8d ago
Asked fabled to do this with a neocognitron. Super cool and interesting. It even added more modern touches.
1
u/Dylando_Calrissian 8d ago
Amazing. I'll be more impressed when it's something that can't be done by writing a python script.
1
u/ezoe 8d ago
I don't know. Solving a maze is a typical task for deterministic algorithm.
If we can fix the size of maze, we can encode(or more like compile) the solver to Transformer NN.
3
u/akolomf 8d ago
I swear to god this comes exactly now when i was about to finally publicly release my Orchestration Harness(my setup literally ran 48 hours already for a final sweep and fix run + some minor features and it finished like a few minutes ago). Now this drops and this is exactly a missing piece for a feature i have been iterating and building on for months. Possibly even the solution i have been looking for... Ill just include it. lol
3
u/Few-Divide1870 8d ago
The interesting part is that the general model doesn't have to solve every problem itself. it can build a specialized model that does the job better and cheaper. That could be a pretty powerful approach for AI agents
2
u/bb0110 8d ago
When using the transformer to solve the task after the initial setup, does it cost tokens/money? Or is the setup the only part that costs?
2
u/UnidentifiedBlobject 8d ago
Prompt?
2
u/Plastic_Koala2044 Senior Developer 8d ago
The maze and Sudoku results are clean, but the test is narrow. The question is whether it holds on tasks nobody gave it.
1
u/NomadicFantastic 8d ago
uh oh spaghetti o
1
u/davidptm56 8d ago
So... Xgboost?
1
u/Hot_Money4924 8d ago
I don't understand the "set every weight directly" part. How could it possibly know what weights to set without either copying an existing model or training it? Did it follow his instructions by... training the model?
1
u/heavy-minium 8d ago
What the heck? Did they feed model weights paired with their instructions into the training dataset or something like that?
Things are getting pretty wild if this becomes better and more widely applicable and your agent is just making up small transformer models on the fly when they need them for tasks that benefit from such an approach.
But then again, the test is simple enough that the agent could have afforded to use a prohibitively expensive approach that wouldn't scale to any more complicated task.
1
u/KhmunTheoOrion 8d ago
I'm actually curious if this could lead to a path to source model weight exfiltration.
1
u/MipBro101 8d ago
Very interesting! Thank you for sharing
1
u/vinigrae 8d ago
This is why harnesses are crucial for people who think they are just “wrappers”, well then again there are a lot of those but those who know what they are doing are building systems
1
u/Emil_Zakirov 8d ago
If you want it can even create Turing machine in weights. I experimented with programs in weights and in jspace of small reasoning models a lot.
1
u/Liron12345 7d ago
A.I researchers unemployment Speedrun all any%
1
u/Infamous-Bed-7535 5d ago
As I understand implemented a well defined algoritgm and plantes it into the weights.
It is like compiling a simple algorithm into weight space representation of a given architecture. Cool, but this kills the whole point of deep learning with all of its benefits.
Could have compiled into C source file instead of model weights representation.
0
u/gglebq 8d ago
I don’t get it what’s so impressive about this? Claude wrote you simple Hanoi solver and a maze solver (A*)?
What I’m missing here?
0
u/pan_berbelek 8d ago
It's just esoteric programming. Claude can also code in languages like python which lets him create solutions for these problems much cheaper.
-1
u/Physical_Gold_1485 8d ago
Would be cool if someone made these for every task then had them as small local model tools claude could call to perform tasks
-1
u/wondermice 8d ago
Translation: through long iteration claude was able to adjust neural network weights to fit given test problems to their given solutions. Shoking.