alphaFeedback

WorksComputer Science

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

AI contributions
Not recorded for this paper
View details

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.

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 [2] 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 MM-open Yao et al. [13]. 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. [13]. 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 MM-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 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.

Background

This work builds on two main components: Large Language Bayes and stacking-based predictive model averaging. We introduce only the minimal setup required to describe our method.

Large Language Bayes

Large Language Bayes (LLB) (Domke, [2]) is an automated approach for performing probabilistic inference over latent variables given data and a textual description of the problem. Given a prompt tt describing the problem and observed data x=(x1,…,xn)\boldsymbol{x} = (x_1, \ldots, x_n), LLB samples a collection of candidate models

m(k)∼p(m∣t),k=1,…,K.m^{(k)} \sim p(m \mid t), \qquad k = 1, \ldots, K.

Each model m(k)m^{(k)} defines a joint distribution over latent variables zz and observations xx. Inference is performed independently within each model to obtain posterior distributions p(z∣x,m(k),t)p(z \mid x, m^{(k)}, t).

The overall objective is to approximate the posterior over latent variables by marginalizing over models:

p(z∣x,t)=∑k=1Kp(m(k)∣x,t) p(z∣x,m(k))p(z \mid x, t) = \sum_{k=1}^{K} p(m^{(k)} \mid x, t)\,p(z \mid x, m^{(k)})

In practice, sampling from p(m∣x,t)p(m \mid x, t) is intractable. Instead, LLB samples models from p(m∣t)p(m \mid t) and assigns importance weights based on the model evidence. This yields the approximation

p(z∣x,t)≈∑k=1KwkBMA p(z∣x,m(k))p(z \mid x, t) \approx\sum_{k=1}^{K} w_k^{\mathrm{BMA}}\,p(z \mid x, m^{(k)})

where wkBMA∝p(x∣m(k))w_k^{\mathrm{BMA}} \propto p(x \mid m^{(k)}) are the standard Bayesian model averaging weights proportional to the marginal likelihood of each candidate model.

This construction corresponds to Bayesian model averaging over the sampled candidate models and therefore inherits the usual closed-world interpretation that one of the candidate models is expected to be adequate.

The MM-open setting

In many practical scenarios, including LLB, the true data-generating process is not contained within the set of candidate models. This is known as the MM-open setting, where the objective is not to recover a true model, but to obtain accurate predictions ([1] (Le & Clarke 2017)).

In this regime, Bayesian model averaging can concentrate its weight on a small subset of candidate models, effectively behaving more like model selection than model combination ([13] (Le & Clarke 2017)).

Since LLB generates models using a language model, there is no reason to expect that the true model lies within the candidate set. Therefore, LLB naturally operates in an MM-open regime, where likelihood-based weighting can lead to undesirable weight concentration on a single misspecified model.

Stacking and predictive model averaging

Stacking provides an alternative framework for combining models that is explicitly designed for predictive performance. Rather than interpreting weights as posterior probabilities of models, stacking selects weights to maximize out-of-sample predictive accuracy under a leave-one-out scheme, typically measured using a proper scoring rule such as the log score ([13, 10]).

This leads to weights that directly target predictive accuracy rather than model identification. This predictive perspective makes stacking a natural replacement for the weighting scheme used in LLB, aligning the aggregation of models with the goal of accurate prediction under model misspecification.

Related Work

Our work sits at the intersection of language-conditioned probabilistic modeling and predictive aggregation under model misspecification.

Recent work has explored the use of natural language as a specification medium for probabilistic inference and prediction. (Wong et al., [12]) translates text into probabilistic programs and performs Bayesian inference in the resulting model, while (Requeima et al., [8]) uses language to condition numerical predictive distributions directly. (Saad et al., [9]) and (Li et al., 2024) further develop the idea of generating probabilistic programs or statistical models automatically from data and natural language. Large Language Bayes (Domke, [2]) builds on this line by treating a text description as inducing a distribution over formal probabilistic models and then performing inference within each sampled model. In this paper, we take the model-generation step of LLB as given and focus instead on how the resulting collection of candidate models should be aggregated.

A separate line of work studies how to combine predictive models when the true data-generating process is not assumed to be in the candidate class. Bayesian model averaging is the classical framework for accounting for model uncertainty [4, 11], but in the MM-open setting it can concentrate too strongly on a small subset of candidate models and fail to exploit complementary predictive structure. Stacking addresses this issue by selecting weights that maximize out-of-sample predictive performance rather than posterior model probability [13, 10]. Le and Clarke Le & Clarke (2017) provide a Bayesian decision-theoretic interpretation of stacking in both MM-complete and MM-open settings, showing that stacking weights can be viewed as asymptotically minimizing posterior expected loss. Related extensions such as Bayesian hierarchical stacking further generalize stacking to input-dependent, partially pooled model weights [14]. In practice, the required leave-one-out predictive quantities can be efficiently approximated using Pareto-smoothed importance sampling [10].

Our setting combines these two perspectives. LLB provides a way to generate a finite set of candidate probabilistic programs from language, but the induced model class should not be assumed to contain the true data-generating process. We therefore replace evidence-based aggregation with a stacking objective defined over leave-one-out predictive approximations. This yields a predictive combination rule that is aligned with the MM-open nature of language-generated model classes, while preserving the latent-variable structure and within-model inference machinery of LLB.

Method

We retain the LLB pipeline for model generation and inference [2], but replace the original evidence-based weighting rule with a regularized stacking-based objective that selects model weights according to predictive performance [13, 10].

Figure 1 illustrates the LLB pipeline together with the proposed stacking-based aggregation.

Example LLB pipeline with a language prompt, sampled candidate models, and ELBO-based stacking with KL regularization toward BMA weights

Figure 1. Example LLB pipeline with a language prompt, sampled candidate models, and ELBO-based stacking with KL regularization toward BMA weights.

Stacking-Based Weighting Objective

Given a prompt tt, LLB samples a finite set of candidate models

m(k)∼p(m∣t),k=1,…,K.m^{(k)} \sim p(m \mid t), \quad k = 1,\ldots,K.

For each candidate model m(k)m^{(k)}, and for each observation xix_i, we consider the leave-one-out predictive density

p(xi∣x−i,m(k),t),p(x_i \mid x_{-i},m^{(k)},t),

where x−ix_{-i} denotes the dataset with the ii-th observation removed.

We define weights w=(w1,…,wK)w=(w_1,\ldots,w_K) constrained to the probability simplex,

wk≥0,∑k=1Kwk=1.w_k \ge0, \qquad\sum_{k=1}^{K} w_k = 1.

The corresponding stacked predictive distribution for the held-out observation xix_i is

∑k=1Kwkp(xi∣x−i,m(k),t).\sum_{k=1}^{K} w_k p(x_i \mid x_{-i},m^{(k)},t).

Following the stacking framework, we choose the weights by maximizing the aggregate leave-one-out log predictive score. To preserve the inductive bias encoded by the original LLB weighting rule, we add a KL regularizer that anchors the learned weights near the evidence-based BMA weights while still allowing the stacking objective to redistribute mass when this improves predictive performance:

w^=arg max⁡w∈ΔK[∑i=1nlog⁡(∑k=1Kwkp(xi∣x−i,m(k),t))−λKL⁡(wBMA∥w)].\hat{w} = \underset{w \in\Delta_K}{\operatorname{arg\,max}}\left[\sum_{i=1}^{n}\log\left(\sum_{k=1}^{K}w_k p(x_i \mid x_{-i},m^{(k)},t)\right)-\lambda\operatorname{KL}(w^{\mathrm{BMA}}\mathbin{\|}w)\right].

This objective directly targets predictive performance under an MM-open setting, where the true data-generating process is not assumed to lie in the candidate model class.

However, the quantities p(xi∣x−i,m(k),t)p(x_i \mid x_{-i},m^{(k)},t) are generally intractable in the LLB setting because of latent variables. We therefore approximate these terms using a variational bound. The key result is summarized in the following proposition, with proof deferred to Appendix § 8.§ 1.

Proposition 4.1 (ELBO-based Stacking Objective). For each candidate model m(k)m^{(k)} and observation xix_i, define a variational distribution qi,k(z)q_{i,k}(z) approximating the posterior p(z∣xi,x−i,m(k),t)p(z \mid x_i,x_{-i},m^{(k)},t), and define

ELBO⁡i,k=Eqi,k(z)[log⁡p(xi,z∣x−i,m(k),t)−log⁡qi,k(z)].\operatorname{ELBO}_{i,k}=\mathbb{E}_{q_{i,k}(z)}\left[\log p(x_i,z \mid x_{-i},m^{(k)},t)-\log q_{i,k}(z)\right].

Then the leave-one-out predictive density satisfies

ELBO⁡i,k≤log⁡p(xi∣x−i,m(k),t),\operatorname{ELBO}_{i,k}\leq\log p(x_i \mid x_{-i},m^{(k)},t),

and substituting this variational bound into the stacking objective yields

w^=arg max⁡w∈ΔK[∑i=1nlog⁡(∑k=1Kwkexp⁡(ELBO⁡i,k))−λKL⁡(wBMA∥w)].\hat{w}=\underset{w\in\Delta_K}{\operatorname{arg\,max}}\left[\sum_{i=1}^{n}\log\left(\sum_{k=1}^{K}w_k\exp(\operatorname{ELBO}_{i,k})\right)-\lambda\operatorname{KL}(w^{\mathrm{BMA}}\mathbin{\|}w)\right].

This is the objective we optimize in practice. It preserves the structure of stacking while replacing each intractable leave-one-out predictive term with a variational approximation that can be computed using the same inference machinery already used within LLB.

Full Algorithm

We now summarize the complete inference and weighting pipeline combining LLB-style model generation, variational leave-one-out estimation, stacking-based weight optimization, and posterior aggregation.

Algorithm 1 LLB with KL-Regularized Stacking-Based ELBO Weighting

Require: Text description tt, dataset x=(x1,…,xn)x = (x_1,\ldots,x_n), number of models KK

  1. Sample models: m(k)∼p(m∣t)m^{(k)} \sim p(m \mid t), k=1,…,Kk = 1,\ldots,K

  2. for each model k=1,…,Kk = 1,\ldots,K do

  3.     for each data point i=1,…,ni = 1,\ldots,n do

  4.     Form leave-one-out dataset x−ix_{-i}

  5.     Construct variational posterior: qi,k(z)≈p(z∣xi,x−i,m(k),t)q_{i,k}(z) \approx p(z \mid x_i,x_{-i},m^{(k)},t)

  6.     Compute ELBO-based surrogate predictive score:

ELBO⁡i,k=Eqi,k(z)[log⁡p(xi,z∣x−i,m(k),t)qi,k(z)]\operatorname{ELBO}_{i,k} = \mathbb{E}_{q_{i,k}(z)}\left[\log\frac{p(x_i,z\mid x_{-i},m^{(k)},t)}{q_{i,k}(z)}\right]
  1.     end for

  2. end for

  3. Solve stacking optimization:

w^=arg max⁡w∈ΔK[∑i=1nlog⁡(∑k=1Kwkexp⁡(ELBO⁡i,k))−λKL⁡(wBMA∥w)]\widehat{w} = \underset{w\in\Delta^K}{\operatorname{arg\,max}}\left[\sum_{i=1}^{n}\log\left(\sum_{k=1}^{K}w_k\exp(\operatorname{ELBO}_{i,k})\right)-\lambda\operatorname{KL}(w^{\mathrm{BMA}}\mathbin{\|}w)\right]
  1. Compute final posterior mixture:

p~(z∣x,t)=∑k=1Kw^kp(z∣x,m(k),t)\widetilde{p}(z\mid x,t)=\sum_{k=1}^{K}\widehat{w}_k p(z\mid x,m^{(k)},t)
  1. return p~(z∣x,t),w^\widetilde{p}(z\mid x,t),\widehat{w}

Experiments

Experimental Setup

We evaluate the proposed KL-regularized ELBO-stacking weighting scheme against the original LLB aggregation rule on a suite of probabilistic inference tasks. In line with the LLB framework, each task is specified by a textual problem description tt together with observed data xx, while held-out observations are reserved for predictive evaluation.

We consider three county-level expected annual loss prediction tasks covering different natural hazard regimes: wildfire, inland flooding, and hurricane, derived from the FEMA National Risk Index dataset [3]. For each task, we construct a training set of n=20n = 20 observed county-level loss values (in millions of USD), and evaluate predictive performance on 10 held-out counties. Across all tasks, losses are strictly positive and exhibit heavy-tailed variability.

For each task, candidate probabilistic programs are generated from the textual description tt following the LLB pipeline. Figure 1 illustrates the full pipeline from language prompt to posterior aggregation.

Method Details

For each task, we generate 250 candidate NumPyro programs using Qwen2.5 Coder 32B. Programs are generated from the textual description tt alone, deduplicated by normalized code hash, and filtered to retain only those that compile and pass shape validation.

Each valid candidate model is fit using the No-U-Turn Sampler (NUTS) [5], a gradient-based Markov Chain Monte Carlo method, producing posterior samples for downstream evaluation.

To approximate the leave-one-out predictive densities required for stacking, we construct x−ix_{-i} for each observation and compute a variational lower bound (ELBO) on log⁡p(xi∣x−i,m(k),t)\log p(x_i\mid x_{-i},m^{(k)},t) using a Gaussian variational family. These ELBO values provide a tractable surrogate for the leave-one-out predictive objective and form the basis of weight optimization.

We compare the original LLB evidence-based aggregation rule with the KL-regularized stacking objective introduced in § 4. The KL term stabilizes optimization by encouraging proximity to the BMA weights while allowing deviations when supported by predictive performance. We select λ\lambda from a small grid using validation predictive performance on a held-out validation split. We optimize this objective in log-space using SciPy’s BFGS with softmax parameterization (w=softmax⁡(θ)w = \operatorname{softmax}(\theta)) and analytical gradients.

Evaluation Metrics

We evaluate both the distribution of learned model weights and predictive performance. To assess weight concentration, we report the effective sample size (ESS), defined as 1/∑kwk21/\sum_k w_k^2, where values close to 1 indicate collapse to a single model and larger values indicate more distributed weighting. We also report the top model weights to directly visualize how mass is allocated across models.

Predictive performance is measured using expected log predictive density (ELPD) on held-out test data [10], where higher values indicate better generalization. This allows us to verify that distributing weight across models does not degrade predictive performance.

Results

Figure 2 and Table 1 show that BMA concentrates most of its mass on a single model, whereas stacking spreads weight across multiple candidate models.

Effective sample size (ESS) of learned model weights across tasks

Figure 2. Effective sample size (ESS) of learned model weights across tasks.

DatasetBMA top weightsStacking top weights
Hurricanew139=1.000w_{139} = 1.000w1=0.759w_1 = 0.759<br>w65=0.238w_{65} = 0.238<br>w129=0.003w_{129} = 0.003
Inland Floodw24=1.000w_{24} = 1.000w24=0.588w_{24} = 0.588<br>w13=0.412w_{13} = 0.412
Wildfirew83=0.998w_{83} = 0.998w138=0.666w_{138} = 0.666<br>w83=0.334w_{83} = 0.334

Table 1. Top model weights under BMA and stacking.

This behavior is consistent across all three hazard regimes. In the BMA case, the posterior over models effectively collapses to a single candidate, indicating that evidence-based weighting behaves like model selection in practice. In contrast, stacking assigns non-trivial weight to multiple models, reflecting residual uncertainty over which misspecified model best approximates the data-generating process in the MM-open setting.

Table 2 reports held-out predictive performance. Across all tasks, stacking matches Bayesian model averaging in terms of ELPD, indicating that redistributing weight across multiple models does not degrade predictive accuracy. This supports the interpretation that the primary difference between the two approaches is not predictive power, but rather the representation of model uncertainty.

DatasetLLB (BMA)Stacking
Hurricane-5.983-5.999
Inland Flood-370.340-370.340
Wildfire-177.922-177.897

Table 2. Held-out predictive performance measured by expected log predictive density (ELPD).

Discussion and Limitations

Our results suggest that replacing evidence-based aggregation in LLB with a stacking-based objective yields weight distributions that are more consistent with the MM-open setting. In particular, stacking produces less concentrated weights than Bayesian model averaging while maintaining comparable predictive performance. This supports our main claim: in language-generated model spaces, the goal is not to identify a single dominant model, but to maintain a meaningful mixture over plausible misspecified candidates. At the same time, our experiments do not establish that the learned weights recover the true epistemic uncertainty of the data-generating process. The resulting mixture still depends on the quality and diversity of candidate models generated by the language model. Future work includes evaluating the approach on more diverse problems and exploring alternative regularization strategies and input-dependent stacking schemes.

Conclusion

We proposed a stacking-based aggregation method for Large Language Bayes that replaces evidence-based weighting with a predictive objective while preserving the original language-model-driven model generation and within-model inference pipeline. Across our experiments, the method maintains comparable predictive performance to the LLB baseline while yielding a more distributed allocation of weights across candidate models. These results support the view that stacking is a natural fit for LLB-style inference in the MM-open setting, where the goal is robust prediction and a more faithful representation of model uncertainty under misspecification.

Appendix

Proof of Proposition 4.1

Proof. Fix a candidate model m(k)m^{(k)}, an observation xix_i, the remaining data x−ix_{-i}, and the prompt tt. Let zz denote the latent variables in the model, and let qi,k(z)q_{i,k}(z) be any variational distribution over zz.

We begin with the leave-one-out predictive density:

p(xi∣x−i,m(k),t)=∫p(xi,z∣x−i,m(k),t) dz.(1)p(x_i \mid x_{-i},m^{(k)},t)=\int p(x_i,z \mid x_{-i},m^{(k)},t)\,dz. \tag*{(1)}

We consider the Kullback–Leibler divergence from qi,k(z)q_{i,k}(z) to the leave-one-out posterior:

KL⁡(qi,k(z)∥p(z∣xi,x−i,m(k),t))=∫qi,k(z)log⁡qi,k(z)p(z∣xi,x−i,m(k),t) dz.(2)\operatorname{KL}\left(q_{i,k}(z)\mathbin{\|}p(z \mid x_i,x_{-i},m^{(k)},t)\right)=\int q_{i,k}(z)\log\frac{q_{i,k}(z)}{p(z \mid x_i,x_{-i},m^{(k)},t)}\,dz. \tag*{(2)}

By Bayes’ rule,

p(z∣xi,x−i,m(k),t)=p(xi,z∣x−i,m(k),t)p(xi∣x−i,m(k),t).(3)p(z \mid x_i,x_{-i},m^{(k)},t)=\frac{p(x_i,z \mid x_{-i},m^{(k)},t)}{p(x_i \mid x_{-i},m^{(k)},t)}. \tag*{(3)}

Substituting (3) into (2) gives

KL⁡(qi,k(z)∥p(z∣xi,x−i,m(k),t))=∫qi,k(z)log⁡qi,k(z)p(xi∣x−i,m(k),t)p(xi,z∣x−i,m(k),t) dz.(4)\operatorname{KL}\left(q_{i,k}(z)\mathbin{\|}p(z \mid x_i,x_{-i},m^{(k)},t)\right)=\int q_{i,k}(z)\log\frac{q_{i,k}(z)p(x_i \mid x_{-i},m^{(k)},t)}{p(x_i,z \mid x_{-i},m^{(k)},t)}\,dz. \tag*{(4)}

Since p(xi∣x−i,m(k),t)p(x_i \mid x_{-i},m^{(k)},t) does not depend on zz, we may separate it from the integral:

KL⁡(qi,k(z)∥p(z∣xi,x−i,m(k),t))=∫qi,k(z)log⁡qi,k(z)p(xi,z∣x−i,m(k),t) dz+log⁡p(xi∣x−i,m(k),t).(5)\operatorname{KL}\left(q_{i,k}(z)\mathbin{\|}p(z \mid x_i,x_{-i},m^{(k)},t)\right)=\int q_{i,k}(z)\log\frac{q_{i,k}(z)}{p(x_i,z \mid x_{-i},m^{(k)},t)}\,dz+\log p(x_i \mid x_{-i},m^{(k)},t). \tag*{(5)}

Rearranging terms yields

log⁡p(xi∣x−i,m(k),t)=∫qi,k(z)log⁡p(xi,z∣x−i,m(k),t)qi,k(z) dz+KL⁡(qi,k(z)∥p(z∣xi,x−i,m(k),t)).(6)\log p(x_i \mid x_{-i},m^{(k)},t)=\int q_{i,k}(z)\log\frac{p(x_i,z \mid x_{-i},m^{(k)},t)}{q_{i,k}(z)}\,dz+\operatorname{KL}\left(q_{i,k}(z)\mathbin{\|}p(z \mid x_i,x_{-i},m^{(k)},t)\right). \tag*{(6)}

We define the evidence lower bound:

ELBOi,k:=∫qi,k(z)log⁡p(xi,z∣x−i,m(k),t)qi,k(z) dz=Eqi,k(z)[log⁡p(xi,z∣x−i,m(k),t)qi,k(z)].(7)\mathrm{ELBO}_{i,k}:=\int q_{i,k}(z)\log\frac{p(x_i,z \mid x_{-i},m^{(k)},t)}{q_{i,k}(z)}\,dz=\mathbb{E}_{q_{i,k}(z)}\left[\log\frac{p(x_i,z \mid x_{-i},m^{(k)},t)}{q_{i,k}(z)}\right]. \tag*{(7)}

Therefore,

log⁡p(xi∣x−i,m(k),t)=ELBOi,k+KL⁡(qi,k(z)∥p(z∣xi,x−i,m(k),t)).(8)\log p(x_i \mid x_{-i},m^{(k)},t)=\mathrm{ELBO}_{i,k}+\operatorname{KL}\left(q_{i,k}(z)\mathbin{\|}p(z \mid x_i,x_{-i},m^{(k)},t)\right). \tag*{(8)}

Because the Kullback–Leibler divergence is non-negative,

KL⁡(qi,k(z)∥p(z∣xi,x−i,m(k),t))≥0,(9)\operatorname{KL}\left(q_{i,k}(z)\mathbin{\|}p(z \mid x_i,x_{-i},m^{(k)},t)\right)\ge0, \tag*{(9)}

it follows that

ELBOi,k≤log⁡p(xi∣x−i,m(k),t).(10)\mathrm{ELBO}_{i,k}\le\log p(x_i \mid x_{-i},m^{(k)},t). \tag*{(10)}

Applying the exponential function, which is monotone increasing, preserves the inequality:

exp⁡(ELBOi,k)≤p(xi∣x−i,m(k),t).(11)\exp(\mathrm{ELBO}_{i,k}) \le p(x_i \mid x_{-i}, m^{(k)}, t). \tag*{(11)}

Define the surrogate predictive density

p~i,k:=exp⁡(ELBOi,k).(12)\tilde{p}_{i,k} := \exp(\mathrm{ELBO}_{i,k}). \tag*{(12)}

Then (11) implies

p~i,k≤p(xi∣x−i,m(k),t).(13)\tilde{p}_{i,k} \le p(x_i \mid x_{-i}, m^{(k)}, t). \tag*{(13)}

Substituting this variational bound into the stacking objective gives the surrogate objective

w^=arg⁡max⁡w∈ΔK[∑i=1nlog⁡(∑k=1Kwkp~i,k)−λKL⁡(wBMA∥w)]=arg⁡max⁡w∈ΔK[∑i=1nlog⁡(∑k=1Kwkexp⁡(ELBOi,k))−λKL⁡(wBMA∥w)].(14)\begin{aligned} \hat{w} &= \underset{w \in\Delta^K}{\arg\max}\left[\sum_{i=1}^{n}\log\left(\sum_{k=1}^{K}w_k\tilde{p}_{i,k}\right)-\lambda\operatorname{KL}(w^{\mathrm{BMA}} \parallel w)\right] \\ &= \underset{w \in\Delta^K}{\arg\max}\left[\sum_{i=1}^{n}\log\left(\sum_{k=1}^{K}w_k\exp(\mathrm{ELBO}_{i,k})\right)-\lambda\operatorname{KL}(w^{\mathrm{BMA}} \parallel w)\right]. \tag*{(14)} \end{aligned}

This proves Proposition 4.1.

ELBO Convergence Diagnostics

To verify the quality of the variational approximations used in our stacking objective, we track the convergence of the ELBO values during optimization for each leave-one-out inference problem. Figure 3, Figure 4, and Figure 5 show ELBO trajectories for a sample of 6 data points from each of the three tasks.

Six-panel ELBO convergence plots for Hurricane Eal Counties, with panels Point 1 through Point 6 and axes Iteration and ELBO

Figure 3. ELBO convergence for 6 sample points from the Hurricane task. Each subplot shows the optimization trajectory for a single leave-one-out inference problem.

Six-panel ELBO convergence plots for Inland Flood Eal, with panels Point 1 through Point 6 and axes Iteration and ELBO

Figure 4. ELBO convergence for 6 sample points from the Inland Flood task.

ELBO convergence for 6 sample points from the Wildfire task

Figure 5. ELBO convergence for 6 sample points from the Wildfire task.

We construct a variational approximation qi,k(z)q_{i,k}(z) and optimize the corresponding ELBO objective using gradient-based variational inference. The red solid lines show the ELBO values at each iteration, while the green dashed lines indicate the final converged values used in the stacking objective.

Across all three tasks, the ELBO values converge within 25 iterations, typically stabilizing after 10–15 iterations. The gray points in the background represent the raw ELBO evaluations during optimization. The convergence patterns suggest that the variational approximation provides stable and reliable surrogates for the intractable leave-one-out predictive densities required by the stacking objective.

Code

The link to the code is: Code

References

  1. [1]Clyde, M. and Iversen, E. S. Bayesian model averaging in the m-open framework. In Bayesian Theory and Applications, pp. 483–498. Oxford University Press, 2013. doi: 10.1093/acprof:oso/9780199695607.003.0024.DOI
  2. [2]Domke, J. Large language bayes. arXiv preprint arXiv:2504.14025, 2025. URL https://arxiv.org/abs/2504.14025.
  3. [3]Federal Emergency Management Agency (FEMA). National risk index. https://www.fema.gov/flood-maps/products-tools/national-risk-index, 2024. Accessed: 2026-04-23.
  4. [4]Hoeting, J. A., Madigan, D., Raftery, A. E., and Volinsky, C. T. Bayesian model averaging: A tutorial. Statistical Science, 14(4):382–417, 1999. doi: 10.1214/ss/1009212519.
  5. [5]Hoffman, M. D. and Gelman, A. The no-u-turn sampler: Adaptively setting path lengths in hamiltonian monte carlo. Journal of Machine Learning Research, 15(1):1593–1623, 2014.
  6. [8]Requima, J. et al. Lim processes: Numerical predictive distributions conditioned on natural language. arXiv preprint arXiv:2405.12856, 2024. URL https://arxiv.org/abs/2405.12856.
  7. [9]Saad, F. A., Cusumano-Towner, M. F., Schaech tle, U., R i-nard, M. C., and Mansinghka, V. K. Bayesian synthesis of probabilistic programs for automatic data modeling. arXiv preprint arXiv:1907.06249, 2019. URL https://arxiv.org/abs/1907.06249.
  8. [10]Vehtari, A., Gelman, A., and Gabry, J. Practical bayesian model evaluation using leave-one-out cross-validation and waic. Statistics and Computing, 27:1413–1432, 2017. doi: 10.1007/s11222-016-9696-4.DOI
  9. [11]Wasserman, L. Bayesian model selection and model averaging. Journal of Mathematical Psychology, 44(1):92–107, 2000. doi: 10.1006/jmps.1999.1278.DOI
  10. [12]Wong, S. et al. From word models to world models. arXiv preprint arXiv:2306.12672, 2023. URL https://arxiv.org/abs/2306.12672.
  11. [13]Yao, Y., Vehtari, A., Simpson, D., and Gelman, A. Using stacking to average bayesian predictive distributions. Bayesian Analysis, 13(3):917–1003, 2018. doi: 10.1214/17-BA1091.DOI
  12. [14]Yao, Y., Pirš, G., Vehtari, A., and Gelman, A. Bayesian hierarchical stacking: Some models are (somewhere) useful. Bayesian Analysis, 17(4):1043–1071, 2022. doi: 10.1214/21-BA1287.DOI

Paper details

vlnc:W_x3fpm9vm
v1 · latestHistory (1)

published · Fresh — added to the Hub within the last 30 days

added ·

Usage

views · 8

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

CC BY 4.0

Original source

  • Computer Science

Not recorded for this paper · View statement →

Looking for related papers…
Contents