AYNIB
Spiking Neural Net
Growing intelligence from one neuron and five local rules
Overview
What if intelligence isn’t engineered, but grown?
AYNIB stands for all you need is a brain. It’s a spiking neural network built from five local rules. No backprop. No labels. No context window. Just neurons.
Peyton Satsky and I write it from scratch in C++23: about 13,000 lines and 150 commits since August 2025.
Problem: today’s AI stops learning the day it ships
Today’s AI runs on backpropagation, a mathematical trick with no biological basis. It demands global error signals, millions of labeled examples, and staggering energy. Then you freeze the weights and deploy a static model. It can’t learn from users or adapt to new domains, and it needs a context window because it has no real memory.
Objective
Can one neuron type, running the same local rules everywhere, learn, remember and predict without backprop?
The insight
The brain solves the same problems on 20 watts
In 1978, Vernon Mountcastle proposed that every patch of cortex runs the same algorithm. Vision, language and motor control aren’t hardwired; they emerge from one circuit applied to different inputs. If that’s true, intelligence has a short program.
Spikes, not numbers
Neurons talk in discrete spikes in time. Only active neurons use energy.
Learning is local
Each synapse updates from what it can directly observe. No global loss function.
One algorithm
The same circuit repeats everywhere. Specialization emerges from the input.
What they have in common:
- No global teacher: every change is local
- Timing matters: when a spike arrives is information
- Structure comes from experience, not from a designer
Architecture
One neuron type, two compartments
Basal dendrites receive feedforward input. Apical dendrites receive feedback predictions. SST interneurons learn to cancel predicted signals. What remains is prediction error: surprise.
There are no hand-built layers or brain regions. Distance decides routing: short connections land on basal dendrites, long ones on apical. Neuromodulator gradients do the job brain regions do.
Key decision
How should neurons find each other?
Five rules
Every neuron follows the same five rules
No neuron knows about the network. No global loss function exists. Learning is local, unsupervised and grounded in biology.
1.
Excitatory STDP
Synapses that help a neuron fire get stronger. Neurons that fire together, wire together.
2.
Inhibitory STDP
Inhibitory neurons learn to decorrelate activity, preventing runaway excitation.
3.
Homeostatic scaling
When a neuron grows too strong, all its inputs scale down. Stability without supervision.
4.
Synaptic tagging & capture
Active synapses get tagged. Only those that capture plasticity proteins consolidate permanently.
5.
Short-term plasticity
Synapses fatigue with rapid use, which filters frequencies naturally.
The new part
Turning prediction error into lasting memory
When a neuron fires strongly, it synthesizes plasticity-related proteins (PRPs). Tagged synapses compete for this limited resource: the strongest signals consolidate, the rest decay. We call the link the PE → PRP bridge, and as far as we know it hasn’t been published.
1: Strong firing
Prediction error makes the neuron fire hard.
2: PRP synthesis
The soma produces plasticity proteins.
3: Tag competition
The strongest tags capture protein first.
4: Consolidation
A bistable switch locks the learning in.
// --- Bistable z dynamics ---
// Bistable term: z(1-z)(z-0.5) pushes toward 0 or 1
float bistable = syn.z * (1.0f - syn.z) * (syn.z - 0.5f);
// Consolidation: PRP * tag strength pushes z toward 1
float tagFactor = (syn.tagged && syn.tagStrength > TAG_THRESHOLD)
? syn.tagStrength : 0.0f;
float consolidation = GAMMA * prpLevel * tagFactor;
// Forgetting: when PRP is low, z decays toward 0
float forgetting = LAMBDA * syn.z * (1.0f - prpLevel);
// Update z
syn.z += bistable + consolidation - forgetting;
// PRP competition: consume PRP proportional to consolidation
if (dynamicsConfig.prpCaptureCost > 0.0f && consolidation > 0.0f) {
prpFast -= consolidation * dynamicsConfig.prpCaptureCost;
Why it matters
It’s an intrinsic reward signal. The network decides what to remember without external labels, and you can watch when it’s actually learning.
What’s different
Five features that break the rules of modern AI
01
Compute scales independently of model size
The network is completely sparse: neurons only get loaded, and calculated, when an event could use them. The main factor of compute isn’t how big the model is but how difficult or unique the problem is.
02
Understands the world, not just sentences
The network trains on images and video of the world before it learns text. Instead of token statistics, it encodes concepts: the structure of reality, not just its surface patterns in language.
03
Always learning
There’s no train mode and no eval mode. Every spike triggers local plasticity, so the network adapts continuously to whatever it processes. No retraining pipelines and no frozen weights.
04
No context window
Knowledge lives in synaptic weights and consolidation states, not a fixed-size buffer. What the network learns persists in its structure until new learning overwrites it. Memory is the network.
05
No labels required
It trains unsupervised through spike-timing-dependent plasticity and discovers structure in raw input. Labels are attached afterwards, based on which neurons respond to which inputs.
Where it stands
It runs end to end. Balancing it is the hard part.
Neurons spike, synapses learn and memories consolidate. Each rule works on its own, but the rules change what the others do, so tuning them together is where most of the work goes now.
We test on handwritten digits (MNIST) and photos (cats vs. dogs) with a held-out test set that gets touched once, so a change has to generalize, not just fit the benchmark.
- 13k
- lines of C++23, written from scratch
- 150+
- commits since August 2025
- 1,200+
- parameter-sweep experiments
Next
Where I want to take it
- Better local credit assignment, so deeper networks can learn without backprop.
- Vision first: learn what the world looks like before mapping words onto it.
- A teacher–learner loop that uses the dopamine signal to see when the network is learning.
Takeaways
01
Fewer mechanisms, added one at a time
Every rule changes how the others behave. Adding one mechanism at a time, and keeping it only if the numbers go up, is the only way to know what helps.
02
Trust data you haven’t seen
It’s easy to tune a network to its own benchmark. A held-out test set and a second dataset tell us whether a change is real.
03
Draw it before you code it
The design map caught wiring that existed in code but was switched off. Keeping a picture of the system next to the code saves days.