Nonconjugate Bayesian models may not admit closed-form mean-field coordinate updates. A coordinate-ascent algorithm can instead use local Gaussian approximations for some blocks and Taylor approximations for required expectations. Here, “Laplace-delta” denotes this combined procedure. Ordinary Laplace approximation, Laplace variational inference, delta-method variational inference, and expectation propagation have distinct targets and update rules.
The table identifies the object approximated by each method.
| Name | Basic object |
|---|---|
| Ordinary Laplace approximation | A local Gaussian approximation to a posterior or integral near a mode. |
| Laplace variational inference | A variational update that approximates an intractable coordinate by a local Gaussian form. |
| Delta-method variational inference | Taylor approximations to expectations of nonlinear functions under a variational distribution. |
| Practical Laplace-delta hybrid | A coordinate-ascent scheme that uses Laplace updates for nonconjugate blocks and delta approximations for moments needed elsewhere. |
| Expectation propagation | A separate approximation framework based on local factor approximations and moment matching. |
Expectation propagation constructs local factor approximations through moment matching under its own update scheme. A Taylor approximation to an expectation can be one component of an inference algorithm; that operation alone does not constitute expectation propagation. Naming the algorithm requires specifying the full set of targets and updates.
Coordinate target
Suppose the parameter is partitioned as \(\theta=(\eta,\psi)\) and the variational approximation factorizes as
\[q(\eta,\psi)=q_\eta(\eta)q_\psi(\psi).\]The unrestricted coordinate optimum for \(q_\eta\) satisfies
\[\log q_\eta^\star(\eta) = \mathbb E_{q_\psi}\{\log p(y,\eta,\psi)\} + \text{constant}.\]Define
\[f(\eta)=\mathbb E_{q_\psi}\{\log p(y,\eta,\psi)\}.\]If \(f\) is not in a recognizable conjugate form, a Laplace variational update approximates this coordinate by a Gaussian centered at the maximizer:
\[q_\eta(\eta)\approx N(\hat\eta,H^{-1}), \quad \hat\eta=\arg\max_\eta f(\eta), \quad H=-\nabla^2 f(\hat\eta).\]This approximation is local. It works best when the coordinate target is close to Gaussian around a dominant mode and the negative Hessian is positive definite.
Delta approximations
Other coordinate updates may require expectations such as \(\mathbb E_q[g(\eta)]\). When exact Gaussian moments are unavailable, a second-order delta approximation gives
\[\mathbb E_q[g(\eta)] \approx g(m) + \frac{1}{2}\operatorname{tr}\{\nabla^2 g(m)V\},\]where \(m=\mathbb E_q(\eta)\) and \(V=\operatorname{Var}_q(\eta)\). Exact moments should be used when they are available. The delta method is a local approximation and can be poor for strongly nonlinear functions, high variance, boundary behavior, or tail-sensitive quantities.
Logistic-regression example
For Bayesian logistic regression with prior \(\beta\sim N(0,\tau^2I)\) and outcomes \(y_i\in\{0,1\}\),
\[\log p(\beta\mid y) = \sum_i y_i x_i^\top\beta - \sum_i \log\{1+\exp(x_i^\top\beta)\} - \frac{1}{2\tau^2}\beta^\top\beta + \text{constant}.\]The gradient and negative Hessian are
\[\nabla \ell(\beta)=X^\top(y-p)-\beta/\tau^2,\]and
\[H(\beta)=X^\top W X + I/\tau^2,\]where \(p_i=\operatorname{logit}^{-1}(x_i^\top\beta)\) and \(W_{ii}=p_i(1-p_i)\). A Laplace approximation uses the posterior mode and precision \(H(\hat\beta)\).
stable_logistic <- function(eta) {
ifelse(eta >= 0, 1 / (1 + exp(-eta)), exp(eta) / (1 + exp(eta)))
}
laplace_logistic <- function(X, y, tau = 5, tol = 1e-8, maxit = 100) {
X <- as.matrix(X)
y <- as.numeric(y)
p <- ncol(X)
beta <- rep(0, p)
logpost <- function(beta) {
eta <- drop(X %*% beta)
sum(y * eta - log1p(exp(eta))) - sum(beta^2) / (2 * tau^2)
}
for (iter in seq_len(maxit)) {
eta <- drop(X %*% beta)
prob <- stable_logistic(eta)
grad <- crossprod(X, y - prob) - beta / tau^2
w <- prob * (1 - prob)
precision <- crossprod(X, X * w) + diag(1 / tau^2, p)
step <- backsolve(chol(precision), forwardsolve(t(chol(precision)), grad))
step_scale <- 1
current <- logpost(beta)
repeat {
proposal <- beta + step_scale * drop(step)
if (logpost(proposal) >= current || step_scale < 1e-6) break
step_scale <- step_scale / 2
}
beta <- proposal
if (max(abs(step_scale * step)) < tol) break
}
eta <- drop(X %*% beta)
prob <- stable_logistic(eta)
w <- prob * (1 - prob)
precision <- crossprod(X, X * w) + diag(1 / tau^2, p)
covariance <- chol2inv(chol(precision))
gradient <- drop(crossprod(X, y - prob) - beta / tau^2)
list(mode = beta, precision = precision, covariance = covariance,
gradient = gradient, iterations = iter)
}
This is an ordinary Laplace approximation for one nonconjugate block. In a larger variational algorithm, the same calculation could be used as the coordinate update for a nonconjugate factor after taking expectations over the other factors.
A coordinate-ascent algorithm repeats the block calculation while holding other factors at their current variational distributions, then updates the remaining factors using the resulting moments. Iteration continues until the evidence lower bound or a specified surrogate meets its stopping criterion. Identify each approximation in this sequence: the local Gaussian construction approximates a coordinate target, and the delta method approximates expectations without available closed forms.
These stages can be checked separately. An unstable mode requires investigation of the objective, derivatives, and optimizer. Inaccurate moments with a stable mode may indicate a limitation of the delta approximation. Underestimated uncertainty can also arise from the mean-field factorization, even when the local calculations are numerically stable.
The block below provides a small executable check. It simulates a logistic-regression dataset, computes the local Gaussian approximation, verifies that the gradient is small at the returned mode, and checks that the local precision matrix is positive definite.
set.seed(42)
n <- 120
X <- cbind(1, rnorm(n))
beta_true <- c(-0.4, 1.1)
prob <- stable_logistic(drop(X %*% beta_true))
y <- rbinom(n, size = 1, prob = prob)
fit <- laplace_logistic(X, y, tau = 5)
stopifnot(max(abs(fit$gradient)) < 1e-6)
stopifnot(min(eigen(fit$precision, symmetric = TRUE, only.values = TRUE)$values) > 0)
Diagnostics
A Laplace-delta routine should record the numerical checks for each approximated block, in addition to posterior means and variances. These include:
- maximum absolute gradient at the mode;
- positive definiteness of the local precision matrix;
- number of Newton or quasi-Newton iterations;
- line-search reductions;
- sensitivity to initialization;
- comparison with MCMC or direct quadrature on small cases;
- simulation-based calibration when the method is used repeatedly.
The approximation can fail under multimodality, skewness, weak curvature, boundary modes, heavy tails, strong posterior dependence, or nonlinear moments evaluated far from the local mean. Mean-field factorization can also remove dependence that is essential for uncertainty in downstream summaries.
Test the implementation on cases where direct optimization, quadrature, or MCMC provides a comparison. Assess mode estimates and uncertainty summaries separately before using the approximation in a larger model. A local Gaussian approximation may describe concentration near one mode while estimating tail probabilities or weakly identified components poorly; validation should address whichever summaries the analysis reports.
What to report
Report the factorization, coordinate target, local Gaussian construction, and expectations approximated by the delta method. Include the diagnostic results and any comparisons with other inference methods. State the posterior features for which the approximation was assessed, particularly if the conclusions depend on tail behavior, dependence between blocks, or multiple modes.
References
- Wang, C. and Blei, D. M. “Variational inference in nonconjugate models.” Journal of Machine Learning Research.
- Bishop, C. M. Pattern Recognition and Machine Learning.