Computer Science > Machine Learning
Title:Prior-Amortized In-Context Bayesian Inference for Generalized Linear Mixed-Effects Models
Abstract:Hierarchical data is ubiquitous in the empirical sciences and most commonly analyzed with generalized linear mixed-effects models (GLMMs). Bayesian inference for GLMMs yields calibrated uncertainty estimates but requires Markov Chain Monte Carlo (MCMC). The gold-standard No-U-Turn Sampler (NUTS) is slow and must restart from scratch for every new dataset, model and prior specification. We introduce MetaBeta, a pretrained amortized model for in-context Bayesian inference over GLMMs. The full prior and model specification are supplied as context at test time, and the model returns an asymptotically exact posterior at the speed of a forward pass. Two set transformers and two conditional neural spline flows mirror the GLMM's hierarchical structure and are trained jointly on millions of realistic simulated datasets with continuous, binary and count outcomes. The flow posterior is refined by Independence Metropolis-Hastings against the unnormalized posterior. This yields tuning-free asymptotically correct inference. Alternatively, MetaBeta can warm-start NUTS. This gives nearly identical inference 3.5-13x faster than cold-started NUTS and removes over 98% of NUTS' divergent transitions. On controlled benchmarks with ground-truth parameters, MetaBeta matches NUTS in parameter recovery, posterior calibration and out-of-sample prediction. On real datasets with unknown parameters, priors and model structure, its posteriors closely agree with those of NUTS. Furthermore, it remains faithful where amortized models typically struggle: under misspecified likelihoods, misspecified priors, out-of-distribution predictors, collinear designs and data-poor regimes. On real data, a full prior sensitivity analysis including model comparison takes a few seconds with MetaBeta against 14-18 core-hours for NUTS, tracing its posteriors throughout. Our model is open-source and open-weights.
| Subjects: | Machine Learning (cs.LG) ; Machine Learning (stat.ML) |
|---|---|
| MSC classes: | 62F15, 62J12, 68T07, 62-08, 65C05 |
| ACM classes: | G.3; I.2.6 |
| Cite as: | arXiv:2609.24422 [cs.LG] |
| (or arXiv:2609.24422v3 [cs.LG] for this version) | |
| https://doi.org/10.48550/arXiv.2609.24422 arXiv-issued DOI via DataCite |
Submission history
Access Paper:
- HTML (experimental)
Additional Features
- Audio Summary
Current browse context:
References & Citations
- Google Scholar
- Semantic Scholar
BibTeX formatted citation
Bookmark
Bibliographic and Citation Tools
Code, Data and Media Associated with this Article
Demos
Recommenders and Search Tools
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.