NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Divide-and-Conquer Predictive Coding: a structured Bayesian inference algorithm

Eli Zachary Sennesh, Hao Wu, Tommaso Salvatori

Introduction

Predictive coding (PC) is a brain-inspired framework for inference that suggests our brains constantly attempt to minimize "surprise" by predicting incoming sensory data. In machine learning, this translates to performing Bayesian inference within a generative model. Historically, however, PC has struggled to compete with modern machine learning approaches on complex, high-dimensional data.

This paper introduces Divide-and-Conquer Predictive Coding (DCPC), a novel algorithm that breaks down global inference into local, particle-based updates. By moving beyond the simple Gaussian assumptions that have historically limited PC, DCPC achieves state-of-the-art performance for PC-based models on image tasks while maintaining a biologically plausible architecture.

The Challenge with Traditional Predictive Coding

Traditional PC algorithms face a significant mathematical hurdle: they typically rely on the Laplace approximation. This approximation assumes that the distribution of hidden variables is Gaussian and that these variables do not influence each other's correlations (the mean-field assumption).

Predictive coding architecture illustrating the flow of predictions and prediction errors.

While this assumption simplifies the math, it is a poor fit for real-world data, which is often multimodal and highly structured. Consequently, PC has historically lagged behind standard deep learning methods like Variational Autoencoders (VAEs). The authors set out to create a PC algorithm capable of handling complex, non-Gaussian structures without losing the "local computation" property that makes PC biologically interesting.

Divide-and-Conquer Predictive Coding (DCPC)

DCPC replaces the rigid Gaussian assumptions of traditional PC with a more flexible Sequential Monte Carlo (SMC) approach. The algorithm operates through several key mechanisms:

  1. Divide and Conquer: Instead of attempting to solve the entire inference problem simultaneously, the algorithm decomposes the joint posterior into local coordinate updates. It focuses on one latent variable at a time, conditioned strictly on its "neighbors" in the graphical model.
  2. Langevin Proposals: To move these variables toward the "truth," DCPC employs Langevin dynamics. It calculates a "prediction error"—the gradient of the local log-density—and uses it to nudge a population of samples (particles) in the correct direction.
  3. Importance Resampling: Because the Langevin step acts as a proposal, the algorithm uses importance weighting and resampling to correct for any errors. This ensures the particles accurately represent the true, potentially complex posterior distribution.
  4. Local Learning: Crucially, the model parameters are updated using only local information. There is no global backpropagation; each unit only needs to know the state of its immediate parents and children.

The authors implemented this framework using Pyro, a deep probabilistic programming library, allowing DCPC to be seamlessly integrated with modern neural network architectures.

Experimental Evaluation & Key Results

The authors evaluated DCPC on several standard image benchmarks to test its reconstruction and generation capabilities, including MNIST, EMNIST, Fashion MNIST, and CelebA (at 32x32 and 64x64 resolutions).

MNIST digit reconstructions demonstrating the model's generative capabilities.

DCPC significantly outperformed previous predictive coding variants across the board:

  • Better Inference: On the MNIST dataset, DCPC achieved a Negative Log-Likelihood (NLL) of 102.5, a marked improvement over the 144.6 achieved by the previous state-of-the-art Monte Carlo PC (MCPC).
  • Superior Generation: On the CelebA dataset, DCPC achieved a Frechet Inception Distance (FID) of 79.0. This not only beat other PC methods like Langevin Predictive Coding (FID ~120) but also outperformed a standard VAE (FID 86.3) in their specific experimental setup.
  • No Encoder Needed: Unlike VAEs, which require a separate "encoder" network to be trained, DCPC performs inference "on the fly" through its iterative sampling process, successfully yielding high-quality reconstructions of unseen images.

Key Insights and Biological Plausibility

By using a "cloud" of particles instead of a single point estimate, DCPC can capture multiple "interpretations" of a stimulus (multimodality), which is a hallmark of human perception. Furthermore, the paper proves that global backpropagation is not required to perform maximum-likelihood learning. If the generative model is factorized, the learning rules can be localized as well.

The authors also provide a fascinating mapping of DCPC onto the canonical cortical microcircuit. They suggest that different layers of the cortex (L2/3, L4, L5/6) and different brain rhythms (gamma, beta, theta) correspond to specific steps in the DCPC algorithm, such as conveying prediction errors or synchronizing the "divide-and-conquer" loops.

Limitations and Future Work

Despite its successes, DCPC faces a few hurdles. Because it relies on iterative sampling (SMC) rather than a single forward pass (like a VAE's encoder), it is computationally heavier and slower to train. The algorithm is also sensitive to hyperparameters, particularly the learning rate for the latent variables. Finally, scaling sampling-based methods to high-resolution natural images remains an industry-wide challenge.

Future work could involve using neural networks to "warm-start" the particle populations, potentially combining the speed of amortized inference with the accuracy and biological plausibility of DCPC’s structured approach.

Summary updated

BibTeX
@inproceedings{sennesh2024divide,
  author = {Eli Zachary Sennesh and Hao Wu and Tommaso Salvatori},
  title = {{Divide-and-Conquer Predictive Coding: a structured Bayesian inference algorithm}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=dxwIaCVkWU},
}
Figure