In probabilistic machine learning, the marginal likelihood—or model evidence—is the holy grail of evaluation. It tells us exactly how well a model explains the observed data while automatically penalizing overparameterization. Mathematically, computing it requires integrating over all possible configurations of latent variables:
$$p(x) = \int p(x, z) dz$$
For any model of practical interest, this integral is completely intractable. For decades, the standard workaround has been to optimize a lower bound, such as the Evidence Lower Bound (ELBO) in Variational Inference (VI). If your ELBO is $-10$, you know the true log-likelihood is at least $-10$.
But this leaves a massive blind spot: is the true value $-9.9$ or $0$? A lower bound alone cannot tell you how much room for improvement remains, nor can it guarantee reliable model selection. If Model A has an ELBO of $-10$ and Model B has an ELBO of $-12$, Model B might still be the superior model if its bound happens to be much looser.
To eliminate this ambiguity, a powerful paradigm has emerged: marginal likelihood sandwiching. By simultaneously estimating a mathematically rigorous lower bound and upper bound, researchers can trap the true marginal likelihood within a verifiable interval, providing an honest certificate of approximation error.
The Blind Spot of One-Sided Bounds
Traditional approximate inference techniques are fundamentally asymmetrical. As noted by Barber et al. and Challis et al., point-estimate approximations and standard variational methods typically offer only a lower bound on the marginal likelihood. Without a corresponding upper bound, it is impossible to determine the tightness of an approximation or to perform robust model comparison.
The intuition behind sandwiching is straightforward: if you can construct an upper bound alongside your lower bound, the distance between them—the "variational gap"—quantifies your exact uncertainty about the model's true performance. This dual-bounding approach dates back to early foundational work by Jaakkola et al., who utilized recursive node elimination to maintain simultaneous upper and lower bounds on probabilities in dense graphical models, proving that dual bounds could provide rigorous confidence intervals where exact computation fails.
Flipping the Divergence: Variational Upper Bounds
How do we actually construct a rigorous upper bound on the log marginal likelihood? The standard ELBO is derived by minimizing the forward Kullback-Leibler (KL) divergence, $D_{KL}(q \parallel p)$. To get an upper bound, we must look to other statistical divergences.
The Chi Upper Bound (CUBO)
In a pair of influential papers, Dieng et al. (2016) and Dieng et al. (2017) introduced CHIVI, a black-box variational inference algorithm that minimizes the $\chi$-divergence from the posterior to the approximating distribution. By swapping the divergence family, the authors derived a novel objective function called the Chi Upper Bound (CUBO).
Unlike the ELBO, which tends to underestimate posterior variance by seeking modes, minimizing the CUBO forces the approximating distribution to cover the entire mass of the posterior. Crucially, combining the CUBO with the traditional ELBO brackets the true marginal likelihood within a specific, verifiable interval.
Generalizing to Rényi and $f$-Divergences
This sandwiching effect is not unique to the $\chi$-divergence. Li et al. introduced the Variational Rényi (VR) bound framework. By optimizing Rényi $\alpha$-divergences, they demonstrated that tuning a single parameter $\alpha$ allows practitioners to smoothly interpolate between standard variational bounds and the exact log-likelihood, enabling the simultaneous estimation of both upper and lower bounds.
Taking this generalization to its logical conclusion, Wan et al. developed $f$-VI, a unified framework extending variational inference to the entire family of $f$-divergences. By deriving a universal variational bound, the authors provided a standardized toolkit to construct sandwich estimates of evidence across diverse statistical divergences.
Stochastic Sandwiching via Bidirectional Sampling
While variational bounds offer deterministic guarantees, they can be difficult to scale to complex, high-dimensional deep generative models. For these architectures, researchers turn to sampling-based sandwiching.
The premier tool for this is Bidirectional Monte Carlo (BDMC), developed by Grosse et al. and applied to deep decoder-based models by Wu et al.. BDMC leverages Annealed Importance Sampling (AIS) running in two opposite directions:
- The Forward Chain: Starts from a simple, known prior and anneals toward the target posterior. Due to Jensen's inequality acting on the stochastic weights, the forward chain provides a stochastic lower bound on the log marginal likelihood.
- The Reverse Chain: Starts from an exact sample of the posterior and anneals back to the prior. Because it originates from the true posterior, its path provides a stochastic upper bound.
When these two independent chains converge to the same value, the sandwich closes, providing an absolute, trustworthy indicator of the exact log-likelihood.
Log-Likelihood Scale
|
|-- Upper Bound (Reverse AIS / CUBO / TUBE)
| |
| | <-- Variational Gap (True Error)
| |
|==== * TRUE MARGINAL LIKELIHOOD * (Intractable)
| |
| |
|-- Lower Bound (Forward AIS / ELBO)
|
Application to Modern Generative Models
Sandwich estimation has become vital for diagnosing whether poor performance in deep generative models stems from architectural flaws or merely loose evaluation metrics.
In the context of Variational Autoencoders (VAEs), Struski et al. combined Jensen's inequality with importance sampling to derive a highly efficient upper bound for the VAE variational gap. This allows practitioners to localize the true log-likelihood of a VAE within a narrow range, enabling high-confidence model comparison without relying on loose approximations.
Similarly, evaluating discrete diffusion language models has historically been plagued by loose bounds. To resolve this, Ivanov et al. introduced TUBE (Tangent Upper Bound on Evidence). By sandwiching the true performance of flexible diffusion models between TUBE and the ELBO, the authors eliminated estimation ambiguity. This dual-bound localization revealed a definitive architectural insight: standard autoregressive models (like GPT) still fundamentally outperform flexible diffusion models in terms of raw data fit.
Why the Sandwich Matters: Validation and Guarantees
Beyond model selection, trapping the marginal likelihood yields a profound theoretical payoff: it allows us to validate the accuracy of the posterior distribution itself.
Historically, variational inference was criticized because it lacked the asymptotic guarantees of Markov Chain Monte Carlo (MCMC). Huggins et al. solved this by showing that the sandwich effect created by calculating both the ELBO and CUBO can be used to derive practical, automated error limits on posterior means and uncertainties. For the first time, practitioners could mathematically prove whether their variational approximations fell within an acceptable tolerance of the true posterior.
The Open Frontier
Despite these successes, a key asymmetry remains in the optimization landscape. As Geffner et al. point out, while the field has become incredibly adept at creating tight, fully differentiable lower bounds (such as via reparameterized Hamiltonian annealing schedules), deriving equally tight, differentiable, and scalable upper bounds remains an open and vital challenge. Closing this optimization gap is the next major frontier in making dual-bound inference a standard component of the deep learning toolkit.
Key Foundational Work
Recursive Algorithms for Approximating Probabilities in Graphical Models (1996) — contributed 1 concept elements to this direction.
Gaussian Fields for Approximate Inference in Layered Sigmoid Belief Networks (1999) — contributed 1 concept elements to this direction.