Amol Kelkar (kelkar.amol@gmail.com)
Abstract
Pattern Machine is a neural network architecture that represents hierarchical spatiotemporal patterns. It is our neural / model substrate for implementing Cognitive Homeostatic Agents, and our attempt at the common cortical algorithm, i.e. a single functional node, repeated across a hierarchy, that learns to predict its own inputs over time. We have implemented it more than a dozen different ways, and the core tenets below have stayed mostly the same across all of them.
Core tenets
Representation
- Disentangle probability and uncertainty in representations (think predicting cat vs dog in daylight vs in dim twilight).
- Represent every value as a distribution, not a scalar. The spread of a histogram already encodes precision, so predictions are already precision weighted, and there is no need for a separate precision weighting step.
- A neuron stores a joint (input, output) probability distribution. Each neuron is a local transition function, and the network as a whole is a probabilistic prediction and regression engine.
- Precision should follow information density. Quantization is finer where data is dense, so inputs that follow the learned distribution are easy for downstream layers to read.
Predictive processing
- Cognition is the reconciliation of bottom-up evidence with top-down predictions, using precision weighted (i.e. confidence weighted) mixing of the two.
- This mixing yields oscillating attention that toggles between inputs and predictions within a theta-like cycle. Bottom-up input drives the neuron early in a cycle, and top-down prediction drives it later.
- Predictions modulate the neuron’s threshold, and not just its input. Lowering the threshold locks in and pattern-completes a predicted signal. Raising it subtracts the prediction and passes only the prediction error upward.
- Prediction error gates attention. We attend where prediction and sensory evidence disagree, e.g. something expected is missing, or something unexpected shows up.
Temporal organization and maps
- Maps encode time, not similarity. Neighboring neurons become sensitive to patterns that occur close together in time, not to patterns that look alike. Feature maps only look similarity-organized because natural signals change gradually. (This is a falsifiable prediction: areas with faster dynamics should show finer temporal maps.)
- A self organized map neighborhood is a state transition function. Moving along a manifold traverses a memory engram (an episodic memory fragment), and activating neighbors in sequence traces an input trajectory as a traveling wave.
- Each layer is a memory bank of episodic memory fragments. Higher layers predict over longer timescales, so they can drive lower layers to replay future trajectories. This is the basis for planning.
Substrate: spiking, sparse, homeostatic, dynamic
- Evolution’s spiking neuron is a near optimal solution to both biological and computational constraints, so the core unit is a spiking neuron, and not a standard deep learning activation.
- Spikes convey evidence for a pattern, and a sparse population code conveys confidence (precision). Rate, latency and change (“diff”) codes are different views of one underlying code.
- Homeostasis is a first-class organizing principle. Each neuron adapts its own threshold towards a target firing rate (automatic gain control).
- Time is a first-class citizen. The network is a stepped dynamical system with leak, axonal delay and reset-on-spike. Each neuron’s own excitability/fatigue rhythm works as a local “clockless clock”, and traveling waves are the computation.
- Active dendrites mix top-down context with bottom-up signals. This is the mechanism behind attention (think following one voice in a noisy room).
- A column holds a superposition of candidate trajectories, resolved by k-winner-take-all and lateral inhibition. Settling into an attractor is itself a computation.
- Prefer computational equivalence over biological fidelity. Reproduce the brain’s dynamics efficiently on dense tensors, without simulating its biophysics.
Learning and reward
- Learning is local and Hebbian, with no backpropagation. “Fire in sequence, wire in sequence”, i.e. the network burns in the trajectory it just experienced.
- Locally predicted rewards track global rewards that represent utility for homeostasis.
- Local learning preferentially remembers rewarding episodes (soft memorization of favorable trajectories).
Why not just scale up a Transformer?
Scaling up gives you more capability, but Pattern Machine is after something else. Large models are already getting very capable (see the capability–sentience gap). They have stakes set from outside, e.g. trained rewards and instructions. What they are missing is a self-preserving stake, i.e. something that is actually at risk for the system itself, and a self that is its own implementation, which needs recurrent state. These are the 2 ingredients needed for feelings, and you don’t get them by adding parameters.
Pattern Machine is designed to have both. Homeostasis is built into every neuron and every subsystem in the heterarchy, so neurons self-regulate to stay useful. It is also designed so that the self is re-instantiated moment to moment by the same dynamics it reports on (settling, traveling waves, competition). Mainstream AI research is starting to converge on part of this. Recent latent reasoning work brings back internal recurrence and describes it in terms of attractor dynamics, which we have long considered central. What is different about Pattern Machine is the homeostatic grounding that turns these dynamics into stakes.
Experiments
Our experiments with more than a dozen ways to implement Pattern Machine are on GitHub. The most recent one is an architecture based on Spiking Neurons, with a leaky integrate-and-fire neuron that adjusts its own threshold to maintain a target firing rate, i.e. homeostasis at the level of a single neuron. Building it suggests that evolution’s spiking neuron is a good solution to computational constraints, and not only to biological ones.
