No teacher model. No human feedback. No GPU cluster. A 0.8B parameter model that gets better at coding by studying its own mistakes — running entirely on a MacBook Air with 6GB of RAM.
Not from a dataset someone else built. Not from a bigger model showing it the right way. Just from the gap between what it tried and what actually worked.
This is how humans learn to code. You write something, run it, see the error, understand why, fix it. The fix is more valuable than any tutorial — because it's specific to exactly the mistake you made.
TinyForge applies the same idea to a language model. The model tries to solve a coding problem. It fails. It sees exactly what failed — which test, what input, what it returned, what was expected. It tries again. When the second attempt is better, we extract that weak→strong pair and train on it. The model literally teaches itself from its own failures.
Self-play works for Go (AlphaGo). It works for math (AlphaProof). Here it works for code — on hardware anyone can afford.
Each coding task runs through an evolutionary loop before training. The model isn't just trying once — it's competing against itself.
The key is step three. Most systems just score a solution as "right" or "wrong." TinyForge captures the specific failure: input=[15] expected='FizzBuzz' got='Fizz'. That evidence is far more useful than a score. The model knows exactly what to fix.
This is the most important insight. The model isn't trained on the correct solution. It's trained on the transformation from broken to working.
The training prompt is: here's the broken code, here's the test failure, fix it. The training target is the working code. The model learns: when I see this kind of failure, I should fix it like this. It learns how to debug, not just what the answer is.
That's why it generalises. Memorising answers doesn't transfer to new problems. Learning repair patterns does.
All tests are on fresh holdout slices the model never saw during training. No cherry-picking.
| Setup | Public Tests | Hidden HumanEval+ | Change |
|---|---|---|---|
| Base model, single-pass | 2/8 | baseline | |
| 🔥 Repair-trained, single-pass | 4/8 | +75% | |
| Base model + evolutionary search | 5/8 | +163% | |
| 🔥 Repair-trained + evolutionary search | 6/8 | +175% |
The 75% single-pass improvement came from training on just 13 self-generated repair pairs. Thirteen examples. No human labelling. No external data.
| Setup | Public Tests | Hidden HumanEval+ |
|---|---|---|
| Base model, single-pass | 28/70 | 0/8 |
| 🔥 Repair-trained + search + feedback | 53/70 | 3/8 |
On the hardest unseen problems, the base model scored zero. After repair training: three. Not magic. But real — on a laptop.
Training on "here's the broken code, fix it" works better than "here's the problem, here's the solution." Small models learn fixing patterns, not memorised answers — and patterns transfer.
Generating multiple attempts, testing them, keeping the best, mutating using failure feedback — this single mechanism accounts for more of the gain than fine-tuning alone.
expected='FizzBuzz' got='Fizz' helps more than 3/6 tests passed. Evidence beats scores every time.
The biggest overnight finding: the trained model writes much better code inside the feedback loop. It didn't just learn solutions — it learned how to respond to failure.
Wider search, colder sampling, extra generalisation layers — we tried them. They didn't reliably help. The simple loop outperformed every elaboration.
On easy problems where the base model already does well, the gains are small. On the hardest unseen problems — where it scored zero — repair training plus search produced real, measurable improvement.
The loop is simple: generate something → check if it's right → learn from what went wrong → try again. That works anywhere you can measure the output.
Run the query, check if results match expectations.
Verify the proof mechanically with Lean or SymPy.
Check binding properties via physics simulation.
A/B test it. Did people click? Click rate is automatic feedback.
Did they open? Did they reply? Open rate = the verifier.
Run the policy in simulation. The physics engine tells you if it worked.
If you can score the output — even roughly — the model can learn from its own mistakes. No labelled dataset. No expert in the loop. The model makes its own training data by failing and fixing. Your data never leaves your machine.
The technique is the contribution, not the model size. A 0.8B model teaching itself to code better is interesting. A 70B model with a real cluster doing the same thing might be something else entirely.
The hardware barrier to this kind of research just dropped to zero. A MacBook Air and an afternoon is enough to start.