atlas

Research map / Probabilistic and scientific modeling / Uncertainty and Gaussian processes

Can Transformers Learn Full Bayesian Inference in Context?

ICML 2025 · Probabilistic and scientific modeling › Uncertainty and Gaussian processes · approach: Bayesian view of meta-learning · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Trains a TabPFN-style transformer encoder with a flow-matching diffusion decoder on synthetic joint samples so it outputs full posterior samples for GLMs, factor analysis and GMMs in context, without parameter updates at inference.

Problem

Full Bayesian inference (complex, high-dimensional posteriors over latent variables) is slow with MCMC and biased by restrictive assumptions in VI; the paper asks whether in-context learning can perform this mapping from dataset to posterior samples.

Approach

Amortize posterior inference at the dataset level: pretrain on synthetic (dataset, latent) pairs from the generative model, using a TabPFN-style encoder for the dataset and a conditional flow-matching decoder (adaLN time conditioning) to generate posterior samples via an ODE solve, so a single forward pass conditions on the observed data.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use ICL instead of VI: StructuredGLM posterior inference · GLMs synthetic datasetsMMD: 0.929 -> 0.183Helped
Use ICL instead of VI: StructuredGLM posterior inference · GLMs real-world datasetsW2: 0.370 -> 0.387Hurt
Use ICL instead of VI: FullFactor analysis posterior inference · Factor analysis synthetic datasetsMMD: 3.222 -> 0.057Helped
Use ICL instead of VI: IAFFactor analysis posterior inference · Factor analysis real-world datasetsW2: 0.251 -> 0.583Hurt
Use ICL instead of VI: IAFGMM posterior inference · GMM synthetic datasetsMMD: 2.308 -> 0.706Helped
Use ICL instead of VI: IAFGMM posterior inference · GMM real-world datasetsMMD: 1.845 -> 1.051Helped
Use flow matching rather than diffusion objectives (ablation)ICL posterior inference · Evaluated scenariosposterior sample similarityHelped
Use flow matching rather than a multivariate Gaussian posterior parameterization (ablation)ICL posterior inference · Evaluated scenariosposterior sample similarityHelped
Increase latent dimensionality to K=20 or K=50 (ablation)ICL posterior inference · GLM scenariossample similarity to HMCNo clear effect
Apply larger train-test distribution shifts (ablation)ICL posterior inference · Out-of-distribution evaluationposterior sample qualityHurt
Replace the transformer encoder with an equally sized MLP encoder (ablation)ICL posterior inference · Architecture evaluationperformanceHurt
Use a nonlinear neural network classifier alongside the random forest for C2ST (ablation)C2ST evaluation · Evaluated methodsrelative method performanceNo clear effect

Surprising findings

Limitations

Experimental setup

Datasets: synthetic datasets from GLM, factor analysis, and GMM generative processes 17 real-world tabular regression datasets from a benchmark suite

Benchmarks: 50 synthetic datasets and 17 real-world tabular regression datasets

Metrics: C2ST (random forest ROC-AUC) MMD with exponential kernel Wasserstein-2 distance

Baselines: Hamiltonian Monte Carlo (NUTS) Laplace approximation ADVI diagonal normal ADVI full-covariance normal ADVI structured normal AutoIAF

Builds on: TabPFN flow matching diffusion transformer prior-data fitted networks automatic differentiation variational inference

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy