Understanding Sample Efficiency in Predictive Coding

Gaspard Oliviers, Elene Lominadze, Rafal Bogacz

TL;DR

This paper provides a formal theoretical explanation for why Predictive Coding (PC) is more sample-efficient than Backpropagation (BP). By analyzing Deep Linear Networks, the authors show that PC inherently acts as a preconditioner that minimizes "interference" (updates that distort already-correct predictions), closely approximating natural gradient descent and allowing for faster, more direct learning trajectories.

What Problem Does This Paper Address?

In deep learning, Backpropagation (BP) is the undisputed king, but in biological brains, Predictive Coding (PC) is a highly influential model of how the cortex learns. Recent empirical work has shown that PC can be significantly more sample-efficient than BP and is less prone to catastrophic forgetting. However, a rigorous mathematical explanation of why PC enjoys these advantages has remained elusive.

The authors tackle this gap by focusing on target alignment—a metric measuring how closely a network's actual prediction changes align with the ideal direction toward the target output. When updates are misaligned, they introduce "interference," meaning the network accidentally disrupts accurate predictions in some directions while trying to fix errors in others.

Definition of target alignment and comparison of learning trajectories between BP, PC, and the ideal path.

Methods

The authors analyze the continuous-time weight dynamics of Deep Linear Networks (DLNs) and Linear Residual Networks (ResNets).

  1. Analytical Derivations: They derive closed-form expressions for the change in network predictions ($\Delta \hat{y}$) after a weight update for both BP and PC.
  2. Target Alignment Metric: They quantify learning efficiency using cosine similarity between the prediction change and the output error residual ($r = y - \hat{y}$).
  3. Algorithmic Enhancements: To eliminate cross-sample and layer-wise interference entirely, they introduce two modifications:
  4. Adaptive Learning Rates (Online Learning): Layer-specific scalar factors that scale updates by the inverse of the activity norms.
  5. Weight Update Rescaling (Batch Learning): Covariance-like decorrelation matrices that remove inter-sample correlations, effectively transforming PC into an exact natural gradient descent method.

Datasets

The paper primarily utilizes:

  • Synthetic Regression Data: Inputs and low-rank target mappings generated from standard normal distributions to isolate and study pure structural learning dynamics.
  • MNIST: The classic handwritten digit dataset, used to train a non-linear autoencoder to validate that the theoretical insights hold true in practical, non-linear regimes.

Key Insights and Ideas

  • BP's Inherent Distortion: In BP, the error signal is multiplied by successive weight matrices during the backward pass. If these matrices are poorly conditioned (e.g., in deep or narrow networks), they severely distort the error vector, leading to high interference.
  • PC's Natural Preconditioner: PC's energy minimization phase (inference) introduces a scaling matrix ($S^{-1}$) that mathematically counteracts the distortions caused by the weight matrices. This means PC updates naturally approximate natural gradients without explicitly calculating a massive Fisher Information Matrix.
  • Where PC Shines Most: The advantage of PC over BP is most pronounced in deep, narrow architectures, or in pre-trained models where weight conditioning has deteriorated.
  • Perfect Alignment is Possible: By introducing local, activity-dependent learning rate scaling, PC can achieve a target alignment of exactly 1.0, meaning completely interference-free learning for single samples.
Figure 2: Target Alignment in Predictive Coding (PC) and Backpropagation (BP). (A-D) Target alignment of BP (orange) and PC (blue) after one training step for a deep linear network with different architectures and initialisations. The dashed grey lines in panels B and D denote square networks. (E, G) Training dynamics of linear BP and PC under different initialisations and a batch size of 64. The models are square with 20 units per layer and one hidden layer. They are initialised identically and are exposed to identical batches at each training step. (F, H) Identical setup to experiments in panels E and G but for networks with eight hidden layers.

Key Results

  • Higher Baseline Alignment: Across various network depths and widths, standard PC consistently achieves higher target alignment than standard BP.
  • Initialization Matters: Under a norm-preserving initialization, PC maintains near-perfect target alignment across depths, whereas BP's alignment drops sharply as the network gets deeper.
  • Faster Convergence via Rescaling: In batch training experiments (batch size = 64), the proposed rescaled version of PC reached the minimum achievable error significantly faster than default PC, rescaled BP, and standard BP.
  • Generalization to Non-linear Models: On the MNIST autoencoder task, rescaled PC converged to the lowest test reconstruction loss in the fewest training steps, proving that the linear theory translates well to non-linear architectures.
Weight update rescaling for batch training shows rescaled PC outperforming other methods in convergence speed.

Limitations and Future Work

While the paper provides a major step forward, it has a few notable limitations:

  • Linear Assumption: The core mathematical proofs rely on linear networks at equilibrium. Although empirical results on MNIST are promising, a rigorous mathematical extension to fully non-linear networks remains open.
  • Biological Implausibility of Rescaling: The exact matrix inversions required for the batch decorrelation factors ($A_l$) are biologically implausible. The authors note that biological brains likely use alternative approximations, such as lateral inhibition or activity normalization, which warrant future study.
  • Architectural Scope: The analysis focuses primarily on Multi-Layer Perceptrons (MLPs) and simple ResNets, leaving convolutional or transformer architectures for future exploration.

Summary updated

BibTeX
@inproceedings{oliviers2026understanding,
  author = {Gaspard Oliviers and Elene Lominadze and Rafal Bogacz},
  title = {{Understanding Sample Efficiency in Predictive Coding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=6UCckKeyef},
}
Figure