SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.19315 · NeurIPS · 2025

Brain-like Variational Inference

Hadi Vafaii, Dekel Galor, Jacob Yates

arXiv · PDF · Open in the Atlas

Code that ran

1 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2410.19315.json · badge: /api/ran/2410.19315.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
hadivafaii/IterativeVAE canonical (classifier label)
classifier basis: census
1 ran · 5 no recorded run
FunctionStatusWhere it lives
get_stride Ran
ran, honoured the contract we drafted
hadivafaii/IterativeVAE/base/common.py
code served (permissive licence) · get_code("2063e35da2a2021b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - cell_type: str - used with .split('_')[0]
# - cmult: int - used as the stride value for 'down' case
# 
# The function splits cell_type on '_' and checks the first part
# against ['normal', 'combiner', 'down', 'up']
# cmult is returned as stride for 'down' case

ARGS = {
    'cell_type': 'normal_block_v1',
    'cmult': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_act_fn Not yet run
unverified (harvested, no recorded run)
hadivafaii/IterativeVAE/base/common.py
code served (permissive licence) · get_code("3851c136f925660d")
How it ran

no invocation recorded.

get_root_path Not yet run
unverified (harvested, no recorded run)
hadivafaii/IterativeVAE/analysis/final.py
code served (permissive licence) · get_code("b1bbd91f82327657")
How it ran

no invocation recorded.

kl_balancer_coeff Not yet run
unverified (harvested, no recorded run)
hadivafaii/IterativeVAE/base/utils_model.py
code served (permissive licence) · get_code("5b94980fdb995a52")
How it ran

no invocation recorded.

split_data Not yet run
unverified (harvested, no recorded run)
hadivafaii/IterativeVAE/base/dataset.py
code served (permissive licence) · get_code("9cbf78f099058bd8")
How it ran

no invocation recorded.

temp_anneal_linear Not yet run
unverified (harvested, no recorded run)
hadivafaii/IterativeVAE/base/utils_model.py
code served (permissive licence) · get_code("550668a7c4d3ad87")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_act_fn 1 other paper
1 dated earlier
2405.14473 (2024-05)
Poisson Variational Autoencoder
get_stride 1 other paper
1 dated earlier
2405.14473 (2024-05)
Poisson Variational Autoencoder
split_data 1 other paper
1 dated earlier
2405.14473 (2024-05)
Poisson Variational Autoencoder
temp_anneal_linear 1 other paper
1 dated earlier
2405.14473 (2024-05)
Poisson Variational Autoencoder

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 hardwareefficient 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. 1. Choice of distributions (appendix A.4): (i) approximate posterior q ϕ (z|x), (ii) prior p θ (z), and (iii) likelihood p θ (x|z) 2. Choice of inference method (appendix A.8): (i) amortized (e.g., learned neural network) vs. (ii) iterative (e.g., gradient descent) Variational Autoencoder (VAE) model family. Variational Autoencoders (VAEs) transform the abstract ELBO objective into practical deep learning architectures [18][19][20]. The standard Gaussian VAE (G-VAE) exemplifies this approach by assuming factorized Gaussian distributions for all three distributions, with the approximate posterior q ϕ (z|x) implemented as a neural network that maps each input x to posterior parameters: enc(x; ϕ) → (µ(x), σ 2 (x)). This amortization of inferenceusing a single network to approximate posteriors across the entire dataset-is a defining characteristic of VAEs. Alternative distribution choices are also possible; for instance, replacing both prior and posterior with Poisson distributions yields the Poisson VAE (P-VAE; [50]), which better aligns with neural spike-count statistics [51][52][53]. We derive the VAE loss in appendix A.5, and discuss both G-VAE and P-VAE extensively in appendices A.6 and A.7. Sparse coding and predictive coding as variational inference. Two major cornerstones of theoretical neuroscience, sparse coding (SC; [54]) and predictive coding (PC; [22]), can also be derived as instances of ELBO maximization (or equivalently, F minimization), given specific distributional choices [33,55,56]. SC and PC share two key characteristics that distinguish them from standard VAEs. First, they both use a Dirac-delta distribution for the approximate posterior, effectively collapsing it to a point estimate. But they differ in their prior assumptions: PC employs a Gaussian prior, while SC uses a sparsity-promoting prior (e.g., Laplace; Fig. 2). Second, instead of amortized inference as in VAEs, both PC and SC employ iterative inference, better aligning with the recurrent nature of neural computation [40][41][42][43][44]. See appendix A.8 for an in-depth comparison, and appendix A.9 for a pedagogical derivation of the Rao and Ballard [22] objective as F minimization. Online inference through natural gradient descent. In a recent landmark paper, Khan and Rue [34] proposed the Bayesian learning rule (BLR), unifying seemingly disparate learning algorithms as instances of variational inference optimized via natural gradient descent [35,57] on a Bayesian objective which reduces to the ELBO when the likelihood is known [58,59]. BLR's generality extends naturally to sequential settings [60], where beliefs must be updated online as data arrives. In such settings, a rolling update scheme-where the posterior at each step becomes the prior for the next (Fig. 7)-provides a simple yet effective approach to continual belief revision [60]. Summary so far. In this background section, and the corresponding appendix A, we reviewed how seemingly different models across machine learning and neuroscience can be understood as instances of F minimization (Fig. 2). The differences among them arise from the choices we make on the distributions and the inference methods (appendix A.10).

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2410.19315")
get_code_for_paper("2410.19315")
have("2410.19315")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2410.19315.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2410.19315.svg)](https://syntology.ai/paper/2410.19315)

Connect an agent — have() is free.