arXiv:2611.03966cs.LGNov 2026

Manuscript Offprint

arXiv:2611.03966

Stacking-Based Weighting for Large Language Bayes in M-Open Settings

Anant Bhide, Akarsh Gupta, Edmond Cunningham, Justin Domke

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Large Language Bayes (LLB) transforms a natural language problem description into a collection of candidate probabilistic programs and performs inference within each model, combining their predictions using Bayesian model averaging. While this provides a flexible framework for probabilistic inference without manual model specification, the resulting candidate model set is often misspecified in practice, and likelihood-based aggregation can concentrate on a single model, under-representing uncertainty across the sampled models. We propose a stacking-based aggregation method for LLB that selects model weights by optimizing predictive performance rather than marginal likelihood, while preserving the original language-model-driven model generation and within-model inference pipeline. Because leave-one-out predictive quantities are intractable in latent-variable models, we derive a variational lower bound that yields a tractable ELBO-based stacking objective. Across real-world probabilistic inference tasks, our method achieves comparable predictive performance to Bayesian model averaging while yielding more dispersed model weights, reducing concentration on a single candidate model under misspecification.

1. Introduction

Probabilistic inference is a fundamental tool for reasoning under uncertainty and making decisions from data. In practice, however, its performance depends critically on the chosen model, and specifying an appropriate probabilistic model is often the hardest part of the inference pipeline. This difficulty is especially pronounced in realistic settings,

where the true data-generating process is unknown and any candidate model class is necessarily incomplete.

Recent work on Large Language Bayes (LLB) (Domke, 2025) aims to reduce the burden of model specification by using a language model to generate candidate probabilistic programs from a textual description of the problem. Given a textual description of the task and observed data, LLB samples a collection of candidate models, performs inference within each model, and combines the resulting posterior distributions over target variables using Bayesian model averaging. This yields a flexible framework for probabilistic inference without requiring the user to manually specify a single exact model.

However, LLB is subject to model misspecification, where the set of candidate models may not include the true data-generating process, a setting referred to as M-open (Yao et al., 2018). In this regime, Bayesian model averaging can behave more like model selection than model combination, concentrating its mass on a small subset of candidate models. In the context of LLB, this can lead to a collapse of the ensemble onto a single misspecified model, even when multiple models provide comparable predictive performance.

In this paper, we replace evidence-based weighting with stacking (Yao et al., 2018). Rather than interpreting model weights as posterior probabilities, stacking selects weights to maximize out-of-sample predictive performance. This makes stacking well suited to the M-open regime induced by language-generated model classes, where the goal is not to recover a true model but to construct a predictive ensemble that remains robust under misspecification.

Because LLB operates with latent-variable models, the leave-one-out predictive quantities required by stacking are generally intractable. We therefore derive a tractable approximation based on a variational lower bound, allowing the stacking objective to be implemented using the same inference machinery already used within LLB. The resulting method preserves the model-generation and within-model inference pipeline of LLB while replacing its aggregation rule with a predictive weighting scheme that avoids degenerate concentration on a single model.

In summary, we propose a stacking-based aggregation method for LLB that replaces Bayesian model averaging

¹Manning College of Information and Computer Sciences, University of Massachusetts Amherst, Amherst, MA, USA. Correspondence to: Anant Bhide abhide@umass.edu, Akarsh Gupta akarshgupta@umass.edu, Edmond Cunningham edmondcunin@cs.umass.edu, Justin Domke domke@cs.umass.edu.

2nd Workshop on Epistemic Intelligence in Machine Learning (EIML@ICML 2026), Seoul, South Korea. Copyright 2025 by the author(s).

with a leave-one-out predictive objective, together with a variational approximation that makes this objective tractable in latent-variable settings, enabling more reliable aggregation under model uncertainty in language-generated model spaces.