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

Distribution Transformers: Fast Approximate Bayesian Inference With On-The-Fly Prior Adaptation

George Whittle, Juliusz Ziomek, Jacob Henry Rawling, Michael A Osborne

TL;DR: Distribution Transformers (DTs) represent a new class of neural architectures that perform Bayesian inference in a single forward pass. By representing probability distributions as Gaussian Mixture Models (GMMs) and processing them as sequences of tokens, DTs achieve the speed of amortized deep learning while maintaining the flexibility and recursive power of classical Bayesian filters.

The Bottleneck in Bayesian Inference

Bayesian inference is the gold standard for reasoning under uncertainty, but it suffers from a severe speed problem. Traditional methods like Markov Chain Monte Carlo (MCMC) or Variational Inference (VI) are computationally expensive, rendering them impractical for real-time applications such as robotics or sensor fusion.

Amortized Bayesian Inference (ABI) attempts to solve this by training neural networks to map data directly to a posterior distribution. However, existing ABI methods, such as Prior-Fitted Networks, suffer from two major flaws:

  1. Fixed Priors: They assume a specific prior distribution during training. If your prior knowledge changes at test time, the model requires costly retraining.
  2. Lack of Conjugacy: Most neural methods fail to output a distribution in the same "family" as the input. This breaks sequential inference—where today's posterior must become tomorrow's prior—without relying on messy approximations.

Enter the Distribution Transformer

To address these challenges, researchers introduce the Distribution Transformer (DT). The core innovation is treating probability distributions as sequences that a Transformer can "read" and "write."

  • GMM Representation & Tokenization: The architecture represents any smooth probability density as a Gaussian Mixture Model (GMM), which acts as a universal approximator. Each component of the GMM—comprising its weight, mean, and covariance—is treated as a distinct "token." A prior distribution with $k$ components thus becomes a sequence of $k$ tokens.
  • Attention Mechanisms: A Transformer decoder processes these prior tokens. It uses self-attention to allow the GMM components to interact with one another, and cross-attention to condition the transformation on the observed dataset.
  • Approximate Conjugacy: Crucially, the model outputs a new set of tokens representing the posterior GMM. Because the input and output share the exact same format, the model can be used recursively for sequential filtering tasks.
  • Meta-Learning: The model is trained across a massive variety of priors and datasets. Rather than memorizing a single problem, it learns the underlying rules of Bayesian updates.

Key Insights

  • Permutation Equivariance: By omitting positional encodings, the Transformer naturally treats the GMM components as an unordered set. This perfectly aligns with the mathematical properties of GMMs, where component order does not affect the underlying distribution.
  • Prior-Amortization: DTs learn the mapping from a prior/likelihood pair to a posterior. This enables instant "sensitivity analysis," allowing practitioners to see how results change under different prior assumptions in milliseconds.
  • Bridging ABI and Filtering: By maintaining the GMM structure across updates, DTs effectively act as a "Neural Kalman Filter" capable of handling highly complex, non-linear uncertainties.

Experimental Validation and Results

The authors evaluated DTs across a range of synthetic and real-world-inspired benchmarks, including analytical verification tasks, Gaussian Process hyperprior inference, quantum system parameter estimation, Bayesian sensor fusion, and stochastic volatility modeling.

  • Unprecedented Speed: DTs execute inference in milliseconds. In some benchmarks, they proved roughly 10,000x faster than Stochastic Variational Inference (SVI).
  • High Accuracy: In analytical studies, DTs achieved significantly lower KL-divergence (indicating a better fit) than standard Prior-Fitted Networks, particularly when the test-time prior deviated from the training average.
  • Sequential Dominance: In a 4D state-space sensor fusion task using non-linear sensors, DTs vastly outperformed the Extended Kalman Filter (EKF) and matched the accuracy of a computationally heavy Particle Filter (PF) while being 50x faster.
  • Robustness: The model successfully generalized to different numbers of GMM components at test time, despite being trained on a fixed number.

Limitations and Future Directions

While highly effective, DTs have boundaries:

  • Curse of Dimensionality: GMMs require full-covariance matrices, which scale quadratically with the latent dimension. While DTs handle 10D spaces well, scaling to thousands of variables remains a challenge.
  • Meta-Prior Dependence: Performance relies on the "meta-prior" used during training. If real-world priors drastically differ from the training distribution, accuracy may degrade.
  • Recursive Error: As with all recursive filters, errors can accumulate over long sequences. The model remains stable up to approximately 70 steps, but long-horizon stability requires further refinement.

Summary updated

BibTeX
@inproceedings{whittle2026distribution,
  author = {George Whittle and Juliusz Ziomek and Jacob Henry Rawling and Michael A Osborne},
  title = {{Distribution Transformers: Fast Approximate Bayesian Inference With On-The-Fly Prior Adaptation}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=bMHwh8qAGc},
}
Figure