A Theoretical Framework for Inference and Learning in Predictive Coding Networks

Beren Millidge, Yuhang Song, Tommaso Salvatori, Thomas Lukasiewicz, Rafal Bogacz

This paper provides a rigorous mathematical bridge between the worlds of computational neuroscience and machine learning. It offers a comprehensive theoretical framework for Predictive Coding (PC), proving that these biologically inspired networks can achieve the same learning capabilities as standard Backpropagation (BP) while revealing a surprising connection to Target Propagation (TP).

The Missing Proof for Predictive Coding

Modern deep learning is dominated by Backpropagation. While incredibly effective, BP is often criticized as "biologically implausible" because it requires global error signals and specific mathematical symmetries that the human brain likely does not possess.

Predictive Coding is a leading theory in neuroscience suggesting that the brain learns by minimizing "prediction errors" locally at every layer. While PC networks (PCNs) have shown competitive empirical results in machine learning, the field has lacked a deep theoretical understanding of why they work in their standard operating regime. Specifically, it was unclear if they were truly minimizing the same global loss as BP or performing an entirely different optimization.

Researchers have now provided the "missing proof" for Predictive Coding: they demonstrate that these networks, which use only local error signals, are mathematically guaranteed to converge to the same solutions as Backpropagation.

Mathematical Lenses and Methods

The authors tackle the theoretical foundations of PCNs through several analytical lenses:

  1. Equilibrium Analysis: They derive analytical solutions for the state a PCN reaches during its "inference phase"—the period when neurons adjust their activities to minimize local errors before any synaptic weights are updated.
  2. Precision Weighting: They introduce "precision" parameters (inverse variance) to the PC framework. This allows them to tune how much the network trusts "bottom-up" sensory data versus "top-down" internal predictions.
  3. Generalized Expectation-Maximization (EM): The entire PC learning process is re-interpreted as a variant of the EM algorithm. In this view, the inference phase acts as the "E-step" (inferring hidden targets), and the weight update serves as the "M-step" (optimizing parameters).
  4. Convergence Proof: Using a novel "marginal condition" lemma, they prove that the local updates in a PCN eventually lead the network to a critical point of the global BP loss function.

Key Insights: The PC Spectrum

One of the most significant discoveries in the paper is that PC is not merely a BP clone. Instead, it acts as a flexible bridge capable of interpolating between different learning algorithms.

Relationship between BP, PC, and TP

By adjusting the "precision" of different layers, a PCN can act like Backpropagation (when bottom-up data is highly trusted), Target Propagation (when top-down targets are trusted), or a smooth interpolation of the two. This reveals that PCNs don't just react to errors; they move toward a "prospective configuration"—the state the neurons should have to correctly classify the input.

Similarity of BP and TP by precision ratio

Furthermore, the authors show that at equilibrium, the gradient of the global output loss is exactly equal and opposite to the gradient of the internal "residual" loss. This delicate balance is the mechanism that allows strictly local learning rules to solve complex global optimization problems.

Results and Future Directions

To validate their theoretical proofs, the authors performed experiments on standard datasets like MNIST and Fashion-MNIST, alongside synthetic linear and nonlinear networks.

Key Results: * Mathematical Equivalence: Deep PCNs can theoretically achieve the exact same generalization performance as BP. * Gradient Similarity: While PC and BP updates differ at the start of training, they eventually converge to the same minima. PC gradients maintain a high cosine similarity to BP gradients throughout the process. * Robust Convergence: Even with finite step sizes, the supervised loss consistently decreases during the inference phase.

Limitations: Despite these theoretical breakthroughs, PCNs face practical hurdles. The iterative "inference" phase required for every training sample introduces significant computational overhead, making PC slower than BP on current GPU hardware optimized for single-pass operations. Additionally, while the authors show intuitions hold for nonlinear networks, many precise analytical results are derived for linear cases. Extending this rigorous framework to complex modern architectures, like Transformers, remains an exciting open challenge for the field.

Summary updated

BibTeX
@inproceedings{millidge2023theoretical,
  author = {Beren Millidge and Yuhang Song and Tommaso Salvatori and Thomas Lukasiewicz and Rafal Bogacz},
  title = {{A Theoretical Framework for Inference and Learning in Predictive Coding Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2023},
  url = {https://openreview.net/forum?id=ZCTvSF_uVM4},
}
Figure