The bearing, the sensor and the neat ellipse

A rotating machine has begun to vibrate. The monitoring model admits two explanations. The bearing may be degrading, or the sensor may have developed a bias. Either explanation can account for the same reading.

Suppose the engineering team builds a Bayesian model with two hidden variables: degradation and sensor bias. After the latest measurement, the exact posterior has two islands. One island says “high degradation, little bias”. The other says “little degradation, high bias”. Between them lies a low-probability channel where both causes are moderately large. The data do not support that compromise well, because the known physics and the calibration history make it unlikely.

The exact posterior is expensive to compute for every machine, so the team fits one Gaussian. The result is fast, smooth and easy to pass downstream. Its optimiser converges. Its evidence lower bound stabilises. Its covariance matrix prints to six decimal places. Yet the Gaussian must make a structural choice that the exact posterior did not make. It can settle over one island, inflate itself across both, or occupy the unsupported channel between them.

Now ask the operational question: should the machine be stopped? If the fitted Gaussian selects the degradation island, the estimated probability of dangerous wear may be near one. If it selects the bias island, the probability may be near zero. Two runs can achieve effectively the same objective while recommending opposite actions.

Worked scenario

The machine, readings and thresholds in this article are synthetic. They are constructed to expose a mechanism, not reported as a deployment.

The causal problem is that variational inference projects an intractable posterior onto a restricted family under a chosen notion of closeness. The restriction and the notion of closeness decide what geometry disappears. Optimisation then finds a preferred shadow inside that restricted world. A convergence trace can tell us whether the shadow stopped moving. It cannot tell us whether the missing shape mattered to the shutdown decision.

This makes approximation debt different from ordinary numerical error. The debt is not “the posterior is a little wrong”. It is a typed claim about what the approximation cannot represent, what the objective is inclined to ignore, and which downstream quantity may therefore be biased. The debt is tolerable when the decision is insensitive to those losses, observable when diagnostics target them, and unacceptable when an irreversible action depends on untested modes, tails or dependence.

A bimodal posterior, a one-mode Gaussian shadow and two ELBO basins The upper panel plots a bimodal target posterior and a Gaussian approximation over its left mode. The lower panel shows two equally deep optimisation basins reached from different starts. posterior density p(z | x): two live explanations q(z): one tractable shadow low degradation high degradation same objective depth, different mode
Figure 1. Posterior shadow and divergence contours. A restricted Gaussian family cannot preserve two disconnected modes. Reverse-KL optimisation can settle into either basin, so equal objective quality need not imply equal decisions. Synthetic analytic geometry; no empirical deployment data.

Part oneAn approximation is a projection

Bayesian inference begins with a simple accounting rule. A latent quantity z and observed data x have a joint density p(x, z). The posterior divides that joint density by the evidence:

p(z | x) = p(x, z) / p(x), where p(x) = ∫ p(x, z) dz z denotes latent variables, x observed data, and p(x) the normalising integral. The integral couples all possible latent states. It is often the expensive or intractable part.

Variational inference replaces direct posterior calculation with optimisation. Choose a tractable family Q, such as diagonal Gaussians, full-covariance Gaussians, mixtures or normalising flows. Then find the member q closest to the posterior under a divergence. The common choice is the exclusive Kullback-Leibler divergence:

q* = arg minq ∈ Q KL(q(z) || p(z | x)) Q is the permitted approximation family. The optimisation cannot return a shape outside it. The direction of KL also matters because KL is asymmetric.

This formulation turns integration into an optimisation problem, which has enabled scalable methods for graphical models, large data and differentiable probabilistic programmes.[1][2][3] Stochastic variational inference exploits data subsampling, while black-box and automatic-differentiation methods reduce model-specific derivation.[4][5][6] Those are major computational gains. They do not remove the projection.

The best member of a restricted family is still restricted. Running the optimiser longer reduces optimisation error relative to the declared objective. It cannot add a missing mode to a unimodal family, restore dependence to a factorised family, or create tail mass outside the family’s support. This is the first debt distinction: family debt is representational; optimisation debt is procedural.

Why the ELBO helps, and what it cannot certify

The intractable evidence can be rearranged into a computable lower bound and a non-negative gap:

log p(x) = L(q) + KL(q(z) || p(z | x)) L(q) = Eq[log p(x,z)] − Eq[log q(z)]. Increasing L(q), the evidence lower bound or ELBO, decreases the reverse-KL gap when the model, family and parameterisation remain fixed.

The identity is exact. Its interpretation is often overstretched. The posterior term remains unavailable, so the numerical KL gap is normally unknown. The ELBO is useful for comparing candidate parameters within one specified variational problem. It is not a universal quality scale, and it does not directly measure error in a mean, covariance, quantile, tail probability or action. Yao and colleagues make this diagnostic separation explicit: convergence of the variational objective and adequacy of the resulting approximation are different questions.[7]

The evidence decomposed into an ELBO and an unknown KL gap A fixed-height evidence column contains a large teal ELBO region and a coral approximation gap. Three nearby columns show that optimisation raises the ELBO within a family but family enrichment can change the attainable ceiling. one identity, two distinct questions ELBO KL gap current q optimise inside Q best in Q enrich family log p(x) height is conceptual, not a measured likelihood scale
Figure 2. The ELBO is an optimisation instrument, not an adequacy certificate. Raising the bound reduces reverse KL within the chosen family. Changing the family can move the attainable ceiling. Conceptual decomposition from the exact ELBO identity; heights are illustrative.

Negative control: when variational inference is exact

Approximation error is not inevitable merely because the method is called variational. Let the prior be θ ~ Normal(0,1), and observe y ~ Normal(θ,1) with y = 2. Conjugacy gives the exact posterior θ | y ~ Normal(1, 0.5), where 0.5 is the variance. If Q contains all one-dimensional Gaussians and the optimiser reaches the optimum, reverse-KL variational inference recovers that posterior exactly.

This is the necessary negative control. It varies only the relation between target and family. The algorithm has not changed. The divergence has not changed. When the target lies in the family, family debt is zero. When a multimodal or dependent target does not, the debt appears. “Variational inference underestimates uncertainty” is therefore too crude to be a mechanism. Some families under some objectives underrepresent particular uncertainty structures. The structure must be named.

Exact Gaussian posterior and matching variational Gaussian One indigo density curve and one teal dashed curve overlap exactly, demonstrating a case where the target belongs to the variational family. target contained in family exact p(θ | y) optimal q(θ) θ KL(q || p) = 0 at the optimum
Figure 3. A negative control for approximation debt. In the conjugate normal example, the posterior is itself Gaussian. A Gaussian variational family can match it exactly. Derived analytic example; density values are exact up to rendering.

Thought experiment one: vary the family, hold the objective fixed

Take a two-dimensional Gaussian posterior with unit marginal variances and correlation ρ. First fit a full-covariance Gaussian with reverse KL. The target is in the family, so the fit can be exact. Now change only the family to a mean-field Gaussian whose two coordinates must be independent.

For the target covariance Σ = [[1, ρ], [ρ, 1]], the reverse-KL optimum has diagonal variance 1 − ρ² in each coordinate. At ρ = 0.9, the true marginal standard deviation is 1, while the mean-field standard deviation is √0.19, about 0.436. The approximation narrows each coordinate because it cannot rotate its mass along the correlated ridge. It avoids assigning density to combinations that the target regards as implausible by shrinking into the ridge’s centre.

The experiment changes one causal feature. A full-rank family preserves the ellipse; a factorised family replaces it with an axis-aligned shape. Mean-field’s uncertainty loss is the price of deleting dependence, not a mysterious consequence of fast computation. In some models posterior means can remain useful even while variances and covariances are poor, which motivates covariance corrections and sensitivity analysis rather than blanket acceptance or rejection.[8]

Correlated posterior under full-rank and mean-field Gaussian families The left panel shows a tilted target ellipse and an identical full-rank approximation. The right panel shows the same target with a much smaller axis-aligned mean-field ellipse. same target, same divergence, different family full-rank Q q can rotate: exact match mean-field Q q cannot rotate: σ ≈ 0.436 ρ = 0.9; axes are latent coordinates; contours denote equal density
Figure 4. Family restriction creates a specific geometric debt. For a correlated unit-variance Gaussian with ρ = 0.9, full-rank Gaussian VI can match exactly. The reverse-KL mean-field optimum has marginal variance 1 − ρ² = 0.19. Analytic, two-dimensional example.
The argument in one passChart · flow
flowchart TD
  A["The bearing, the sensor and<br/>the neat ellipse"] --> B["Part one An approximation is a<br/>projection"]
  B --> C["Part two The objective chooses<br/>the distortion"]
  C --> D["Part three Useful depends on<br/>the decision"]
  D -. "re-test" .-> A
  classDef first fill:#0a1424,stroke:#B96D00,stroke-width:2px,color:#e6f3ff
  classDef step fill:#0a1424,stroke:#3f7da0,stroke-width:1px,color:#e6f3ff
  class A first
  class B,C,D step
A structural route through Variational Inference and Useful Approximation, from The bearing, the sensor and the neat… to The decision this changes. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Part twoThe objective chooses the distortion

A family defines the shapes available. The divergence defines how errors across the target are priced. These choices interact. It is misleading to speak of “the closest Gaussian” without naming the direction and criterion of closeness.

Exclusive KL, KL(q || p), averages the log density ratio under q. It punishes the approximation for putting mass where the target density is low. It does not directly punish target regions that q never visits. In a separated low-dimensional mixture, a Gaussian can therefore reduce its penalty by occupying one mode and avoiding the low-density valley. This is the familiar mode-seeking intuition.

Inclusive KL, KL(p || q), averages under p. Missing a target mode is costly because the target samples there. A single Gaussian tends to spread across modes and match broad moments. That can be “mass covering”, but it may put substantial probability in the valley that neither mode supports. The two objectives preserve different truths: one protects local plausibility; the other protects global coverage.

Thought experiment two: vary the divergence, hold the family fixed

Let the target be an equal mixture of Normal(−2.5, 0.45²) and Normal(+2.5, 0.45²). Keep Q fixed as all one-dimensional Gaussians. Under reverse KL, a Gaussian centred on either component has divergence close to log 2 because it captures roughly one half of the target density and avoids the valley. Under inclusive KL, the optimal Gaussian matches the mixture’s mean and variance, giving mean 0 and standard deviation about 2.54.

Nothing has become universally more accurate. The reverse-KL fit loses one mode but stays in a supported region. The inclusive fit preserves both-side coverage but invents intermediate mass. If the decision asks “which mechanism is active?”, the broad compromise may be unhelpful. If it asks “could either extreme occur?”, selecting one mode may be unhelpful. The divergence is a loss function over posterior distortions, so it must be selected with the inferential use in view.

The low-dimensional picture also has a boundary. In moderate and high dimensions, mass-covering objectives can become difficult to optimise and need not improve accuracy. Dhaka and colleagues found that more flexible families and transformations can be more effective than simply changing the divergence, though they introduce additional optimisation challenges.[9] The mode-seeking versus mass-covering sketch is a useful local mechanism, not a universal ranking of objectives.

One bimodal target under reverse and inclusive KL Gaussian projections The same target density is shown twice. Reverse KL selects one mode. Inclusive KL uses a broad Gaussian spanning both modes and the unsupported valley. hold Q fixed; change the distortion price KL(q || p) avoids low-p valley one mode omitted KL(p || q) covers both modes valley mass invented indigo: target p; dashed: Gaussian q; density axis shared within each panel
Figure 5. Divergence direction changes which error is cheap. For the same separated mixture and Gaussian family, reverse KL can choose one mode while inclusive KL covers both and the valley between them. Synthetic one-dimensional illustration; the behaviour is not a universal high-dimensional law.

Optimisation failure can imitate approximation failure

The family and divergence define an ideal variational solution. Actual software must still reach it. Stochastic gradient estimates, parameter transformations, initialisation, learning rates and local optima can all produce a poor member of an adequate family. Black-box methods widened the class of models to which VI could be applied, but they also made optimisation behaviour a first-class diagnostic concern.[5] Stan’s current reference documentation, for example, describes Monte Carlo estimates for both the ELBO and its gradients and treats its stochastic convergence test as heuristic.[16]

This creates a three-way diagnosis. A bad result may come from the probabilistic model, which assigns the wrong posterior even under exact inference. It may come from approximation, because the family and objective distort a good posterior. Or it may come from optimisation, because the implemented procedure failed to reach the intended variational optimum. These causes demand different remedies.

Multiple starts help expose separate basins. Richer families test representational restriction. A short trusted sampler can provide an external comparison. Deterministic ADVI replaces a changing stochastic objective with a fixed Monte Carlo approximation, enabling clearer convergence criteria and second-order methods. It does not cure mean-field geometry, but it helps separate optimisation trouble from family trouble.[10]

Failure boundary

Do not let mean-field reverse-KL VI authorise an irreversible action when disconnected modes, dependence or tails control that action and no targeted diagnostic or trustworthy reference calculation is available. In that region, the approximation debt is both material and unmeasured.

A richer family is not free. Full covariance grows quadratically in dimension. Mixtures and flows add parameters, new local optima and harder diagnostics. Importance-weighted objectives can tighten bounds while changing gradient quality. The right question is not whether the family is expressive in principle. It is whether the entire configured method can preserve the needed posterior functional under the available data, compute and validation budget.

This paper therefore sits beside, rather than duplicates, the broader article Optimisation, Approximation and Guarantees. That article asks how an optimised surrogate earns a decision claim. Here the narrower problem is what happens when the object being optimised is itself a compressed posterior.

Part threeUseful depends on the decision

A global divergence can be poor while one posterior mean is accurate. It can be small while a rare-event probability is wrong enough to change an action. “Posterior quality” is therefore incomplete unless the consuming operation is named.

Let g(z) be the posterior functional required downstream. It might be a coordinate mean, a covariance, a rank, the probability that a limit is exceeded, or the expected loss of an action. The useful error is not simply KL. It is the error in Ep[g(z)] relative to Eq[g(z)], together with any uncertainty about that comparison.

This targeted view explains why one approximation can be acceptable for prediction and unacceptable for intervention. If two posterior modes imply similar future observations, posterior predictive checks may look healthy. Yet the modes can imply different latent causes and different actions. Prediction averages over explanations. A maintenance decision may need to distinguish them.

The production-shaped example: two explanations, one reading

Return to the machine. Let degradation be d and sensor bias be b. The latest vibration reading is approximately d + b. Historical evidence favours either a worn bearing with a calibrated sensor or a healthy bearing with a biased sensor. The posterior therefore follows a diagonal ridge but concentrates at two separated regions.

The operational rule stops the machine when P(d > 0.7 | x) exceeds 0.8. A variational fit over the degradation mode may estimate that probability near one. A fit over the bias mode may estimate it near zero. A broad approximation across both may estimate about one half. All three may reproduce the distribution of the observed sum d + b reasonably well.

The negative control here is posterior predictive adequacy. If the only task were predicting the next aggregate vibration under unchanged conditions, the latent distinction might not matter. For a shutdown action tied specifically to degradation, it matters completely. A predictive check cannot certify a causal or decision functional that the observations do not identify in the same way.

Two-explanation posterior for degradation and sensor bias A diagonal ridge contains two posterior islands. A vertical degradation threshold separates the stop region. Two Gaussian approximations over different islands produce opposite shutdown probabilities. same observed vibration, different latent cause stop region d = 0.7 degradation d → sensor bias b → bias explanation wear explanation the likelihood follows d + b; the action follows d alone
Figure 6. Prediction can preserve the sum while losing the cause. Both posterior islands explain the synthetic vibration reading through d + b. The shutdown threshold depends on d, so mode selection changes the action. Worked scenario with dimensionless latent scores and an illustrative threshold.

A decision-indexed approximation contract

Suppose an action a incurs loss ℓ(a, z) when the latent state is z. The exact posterior risk is Rp(a) = Ep[ℓ(a, z)]. The approximate risk is Rq(a) = Eq[ℓ(a, z)]. The variational approximation is decision-sufficient to tolerance ε when:

supa ∈ A |Rp(a) − Rq(a)| ≤ ε A is the permitted action set. ε is an operational tolerance in the same loss units as the decision. If the inequality holds, the action chosen under q has true posterior regret at most 2ε relative to the action chosen under p.

The contract changes the burden of proof. A team no longer needs to show that every aspect of q resembles p. It must show that the aspects which move the permitted decision remain within tolerance. For an estimate-only workflow, that may be a mean. For capacity planning, it may be an upper quantile. For a safety stop, it may be a tail probability under asymmetric loss. For model comparison, it may be evidence or predictive score, which standard reverse-KL approximations can treat differently.

Derivation: why decision regret is bounded by 2ε

Let aq minimise Rq and ap minimise Rp. Add and subtract approximate risks:

Rp(aq) − Rp(ap) = [Rp(aq) − Rq(aq)] + [Rq(aq) − Rq(ap)] + [Rq(ap) − Rp(ap)]

The middle term is non-positive because aq minimises approximate risk. Each outside term is at most ε in absolute value, so true regret is at most 2ε. This is a conditional decision bound, not a method for estimating ε.

Global divergences can sometimes bound functional error under additional regularity, and recent work develops practical posterior error bounds and targeted diagnostics.[11][12] Yet the contract remains useful even when no theorem closes it. An unknown ε stays visible as unknown. It is not silently replaced by zero because the ELBO trace is smooth.

Decision loss as the correct scale for approximation error Two action loss lines cross at a decision threshold. Three posterior tail probability estimates lie on different sides. An epsilon band around the exact value shows which approximations preserve the action. posterior error matters through an action boundary expected loss: keep running expected loss: stop exact p q: bias mode q: wear mode P(d > 0.7 | x) expected action loss ε band must not cross the action boundary
Figure 7. A useful approximation preserves the decision margin. The relevant tolerance is expressed in expected action loss or an equivalent decision statistic. The curves and values are illustrative; no universal shutdown cost or probability threshold is implied.
How the claim changes under pressureChart · state
stateDiagram-v2
  [*] --> Claim
  state "Why the ELBO helps, and what<br/>it cannot certify" as Claim
  state "Negative control: when<br/>variational inference is exact" as Test
  state "Thought experiment one: vary<br/>the family, hold the objective<br/>fixed" as Revision
  Claim --> Test: expose mechanism
  Test --> Decision: evidence survives
  Test --> Revision: rival survives
  Revision --> Claim: narrow or rebuild
  Decision --> [*]
The revision loop begins with Why the ELBO helps, and what it cannot… and keeps counterexamples inside the reasoning path. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Part fourKeep the debt visible

Approximation debt becomes governable when it is represented as an explicit contract rather than a footnote saying “VI was used”. The register below is a practitioner synthesis. It does not create accuracy. It prevents a tractable result from acquiring more authority than its evidence supports.

The smallest useful record names the consuming functional, the geometry required to estimate it, the geometry available in the family, the objective’s likely distortion, the evidence that optimisation succeeded, and the external check that tests adequacy. The record also names an expiry trigger and a fallback. A posterior approximation is then released for a bounded use, not promoted to a general surrogate for truth.

Scroll horizontally within the register to inspect every control field.

Decision quantityRequired posterior geometryVisible debtMinimum checkFallback trigger
Coordinate meanCorrect central mass; dependence may be secondaryBias from skew or missed modeMulti-start plus short reference chain for the meanMean error exceeds declared tolerance
Interval or covarianceMarginal scale and cross-coordinate dependenceMean-field shrinkage; wrong orientationFull-rank comparison, linear-response correction or reference covarianceCoverage or covariance error changes review outcome
Tail probabilitySupport, tails and all decision-relevant modesMode omission; light tailsPSIS or targeted MCMC diagnostic on the tail functionalDiagnostic unreliable or error band crosses action threshold
Ranking or top-kJoint order uncertainty near the cutOverconfident independent scoresPairwise rank stability under richer family and resamplingItems near the cut reorder materially
Predictive densityPosterior predictive, not necessarily latent identifiabilityLatent modes may remain unresolvedHeld-out predictive score plus action-specific checkPrediction passes but action functional remains untested
Figure 8. Approximation debt register. The same variational posterior can be released for one functional and rejected for another. Practitioner synthesis; thresholds must be supplied by the application in its own units.

A release sequence that can refuse the result

The first gate is structural. Does the family have the support, modes, dependence and tail behaviour the decision might require? Transformations can make constrained or strongly skewed posteriors easier to approximate. Full covariance can restore linear dependence. Mixtures or flows can add shape. None should be added ceremonially. Each should answer a named mismatch.

The second gate is optimisation. Run multiple starts where multimodality is plausible. Record gradient behaviour, objective variability and parameter stability. Use a fixed-objective method or more direct optimisation check when stochastic ELBO noise prevents a meaningful stopping claim. If equally good runs disagree on the decision functional, the approximation has not earned a single answer.

The third gate is external. Pareto-smoothed importance sampling examines the tail of importance ratios and can diagnose when samples from q fail to cover p adequately; its modern treatment also provides stabilised estimates and error diagnostics.[13] Variational simulation-based calibration tests average point-estimate behaviour across simulated datasets.[7] TADDAA uses many short parallel MCMC chains to lower-bound error for named posterior functionals, together with a reliability check.[12] Each diagnostic has a scope. A failed reliability condition is a result, not permission to proceed.

The fourth gate compares the decision statistic under the best available references: analytic calculation on a simplified case, short MCMC, importance correction, a richer variational family, or simulation-based calibration. The comparison must be in the statistic’s natural unit. “ELBO improved by 4.2” cannot substitute for “the 99.5th percentile moved by 0.7 mm beyond the safety margin”.

The fifth gate chooses a fallback. A low-consequence exploratory analysis may display the approximation with a warning. A reversible decision may request more evidence. A high-consequence action may escalate to a better sampler, simplify the model, restrict the action set, or abstain. When validation and enrichment cost as much as a more trustworthy inference method, VI has lost its computational reason for being.

A worked Gaussian case: exact fit can be the negative control

Let the target posterior be Normal with mean 1.25 and standard deviation 0.65, and let the variational family contain every one-dimensional Normal distribution. Minimising reverse KL over that family has an exact solution: the variational mean and scale equal the target values. This is the clean negative control because neither family mismatch nor target multimodality is present. If two well-separated initialisations do not recover the same answer, the implementation or optimiser is suspect before approximation theory is blamed.

Now change only the target to an equally weighted mixture of two narrow Normals centred at −3 and +3 while retaining the single-Normal family and reverse-KL objective. The family cannot represent both separated modes without placing substantial mass in the low-density valley. Optimisation commonly settles near one mode. Starts on opposite sides can achieve almost identical objective values while implying opposite answers to the decision question P(z > 0). Agreement on the ELBO has not produced agreement on the action.

The discriminating comparison holds target and data fixed while varying one cause at a time. First use multiple starts with the same family and objective to expose optimisation multiplicity. Then enrich the family with a mixture or flow while keeping the objective. Finally compare a forward-looking diagnostic or reference sampler while keeping the family under study. These interventions separate a solver that missed a good member of the family from a family that cannot carry the required geometry and an objective that rewards the wrong distortion.

Calibrate the functional, not the posterior by reputation

Suppose a maintenance decision shuts a machine down when the posterior probability of unsafe bearing clearance exceeds 0.08. An approximation can reproduce the posterior mean closely and still understate that tail probability. Mean error is then the wrong release metric. The audit must compare the unsafe probability, its numerical uncertainty and the resulting action across the variational approximation and the best available reference.

A practical check begins with simulation in regimes where the data-generating truth is known. For each synthetic dataset, fit the approximation and record the named functional: a quantile, tail probability, interval, rank or expected loss. Coverage and calibration are computed for that functional across repetitions. The test should span easy central cases, weakly identified cases, skew, multimodality and boundary conditions. Average calibration can hide a critical slice, so results remain explicitly stratified by the mechanism that creates approximation debt.

Posterior predictive checks answer a different question. They can reveal that replicated observations fail to resemble relevant features of the data, but a good predictive match does not guarantee that latent dependence, tails or modes are adequate for a particular action. Conversely, poor latent identification may be tolerable when the consuming decision depends only on a well-estimated predictive average. The release claim must state which of these objects is being certified.

Decision thresholds create a margin. If every credible approximation and reference puts the statistic far on the same side of the threshold, residual error may be immaterial for that action. Near the threshold, much smaller numerical differences can reverse the decision. Allocate validation effort accordingly, but do not manufacture confidence by moving the threshold after seeing the approximation. Threshold, tolerance and fallback belong in the contract before the comparison.

The result is deliberately asymmetric. Passing one functional permits that bounded use only. A variational posterior released for ranking ten low-consequence candidates is not automatically released for a rare-event probability, a scientific covariance claim or a safety shutdown. New consumers reopen the approximation-debt record because they may depend on geometry the original check never tested.

Keep the reference comparison reproducible. Store seeds, transforms, initialisations, optimiser settings, diagnostic versions and the exact draw or quadrature budget. Re-run it after a material model, data or library change. If the trusted reference is itself uncertain, propagate that uncertainty into the action comparison and mark the result explicitly unresolved when the combined interval crosses the declared decision threshold. A reference method is bounded evidence with a scope, not an oracle.

A five-gate release path for variational posterior approximations A narrowing path passes through structural, optimisation, external diagnostic, decision and release gates. Side exits lead to transform, enrich, rerun, sample or abstain. release only what the evidence can carry 1 family can represent required geometry 2 optimiser reached a stable solution 3 external diagnostic is reliable 4 decision functional within tolerance 5 bounded release transform / enrich rerun / debug sample abstain decision-scoped approval
Figure 9. A release path with real exits. The process narrows authority as evidence accumulates. Failure at a gate changes the method or action; it does not become an undocumented exception. Practitioner decision instrument.

Executable artefact: the ELBO laboratory

The companion Python programme fits a one-dimensional Gaussian q to two normalised targets using deterministic Gauss-Hermite quadrature and analytic pathwise gradients. Because each target is normalised, the reported ELBO equals −KL(q || p). NumPy is the only dependency.

The positive case is a Normal(1.25, 0.65²) target. It belongs to the Gaussian family, and starts at −2 and +2 converge to the same exact approximation. The negative case is the equal two-mode mixture used above. Starts near opposite modes converge to two solutions with the same ELBO, approximately −log 2, but Pq(z > 0) becomes 0 or 1 while the true probability is 0.5.

The artefact reveals logic that a single convergence plot hides: objective agreement can coexist with decision disagreement. Its boundary is equally important. A one-dimensional mixture does not establish how every modern VI system behaves. It is a controlled counterexample to the inference “same good ELBO implies same useful posterior”.

Run the embedded programme in this page
case,start,mean,sd,ELBO,P_q(z>0),P_true(z>0) normal,-2.0,+1.2500,0.6500,-0.0000,0.9728,0.9728 normal,+2.0,+1.2500,0.6500,-0.0000,0.9728,0.9728 bimodal,-2.0,-2.5000,0.4500,-0.6931,0.0000,0.5000 bimodal,+2.0,+2.5000,0.4500,-0.6931,1.0000,0.5000
Measured output of the deterministic ELBO laboratory The top panel shows exact overlap for the normal target. The lower panel shows two same-ELBO Gaussian fits on opposite modes with tail probabilities zero and one. same code, one positive and one negative case normal target: both starts agree ELBO ≈ 0 P(z > 0) = 0.9728 bimodal target: same ELBO, opposite decisions left start: ELBO −0.6931; tail 0.0000 right start: same ELBO; tail 1.0000
Figure 10. Measured laboratory result. The normal case converges to the exact target from both starts. The separated mixture yields two equal-quality reverse-KL solutions with opposite estimates of P(z > 0). Numbers are reproduced by the supplied NumPy programme.
Complete runnable Python source

Assumptions: Python 3.10 or later and NumPy. Expected output is shown above. The target densities are public synthetic functions; no secrets or external data are used.

#!/usr/bin/env python3
"""A deterministic ELBO laboratory for one-dimensional variational inference.

The target distributions are normalised, so ELBO(q) = -KL(q || p).
The optimiser uses Gauss-Hermite quadrature and analytic pathwise gradients.
Only NumPy is required.
"""
from __future__ import annotations

import argparse
import math
from dataclasses import dataclass
from typing import Callable

import numpy as np

Array = np.ndarray


@dataclass(frozen=True)
class Target:
    name: str
    logpdf: Callable[[Array], Array]
    score: Callable[[Array], Array]
    true_tail_probability: float


def normal_logpdf(z: Array, mean: float, sd: float) -> Array:
    return -0.5 * ((z - mean) / sd) ** 2 - math.log(sd) - 0.5 * math.log(2.0 * math.pi)


def standard_normal_cdf(x: float) -> float:
    return 0.5 * (1.0 + math.erf(x / math.sqrt(2.0)))


def normal_target(mean: float = 1.25, sd: float = 0.65) -> Target:
    def logpdf(z: Array) -> Array:
        return normal_logpdf(z, mean, sd)

    def score(z: Array) -> Array:
        return -(z - mean) / (sd * sd)

    tail = 1.0 - standard_normal_cdf((0.0 - mean) / sd)
    return Target("normal", logpdf, score, tail)


def mixture_target(component_mean: float = 2.5, component_sd: float = 0.45) -> Target:
    means = np.array([-component_mean, component_mean], dtype=float)

    def component_logpdfs(z: Array) -> Array:
        return np.stack(
            [normal_logpdf(z, means[0], component_sd), normal_logpdf(z, means[1], component_sd)],
            axis=0,
        )

    def logpdf(z: Array) -> Array:
        logs = component_logpdfs(z) + math.log(0.5)
        m = np.max(logs, axis=0)
        return m + np.log(np.sum(np.exp(logs - m), axis=0))

    def score(z: Array) -> Array:
        logs = component_logpdfs(z) + math.log(0.5)
        m = np.max(logs, axis=0)
        responsibilities = np.exp(logs - m)
        responsibilities /= np.sum(responsibilities, axis=0)
        component_scores = -(z[None, :] - means[:, None]) / (component_sd * component_sd)
        return np.sum(responsibilities * component_scores, axis=0)

    left_tail = 1.0 - standard_normal_cdf((0.0 + component_mean) / component_sd)
    right_tail = 1.0 - standard_normal_cdf((0.0 - component_mean) / component_sd)
    return Target("bimodal", logpdf, score, 0.5 * (left_tail + right_tail))


@dataclass(frozen=True)
class Fit:
    case: str
    start: float
    mean: float
    sd: float
    elbo: float
    q_tail_probability: float
    true_tail_probability: float


def fit_gaussian_vi(
    target: Target,
    start_mean: float,
    start_sd: float = 0.8,
    steps: int = 2500,
    learning_rate: float = 0.025,
    quadrature_points: int = 80,
) -> Fit:
    nodes, weights = np.polynomial.hermite.hermgauss(quadrature_points)
    eps = math.sqrt(2.0) * nodes
    weights = weights / math.sqrt(math.pi)

    mean = float(start_mean)
    log_sd = math.log(start_sd)
    first_moment = np.zeros(2, dtype=float)
    second_moment = np.zeros(2, dtype=float)
    beta1, beta2 = 0.9, 0.999

    for step in range(1, steps + 1):
        sd = math.exp(log_sd)
        z = mean + sd * eps
        score = target.score(z)
        gradient = np.array(
            [np.sum(weights * score), np.sum(weights * score * sd * eps) + 1.0],
            dtype=float,
        )

        first_moment = beta1 * first_moment + (1.0 - beta1) * gradient
        second_moment = beta2 * second_moment + (1.0 - beta2) * gradient * gradient
        m_hat = first_moment / (1.0 - beta1**step)
        v_hat = second_moment / (1.0 - beta2**step)
        update = learning_rate * m_hat / (np.sqrt(v_hat) + 1e-8)
        mean += float(update[0])
        log_sd += float(update[1])
        log_sd = float(np.clip(log_sd, -5.0, 3.0))

    sd = math.exp(log_sd)
    z = mean + sd * eps
    expected_log_target = float(np.sum(weights * target.logpdf(z)))
    entropy = log_sd + 0.5 * math.log(2.0 * math.pi * math.e)
    elbo = expected_log_target + entropy
    q_tail = 1.0 - standard_normal_cdf((0.0 - mean) / sd)
    return Fit(target.name, start_mean, mean, sd, elbo, q_tail, target.true_tail_probability)


def run_lab(steps: int = 2500) -> list[Fit]:
    fits: list[Fit] = []
    for target in (normal_target(), mixture_target()):
        for start in (-2.0, 2.0):
            fits.append(fit_gaussian_vi(target, start, steps=steps))
    return fits


def print_table(fits: list[Fit]) -> None:
    print("case,start,mean,sd,ELBO,P_q(z>0),P_true(z>0)")
    for fit in fits:
        print(
            f"{fit.case},{fit.start:+.1f},{fit.mean:+.4f},{fit.sd:.4f},"
            f"{fit.elbo:.4f},{fit.q_tail_probability:.4f},{fit.true_tail_probability:.4f}"
        )


def main() -> int:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("--steps", type=int, default=2500, help="Number of Adam updates per fit.")
    args = parser.parse_args()
    if args.steps < 1:
        parser.error("--steps must be positive")
    print_table(run_lab(steps=args.steps))
    return 0


if __name__ == "__main__":
    raise SystemExit(main())

What would weaken this paper’s thesis?

The argument would be weakened by evidence that an ELBO threshold, independent of family and target, reliably bounded every decision-relevant posterior functional across realistic problems. Existing diagnostic work points in the opposite direction: adequacy must be assessed through coverage, importance ratios, simulation or targeted functionals, and even those checks have failure conditions.[7][11][12]

A narrower observation could also weaken a specific debt claim. If richer families, trusted sampling and repeated simulation all agree with a mean-field result on the relevant tail or decision risk, then the suspected dependence or mode debt may be immaterial for that use. The register should close that item rather than preserve scepticism as ritual. Visible debt is meant to be paid or bounded, not displayed forever.

Compact glossary

Approximation debt
A named posterior feature that the configured family and objective may fail to preserve, plus the downstream quantity exposed to that failure.
ELBO
The evidence lower bound, a tractable objective whose gap to log evidence is reverse KL for the declared variational distribution.
Exclusive KL
KL(q || p), weighted under the approximation. In separated low-dimensional targets it can favour a supported mode.
Inclusive KL
KL(p || q), weighted under the target. It penalises missed target regions but can place mass between modes.
Mean-field family
A factorised approximation that treats selected latent coordinates as independent, removing posterior dependence by construction.
Posterior functional
A quantity computed from a posterior, such as a mean, covariance, quantile, tail probability or expected action loss.
The evidence conversationChart · sequence
sequenceDiagram
  participant Q as Question
  participant M as Mechanism
  participant E as Evidence
  participant D as Decision
  Q->>M: The bearing, the sensor and the neat ellipse
  M->>E: Why the ELBO helps, and what it cannot certify
  E-->>M: compare rival explanations
  E->>D: The decision this changes
  D-->>Q: revise scope or act
Question, mechanism, evidence and decision exchange the burdens developed in Variational Inference and Useful Approximation. Reading use: follow the relation, then test it against the surrounding evidence and limits.

The decision this changes

Do not select or release variational inference because it is fast, because its ELBO rose, or because a library reported convergence. Select it when the computational saving is worth a specific, inspectable loss of posterior geometry and when the downstream decision is demonstrably insensitive to that loss.

The architecture changes at the boundary between inference and action. The variational service should not emit an unqualified object called “the posterior”. It should emit the configured family, objective, optimiser evidence, diagnostic results, approved posterior functionals, tolerances, expiry conditions and fallback. A tail probability approved for triage is not automatically approved for shutdown. A mean approved for ranking is not automatically a covariance approved for capital allocation.

The experiment changes too. Start with a negative control where the target belongs to the family. Then vary one source of debt at a time: family, divergence, optimiser, transformation and dimension. Compare the actual functional consumed by the decision. Keep at least one external route to contradiction, such as importance diagnostics, short reference chains, simulation-based calibration or an analytic reduced case.

The governing rule is simple: optimise the approximation, but authorise only the functionals whose error has been bounded or tested. When a required mode, dependence or tail remains unverified, the correct output is not a smoother probability. It is a visible uncertainty about the approximation itself, followed by enrichment, sampling, escalation or abstention.

Variational inference earns its place by converting an otherwise unusable posterior problem into a tractable one. Its speed is real. Its precision is conditional. Keeping the approximation debt visible lets us retain the first without pretending to possess the second.

References

  1. Jordan, M. I., Ghahramani, Z., Jaakkola, T. S., & Saul, L. K. “An Introduction to Variational Methods for Graphical Models.” Machine Learning. Publisher record.
  2. Wainwright, M. J., & Jordan, M. I. “Graphical Models, Exponential Families, and Variational Inference.” Foundations and Trends in Machine Learning. DOI.
  3. Blei, D. M., Kucukelbir, A., & McAuliffe, J. D. “Variational Inference: A Review for Statisticians.” Journal of the American Statistical Association. Author manuscript.
  4. Hoffman, M. D., Blei, D. M., Wang, C., & Paisley, J. “Stochastic Variational Inference.” Journal of Machine Learning Research. Journal page.
  5. Ranganath, R., Gerrish, S., & Blei, D. M. “Black Box Variational Inference.” Proceedings of AISTATS. Proceedings page.
  6. Kucukelbir, A., Tran, D., Ranganath, R., Gelman, A., & Blei, D. M. “Automatic Differentiation Variational Inference.” Journal of Machine Learning Research. Journal page.
  7. Yao, Y., Vehtari, A., Simpson, D., & Gelman, A. “Yes, but Did It Work?: Evaluating Variational Inference.” Proceedings of ICML. Proceedings page.
  8. Giordano, R., Broderick, T., & Jordan, M. I. “Covariances, Robustness, and Variational Bayes.” Journal of Machine Learning Research. Journal page.
  9. Dhaka, A. K., Catalina, A., Welandawe, M., Andersen, M. R., Huggins, J., & Vehtari, A. “Challenges and Opportunities in High-dimensional Variational Inference.” NeurIPS. Author manuscript.
  10. Giordano, R., Ingram, M., & Broderick, T. “Black Box Variational Inference with a Deterministic Objective: Faster, More Accurate, and Even More Black Box.” Journal of Machine Learning Research. Journal page.
  11. Huggins, J. H., Kasprzak, M., Campbell, T., & Broderick, T. “Validated Variational Inference via Practical Posterior Error Bounds.” Proceedings of AISTATS. Proceedings page.
  12. Wang, Y., Kasprzak, M., & Huggins, J. H. “A Targeted Accuracy Diagnostic for Variational Approximations.” Proceedings of AISTATS. Proceedings page.
  13. Vehtari, A., Simpson, D., Gelman, A., Yao, Y., & Gabry, J. “Pareto Smoothed Importance Sampling.” Journal of Machine Learning Research. Journal page.
  14. Kingma, D. P., & Welling, M. “Auto-Encoding Variational Bayes.” Author manuscript.
  15. Minka, T. P. “Expectation Propagation for Approximate Bayesian Inference.” Author manuscript.
  16. Stan Development Team. “Variational Inference.” Stan Reference Manual. Official documentation.