# axo: learning without backprop
> A from-scratch spiking neural network in C++/CUDA on one RTX 5090 that learns with purely local rules, no backprop and no central optimiser, and grows into a little creature that learns to hunt over a single continuous life.
Source: https://rfriedmann.de/blog/axo-learning-without-backprop/
Published: 2026-06-17 · Track: log · Level: Advanced
Meet axo: a small artificial creature with a brain that learns while it lives. It's
a from-scratch **spiking neural network** in C++23 and CUDA, and over one continuous
life, getting hungry, hunting, dodging danger, its brain keeps changing, on a single
RTX 5090. What you see rendered live, place-cells for the eye, motor neurons, a
hunger drive, is learning in real time. And it does all of it without the one thing
every other model on this site is trained with: backpropagation.

[How a model learns](/blog/how-a-model-learns/) walked through backprop: one global
error signal, threaded backwards through every layer, nudging every weight downhill.
It's how essentially all modern AI is trained, including the models
[imp](https://github.com/kekzl/imp) serves. axo is the experiment in refusing it.
Why throw away the thing that works? Because backprop buys its power with
assumptions a living brain can't make: a frozen network, a clean train-then-run
split, a central optimiser with global knowledge. axo bets on the opposite, rules
that are **local** (a synapse changes using only what its own two neurons did, plus
a splash of neuromodulator), online, and never switched off.
## The rules, all local
That gets you single-feature detectors and simple reflexes. The hard question, the
one that decides whether local rules are a toy or a real alternative, is depth.
## Can local rules learn depth? The XOR test
XOR is the textbook task a single layer provably can't solve, and purely local
STDP doesn't either, it only ever forms single-feature detectors. Depth needs
credit assignment: telling a *hidden* neuron how it should have fired. Backprop does
that by transporting weights backward. axo can't, so it uses a trick:
The clean experiment isolates *learning* from *size*. Take an equally sized hidden
layer and either freeze it at random or let Feedback Alignment train it:
Hidden layer: frozen random
A frozen, linear readout solves only 2 of the 4 XOR rows
Depth comes for free, and it isn't enough
Hidden layer: learned via FA
Before: 2 of 4 rows. After learning: 4 of 4
The usable depth was learned, locally
Same number of neurons, same wiring budget. The only difference is whether the
hidden layer got to learn, and it's the difference between failing and solving XOR.
## An honest scale check: MNIST
Scaled up to handwritten digits (784 → 200 hidden → 10), three equally sized
conditions tell the real story:
| Net (same size, H=200) | Test accuracy |
|---|---:|
| Flat: linear readout on spike-rate-encoded pixels | 82% |
| Deep: hidden frozen-random | 15% |
| Deep: hidden learned via FA | 45% |
Two honest readings at once. The good: at identical size, the *learned* depth beats
the frozen-random depth by about 3x, the same logic that makes large learned
networks crush large random ones, reproduced from local rules. The honest: deep
still loses to flat here, from a mix of rate coding plus local-rule underfitting,
and MNIST being near-linearly-separable, which favours the flat baseline. Note the
flat 82% is a spike-rate-encoded linear readout, not a normal linear classifier: a
standard linear softmax on raw MNIST pixels scores about 92%, so 82% reflects the
lossy spike encoding, not the ceiling of linear classification. And 45% is nowhere
near an MNIST leaderboard. That's fine. The result was never the accuracy. It's that
*local* deep learning works at all.
## A brain that doesn't forget
Train a normal network on task B and it tends to overwrite task A. That's
**catastrophic forgetting**, and it's where standard AI quietly fails at being
brain-like. axo gets continual learning from a local mechanism it already has,
homeostasis: a neuron that keeps firing gets "tired", so each new pattern recruits
*idle* neurons from the existing pool instead of overwriting busy ones (no neurons
are grown or added at runtime). Fourteen patterns shown one after
another, each never seen again, on just fifty neurons:
| Pattern stream (14 patterns, 50 neurons) | Concepts still held |
|---|---:|
| With homeostatic recruitment | ~10 / 14 |
| Without (control) | ~6 / 14 |
Knowledge grows instead of getting overwritten, with nothing but local rules.
## The payoff: a creature that learns to live
The high point is the GIF at the top. No single mechanism now, everything in one
living loop: a creature in a small world, one continuous life of 24,000 steps with
no episode resets, learning to hunt purely from the consequences of its own actions.
egocentric place cells (where is food?) → motor neurons (4 actions)
→ reward on approaching and eating → reward-modulated plasticity
| | Food per 3000 steps |
|---|---:|
| Random baseline (untrained) | 4 |
| After a life of learning | ~400 |
It starts essentially helpless and ends catching food about 95x more often, solving
97.7% of all start-and-food configurations, so it learned the *rule* "move towards
food", not one memorised path. Perceiving, acting and learning in a single
continuous local loop. No backprop, no central optimiser, no reset.
## It learns to see, and to live
That loop still handed axo its eyes: a built-in sense of where food sat. The next
step takes even that away. Given only a raw egocentric retina, axo **learns its own
perception**, two separate spatial maps (left-right and up-down) self-organising via
STDP with no teacher, and then learns to hunt on that self-built code, food rate
about 52x above random. It learns to see, then acts on what it taught itself to see.
And it stops being a single reflex. A fuller axo runs on several local drives at
once: it hunts when hungry, **explores out of curiosity when it's full** instead of
grinding the same corner, and learns to **avoid danger and poison** from the
consequences. Hunger, curiosity, value, a touch of prediction, all local, all in one
unbroken life.
## What it is, and what it isn't
axo is a research being, not a product and not a path to AGI, and I would rather say so
than present it as more than it is. Real walls remain: generic deep credit assignment past one hidden
layer, clustering many grounded symbols, growing new neurons at runtime. The MNIST
number is deliberately modest and I told you why. And every figure here (the XOR
rows, the MNIST accuracies, the creature's 95x, 97.7% and 52x) is a single-run
proof-of-mechanism number, not an averaged benchmark over seeds, so read them as
"the mechanism works", not as competitive scores.
What it *is* is the opposite bet from [imp](https://github.com/kekzl/imp). imp makes
someone else's trained model run as fast as a consumer card allows; axo grows its
own small brain from local rules, online, embodied, continually, on the same single
RTX 5090. Almost all deployed AI is trained with backprop, but backprop-free
learning is established prior art, not a blank field: feedback alignment, R-STDP,
predictive coding and the broader neuromorphic/SNN community have pursued it for
years, often with stronger published numbers than axo's. axo is me building that
other way from scratch, in C++ and CUDA, to understand it hands-on. The code, every
phase and every test, is public at
[github.com/kekzl/axo](https://github.com/kekzl/axo).