← aman.holdings  /  Guest lectures  /  Predictive coding in RTL

Guest lecture 01 · Timothy Oh

Predictive coding, all the way down to the datapath

Timothy Oh's arXiv 2603.18066 maps the predictive coding update equations one-to-one onto a synthesizable SystemVerilog neural core. No backward pass, no phase controller, no shared parameter memory. Learning and inference run as the same fixed local dynamics, and the task enters the machine only as clamped boundary conditions.

Read alone, it is a careful small-scale hardware paper. Read alongside two earlier attacks on the same problem, it becomes the third point on a single axis: how much global machinery does learning actually need?

arXiv 2603.18066v2 · cs.NE preprint, under review open SystemVerilog ~11 min read
Editions Watch the narrated deck →  ·  eleven slides, about four and a half minutes

Muted preview, looping. Click to open the narrated version.

Act 1What the paper builds

Backpropagation is difficult to realize as a physically distributed learning system, and the paper is precise about why. It requires global error propagation backward through the whole graph, creating a dependency structure that is not local. Training splits into distinct synchronized phases (forward, backward, update) which demand coordination and the storage of intermediate activations. And it leans on centralized memory, moving data through interconnect that dominates the power budget in embedded settings. None of this prevents backprop from running well on a GPU. All of it fights a substrate where each unit is its own piece of silicon.

Predictive coding offers a different formulation, inherited from Rao and Ballard's account of the visual cortex and Friston's free-energy program. Each layer predicts the layer below it through a set of weights, the mismatch is the prediction error, and inference and learning both fall out of minimizing a single quadratic energy over those errors:

The energy is global, but its gradients decompose into strictly local terms. Descending on it with respect to activities gives the state update; descending with respect to weights gives a Hebbian rule. Writing them per neuron makes the locality explicit:

A neuron needs four things: its own state, its own prediction error, presynaptic activity from the layer above, and error products from the layer below. Nothing global survives the decomposition. That property is what makes predictive coding a candidate substrate for embedded learning, and it is the property Oh's architecture is built to preserve.

One neuron, one core

At the center of the design is a hardware unit called a neural core, corresponding to a single scalar unit at one index in one layer. It stores its state, its error, and its own row of synaptic weights including an explicit bias lane implemented as a fixed presynaptic channel with constant value one. There is no shared parameter memory anywhere in the system, and no global learning-phase controller. Cores talk only to adjacent layers, over hardwired point-to-point links with no arbitration.

Every tick, each core runs the same six-stage finite-state schedule: PRED accumulates the top-down prediction, ERR forms and stores the local error, BACKSUM accumulates weighted errors arriving from below, BACKVEC emits the error products the layer above will need, WUP applies the Hebbian weight update, and STATE takes one explicit Euler step on the neuron's state. All arithmetic is IEEE-754 single precision in HardFloat's recoded format, rounded to nearest-even, through a single multiply-accumulate unit reused sequentially across indices.

Reusing one MAC is the design's central trade. Because the core iterates over its fan-in rather than computing in parallel, the cycle count per tick grows linearly with connectivity:

where N is the number of true presynaptic inputs and M the number of incoming back-error signals. The paper states the consequence plainly: this buys area and a uniform per-core implementation at the cost of latency, and higher-throughput versions would need parallel MACs or vectorized datapaths.

The task is a boundary condition

The most elegant part of the design is how a task gets into the machine. Each core exposes a clamping interface: an enable line and an observed value. When clamping is asserted, the neuron's effective state for that tick becomes the externally supplied observation, which then feeds both the local error computation and the derivative gate on the state update. A separate hard-clamp mode also overwrites the stored state at the end of the tick.

Supervised training clamps the boundary layers, input and target, and lets error flow between them. Inference clamps only the input, sets the learning rate to zero, and reads the free output after a fixed tick budget. The schedule does not change between the two. There is no mode bit inside the core, no separate inference datapath, and no instruction stream anywhere in the system. Task structure lives entirely in connectivity, rate constants, and which neurons are pinned.

Why this mattersThe paper's own framing puts this next to Hinton's notion of mortal computation, where algorithm and hardware become inseparable. The FSM schedule, the MAC accumulation, the local state registers, and the weight-update logic are the learning process. There is no software executing on a general-purpose substrate. Oh stays deliberately on the immortal, synchronous-digital side of that line, but the structural point holds: a fixed local dynamical fabric supports both inference and adaptation without any programmed learning phase.

The evidence, and its limits

Small networks learn under the fixed schedule. A teacher-student regression task with a ReLU hidden layer drops mean squared error from 0.341 to 0.0059 over 25 epochs; a tanh network collapses more than two orders of magnitude within three. Three architectures of increasing size, up to 8→16→8, train with no changes to the RTL at all; only compile-time dimension parameters differ.

The characterization work is the more interesting contribution. A grid sweep over 64 learning-rate and inference-step-size pairs finds no divergence and no oscillation anywhere in the tested range; every configuration either converges or stagnates, and convergence is gated almost entirely by the inference step size rather than the learning rate. A separate sweep over the per-sample inference tick budget shows the incremental regime directly: at one tick per sample the network barely learns, and improvement saturates around fifty ticks, giving a practical operating point rather than an asymptotic claim.

Against a matched backpropagation network trained strictly online, with each sample seen exactly once, the predictive coding network converges within one to two hundred samples and lands at a test error near 0.055 with a seed-to-seed spread under 0.003. Backprop reaches a better mean, near 0.045, with dramatically higher variance across seeds: one stalls near 0.094, another reaches 0.014. The paper does not claim a winner. It names the trade: sample efficiency and final accuracy, exchanged for locality and consistency.

The validation most papers skipBecause the RTL runs in float32 while the Python reference runs in float64, Oh constructs a float32-emulating variant of the reference and tracks divergence per tick over 500 ticks. Peak disagreement is 4.77×10-8, one float32 unit of least precision near unity, and it stays flat across both the inference and learning phases rather than compounding. That is a real bound on the correspondence being claimed, not an assertion of it.
Where reviewers will pushThe largest network is 8→16→8 on synthetic regression, with no classification benchmark at any scale. More pointedly, "synthesizable" is asserted rather than exercised: every result is a Verilator simulation, and there is no synthesis report, no area or timing numbers, no power figures, and no FPGA run. The sequential MAC makes latency grow with fan-in, so scaling claims are architectural rather than demonstrated. Nonzero residual error floors appear in all runs and are acknowledged but not explained. None of this sinks a substrate paper, but a hardware venue will want the synthesis table.

Act 2Three attacks on one problem

The paper is more interesting in company. Two earlier pieces of work, a 2021 paper with Mohammad Rezaei and Milad Lankarany and a 2024 note on neural cellular automata, attack the same question from different directions, and each one's open problem is answered by another's design.

2021: delete the gradient

Gradient-Free Neural Network Training via Synaptic-Level Reinforcement Learning (preprint arXiv 2105.14383) asks Oh's question from the opposite side. He keeps a gradient and makes it local. That paper removes the gradient entirely and asks whether a single universal rule, applied identically at every synapse, can still train a network.

The design is deliberately austere. The reinforcement learning agent is the synapse, not the neuron, which keeps the action space tiny where a per-neuron formulation would scale with layer width. Each synapse chooses among three actions: increase its weight by a small fixed step, decrease it, or do nothing. Its entire state is its own last two actions plus the last two global reward signals. The reward is a single bit: whether total training loss went down between the previous two iterations. Every synapse in the network runs the same policy, learned once by temporal-difference Q-learning over a state-action space small enough to be a lookup table.

It worked further than austerity of that degree suggests it should. More than 20,000 parameters train simultaneously and converge. On notMNIST character recognition the learned policy lands within about a point of gradient descent at 32 hidden units, and at zero hidden units it comes out ahead. The static policy, learned once on a random decision-boundary matching task and then frozen and reapplied, outperformed the adaptive one and transferred across activation functions, network shapes, and tasks. The honest cost is stated: roughly 5.5 hours against 20 minutes for the same network.

The line that connects forwardThat paper's discussion closes on cellular automata directly, citing Wolfram, Conway, and Dennett, and the observation that a static per-synapse rule producing coherent network-level learning is complex behavior arising from simple local ones. Its limitation is also the one Oh's architecture speaks to: locality is expensive when you simulate it on a von Neumann machine. Twenty thousand independent agents time-sliced through one processor is precisely the bill his design stops paying.

2024: use the gradient once, then let the rule run

Neural Cellular Automata, Active Inference, and the Mystery of Biological Computation takes the middle position. Neural cellular automata, popularized by Mordvintsev and colleagues, put a neural network inside the update rule of a cellular automaton and train it by backpropagation through time. Backprop is used at design time only. What ships is a local dynamical rule: the same code in every cell, communicating only with immediate neighbors.

The demonstration is a scotopic-vision automaton trained to predict video pixels with 99% of pixels randomly removed. One state channel holds each cell's prediction of its own pixel value. Another acts as an input register, latching whatever sparse observation happens to arrive. The remaining channels the cells allocate for themselves. Loss is the squared error between a cell's estimate and the true value whenever an observation lands. It reconstructs the video, and generalizes to new footage after training on one clip.

Read the demo against the hardwareThat is Oh's clamping primitive in a different substrate. An arriving pixel clamps the cell; every unobserved cell runs free and settles toward a prediction; the gap between clamped observation and local prediction drives the update. The 2024 note does prediction-error minimization on a grid with one percent observability. The 2026 RTL does prediction-error minimization on a layered graph with clamped boundary layers. Even the stated next step matches: that note calls NCA "straight-forward to implement in silicon/physical circuitry" and names a PixelRNN-style silicon retina with Piotr Dudek as the goal. Oh built the layered version of that silicon.

One dial, three settings

Placed side by side, the three are not three topics. They are three settings of the same dial, and the global residue shrinks monotonically across them.

WorkWhat is localWhat stays globalWhat it costs
Synaptic RL
2021
The entire update: three-action policy, four-item state, one shared rule across 20,000 synapses One scalar bit per step. Did the loss go down Roughly sixteen times slower than gradient descent, simulated
Scotopic NCA
2024
The whole runtime: identical code per cell, neighbor-only communication, prediction-error driven One offline training run, at design time The loss must be differentiable
PCN in RTL
2026
Both learning and inference: fixed FSM, adjacent-layer wires, no shared memory A clock edge, and the choice of which layers to clamp Latency linear in fan-in; slightly behind backprop on accuracy

Read down the third column and the trajectory is exact: one scalar bit, then one offline training run, then a clock edge. Each work removes a different piece of the conductor and reports honestly what the removal costs.

They also split cleanly on where the intelligence is stored. In the synaptic-RL paper it lives in a policy discovered by reinforcement learning and then frozen. In the cellular automaton it lives in weights discovered by backpropagation and then frozen. In Oh's RTL it is not learned at all: the rule is fixed by construction from the predictive-coding equations, and everything task-specific lives in connectivity, rate constants, and clamping. He sits at the far end of the dial, where the update rule is a physical constant of the substrate.

The common skeletonAll three attack credit assignment without a backward pass, and all three land on the same answer shape: a universal local rule plus a boundary signal. The synaptic rule needs a global reward bit. The cellular automaton needs sparse observations. The neural cores need clamped layers. Same skeleton, different flesh.

What they imply together

The 2021 compute objection is answered by the 2026 substrate. That paper declined to propose its method as a replacement for gradient descent, on the grounds that its time complexity was worse. But that cost is an artifact of simulating twenty thousand independent agents on a single processor. On a substrate where each synapse is physically its own core, a three-action lookup-table policy is nearly free, and the comparison inverts. Nobody has run that experiment.

The rigidity of the 2026 rule is answered by the 2021 paper. Oh's update is fixed at synthesis time, so the residual error floors he reports have no adaptive escape route. A synaptic-RL layer choosing among a few discrete adjustments per synapse, driven by a one-bit global signal, is a cheap and plausible complement, and his BACKSUM stage already computes exactly the local quantity such a policy would key on.

The 2024 note wanted silicon, and this is silicon. Its own next-steps list asks for focal-plane implementation. Oh delivers a synthesizable neural core with a clamping interface, which is most of what a predictive-coding pixel would need. The remaining gap is topological: his cores are wired in layers, the automaton's in a grid, and his design already treats connectivity as a compile-time parameter.

The one real disagreementNot everything reconciles. The 2021 paper leans on Wolfram's computational irreducibility to argue that some useful models may have no gradient shortcut at all. The 2024 note depends entirely on the shortcut, using backpropagation through time to design its rule. Oh sidesteps both by deriving his rule analytically from an energy function, so nothing is searched for. Three different bets on whether a local learning rule should be learned by reinforcement, learned by gradients, or derived from theory. That question is still open, and it is the interesting one.

Sources

← aman.holdings Narrated deck →