Brain-like Variational Inference

Hadi Vafaii, Dekel Galor, Jacob L. Yates
10/25/2024
cs.AIcs.LGq-bio.NC

No official code found. Best implementation: hadivafaii/IterativeVAE (73 stars, MIT, last commit 2026-02-09).

Abstract

Inference in both brains and machines can be formalized by optimizing a shared objective: maximizing the evidence lower bound (ELBO) in machine learning, or minimizing variational free energy (F) in neuroscience (ELBO = -F). While this equivalence suggests a unifying framework, it leaves open how inference is implemented in neural systems. Here, we introduce FOND (Free energy Online Natural-gradient Dynamics), a framework that derives neural inference dynamics from three principles: (1) natural gradients on F, (2) online belief updating, and (3) iterative refinement. We apply FOND to derive iP-VAE (iterative Poisson variational autoencoder), a recurrent spiking neural network that performs variational inference through membrane potential dynamics, replacing amortized encoders with iterative inference updates. Theoretically, iP-VAE yields several desirable features such as emergent normalization via lateral competition, and hardware-efficient integer spike count representations. Empirically, iP-VAE outperforms both standard VAEs and Gaussian-based predictive coding models in sparsity, reconstruction, and biological plausibility, and scales to complex color image datasets such as CelebA. iP-VAE also exhibits strong generalization to out-of-distribution inputs, exceeding hybrid iterative-amortized VAEs. These results demonstrate how deriving inference algorithms from first principles can yield concrete architectures that are simultaneously biologically plausible and empirically effective.

View on arXivView PDF

Code Implementations(1)

MIT

The Official PyTorch Implementation of "Brain-like Variational Inference" (NeurIPS 2025 Paper)

733Shell, PythonMar 21, 20258 months agoMIT
free-energypredictive-codingsparse-codingvaevariational-inference

Similar Papers

Cite this paper

@article{vafaii2024brainlike,
  title  = {Brain-like Variational Inference},
  author = {Hadi Vafaii and Dekel Galor and Jacob L. Yates},
  year   = {2024},
  eprint = {2410.19315},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.19315v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.19315.svg)](https://codeofpaper.com/paper/2410.19315)

Discussion