Skip to main content
Back

CPCN Loops a Single Layer to Match Deep Network Performance

Closing a predictive coding network into a loop lets a small model behave like a deep one, matching ResNet-scale accuracy and solving Sudoku-hard.

Pro

  • Circular predictive coding networks get depth from energy minimization loops rather than stacked layers, fixing PC's depth problem.
  • Theoretical result: circular PC fixed points approximate Deep Equilibrium Models, with EP approximating implicit gradients.
  • Match state-of-the-art PC ResNets and VGG-15 on CIFAR and ImageNet32 with far fewer parameters.
  • Hit 99.3% on Sudoku-hard (best of 1024 views), 85.7% from a single view, via nested energy minimization.
  • First predictive coding transformer trained on TinyStories and WikiText-103, matching a same-size DEQ.
  • Code and demo released at github.com/rel-int/CircularEP.

Tommaso Salvatori and Matteo Forasassi propose a Circular Predictive Coding Network, or CPCN, that connects a model’s final hidden layer to its first. Each relaxation sweep sends activations around the loop, creating additional computation without adding separately parameterized layers. In the CPCN preprint, the authors connect this architecture to deep equilibrium models and report results on image classification, Sudoku, and autoregressive language modeling.

Predictive coding networks train by minimizing an energy function over neuron values, predictions, and local prediction errors. During inference, the network repeatedly updates its internal state until those errors settle. The local updates have made predictive coding a candidate for biologically plausible learning, but deep feedforward versions often suffer from exploding or vanishing error signals. CPCNs replace much of that stacked depth with repeated computation through a fixed loop.

A loop becomes an implicit network

A CPCN identifies the first and last hidden layers as one state, so inference repeatedly applies the same circular computation. The architecture therefore resembles a deep equilibrium model, or DEQ, which solves for a stable state satisfying z = f(z, x). A DEQ represents repeated computation implicitly instead of storing a separate layer for every application of f.

The paper’s main theoretical result links the CPCN’s minimum-energy state to the equilibrium of an equivalent DEQ. Under the stated fixed-point assumptions, settling the circular predictive coding network approximates solving the corresponding DEQ. This connection gives CPCN implementations access to established DEQ techniques for controlling convergence, estimating implicit gradients, and monitoring stability. Background on the architecture appears in the original DEQ paper.

Training uses equilibrium propagation, which first lets the network settle freely and then nudges the output toward the target with strength β. The difference between the free and nudged equilibria estimates how each parameter should change. The authors adapt the equilibrium propagation theorem to show that, for sufficiently small nudges, this update approximates the implicit gradient of the equivalent DEQ.

Diagrams of predictive coding value, prediction, and error nodes alongside a deep equilibrium model
Predictive coding minimizes local errors through repeated state updates. Closing the hidden-state path turns those updates into an implicit-depth computation.

The results, benchmark by benchmark

Benchmark Evaluation Reported result
CIFAR-10, CIFAR-100, ImageNet32 Circular vision models with a dual-readout head Accuracy comparable to predictive coding ResNets and VGG-15 with substantially fewer parameters
Sudoku-hard Recursive CPCN 85.7% board accuracy from one view and 99.3% under best-of-1024 digit-relabeled evaluation
TinyStories, WikiText-103 Circular autoregressive transformer Language-modeling performance comparable to a DEQ of the same size

The vision experiments use a dual-readout head that averages the two value nodes at the loop boundary. To estimate effective depth, the authors record the earliest sweep t after which an image remains correctly classified and map that point to 3 + 2t. This metric measures when a prediction stabilizes as iterative compute increases. The model continues to reuse the same loop parameters on every sweep.

Sudoku-hard tests whether additional sweeps support longer chains of dependent deductions. The median board becomes correct after three sweeps, while the hardest five percent require at least eleven. Board difficulty, measured by deduction-chain depth, correlates with the required sweep count. The 99.3% result uses the best outcome from 1,024 digit-relabeled views and therefore carries a much larger inference budget than the 85.7% single-view result; the two settings warrant separate comparisons.

Sudoku board accuracy plotted against deduction-chain depth and inference sweeps for two CPCN models
Harder Sudoku boards generally require more circular inference sweeps before the complete board is correct.

The language experiments apply circular predictive coding to autoregressive transformers, which predict each token from preceding tokens. The authors monitor the loop Jacobian’s spectral radius, a measure of whether small perturbations near equilibrium shrink or grow, and record when token predictions come within 0.01 nats of their converged values. These measurements expose how much iterative computation each prediction consumes and whether the loop remains locally stable during training.

Iteration carries a bill

  • Parameter reuse: Circular models can perform additional computation without allocating a separately parameterized layer for every step.
  • Adaptive inference: Easy examples may stabilize after a few sweeps, while harder examples can continue iterating up to a configured limit.
  • Training cost: Equilibrium propagation requires free and nudged settling phases, each involving repeated state updates.
  • Convergence: MNIST and FashionMNIST settle in roughly 10 to 20 sweeps, while the less contractive Sudoku models need about 40 to 60. A correct task prediction can appear before the full numerical state converges.
  • Gradient accuracy: Large values of β can move the nudged equilibrium beyond the linear regime used to justify the implicit-gradient approximation.
  • Tooling: Closing the loop removes the direct correspondence between feedforward predictive coding and backpropagation, so standard optimizers and architectures may require adaptation.

For analog or neuromorphic hardware, parameter reuse could exchange circuit size for additional settling time. The paper presents this as an architectural motivation: a fixed physical circuit can run for more iterations when adding layers is costly. The reported experiments establish model behavior in software and do not, by themselves, establish lower latency or energy use on physical hardware.

A practical adoption checklist

  1. Set a convergence policy. Define a residual tolerance, a maximum sweep count, and behavior for samples that fail to settle.
  2. Measure total compute. Compare wall-clock latency and training cost against feedforward and DEQ baselines, including both equilibrium propagation phases.
  3. Track stability. Monitor state residuals and the loop Jacobian’s spectral radius as depth, learning rate, and nudge strength change.
  4. Report inference budgets. Separate single-view results from multi-view or best-of-many evaluations.
  5. Validate gradients. Test sensitivity to β and compare equilibrium propagation updates with implicit-gradient estimates on small models.

The authors provide the project code and an interactive browser demo. The cited work is a preprint, so its theoretical assumptions, benchmark comparisons, and runtime tradeoffs remain candidates for independent reproduction.