The quality of VI is capped by the family Q: with mean-field or Gaussian families “no solution is ever able to resemble the true posterior distribution,” so, “unlike other inferential methods such as MCMC, even in the asymptotic regime we are unable [to] recover the true posterior” (Rezende & Mohamed 2015, Sec. 1). A normalizing flow enriches the family by pushing a simple base density q0 through a chain of invertible maps fK∘⋯∘f1; the change-of-variables formula keeps the density computable, lnqK(zK)=lnq0(z0)−∑kln∣det∂fk/∂zk−1∣. Choosing maps with O(D) Jacobian determinants (planar and radial flows) gives a scalable, arbitrarily flexible, reparameterizable posterior that drops into the amortized VI training loop unchanged.
Overview
The earlier notes locate VI’s two characteristic failures, under-dispersion and inability to represent correlation, skew or multimodality, in the family rather than the optimizer. Rezende & Mohamed cite Turner & Sahani (2011) for both: variance under-estimation “can result in poor predictions and unreliable decisions,” and limited posteriors “can also result in biases in the MAP estimates of any model parameters” (e.g. in time-series models). Prior remedies were structured mean-field (add some dependencies) and mixture posteriors, the latter requiring likelihood and gradient evaluations per mixture component per update.
Flows attack the problem from the direction ADVI’s optimal-transform result points to. ADVI uses a fixed transform T plus a Gaussian and notes that the ideal T∗=Φ−1∘P(θ∣x) would make the Gaussian exact but is unknowable. A flow learns a parametric transform by maximizing the ELBO; Kucukelbir et al. cite exactly this paper as the way to “improve accuracy” by “a cascade of simple transformations.”
Main Content
Normalizing flow ^def-normalizing-flow
For an invertible smooth f:Rd→Rd and z′=f(z) with z∼q(z),
q(z′)=q(z)det∂z′∂f−1=q(z)det∂z∂f−1
(Eq. 5). Composing K maps, zK=fK∘⋯∘f1(z0),
lnqK(zK)=lnq0(z0)−k=1∑Klndet∂zk−1∂fk
(Eqs. 6-7). “The path traversed by the random variables zk=fk(zk−1)… is called the flow and the path formed by the successive distributions qk is a normalizing flow.” Each map acts as a local expansion (lowering density) or contraction (raising it).
Law of the unconscious statistician for flows ^thm-lotus
EqK[h(z)]=Eq0[h(fK∘⋯∘f1(z0))]
(Eq. 8), with no Jacobian needed when h does not depend on qK. A flow is therefore automatically reparameterized: sample z0 from the base (itself μ+σ⊙ϵ), push it through differentiable maps, and backpropagate. It is the reparameterization trick with a deeper gϕ.
The obstacle is cost: a generic invertible network layer has an O(D3) Jacobian determinant. The paper’s contribution is two map families whose determinant is O(D).
Planar and radial flows ^def-planar-radial
Planar:f(z)=z+uh(w⊤z+b) with λ={w,u∈RD,b∈R} and smooth elementwise h (e.g. tanh). With ψ(z)=h′(w⊤z+b)w, the matrix determinant lemma gives
(Eqs. 10-13). It contracts or expands density perpendicular to the hyperplane w⊤z+b=0. Invertibility with h=tanh requires w⊤u≥−1, enforced by reparameterizing u (Appendix A).
Radial:f(z)=z+βh(α,r)(z−z0) with r=∣z−z0∣, h(α,r)=1/(α+r), and
det∂z∂f=[1+βh(α,r)]d−1[1+βh(α,r)+βh′(α,r)r]
(Eq. 14): contraction or expansion around a reference point z0.
Two successive transformations already turn a spherical Gaussian into a bimodal density (Fig. 1).
(Eq. 15). In the amortized setting an inference network maps x to the base parameters (μ,σ)and to the flow parameters λ. Cost is O(LN2)+O(KD) for L deterministic layers of width N, flow length K and latent dimension D (Sec. 4.3). Training (Algorithm 1) is AEVB with one extra line: zK←fK∘⋯∘f1(z0).
Infinitesimal flows and the asymptotic claim (Sec. 3.2). Letting the flow length go to infinity gives a density evolving under a PDE. For the Langevin flowdz=−∇zL(z)dt+2dξ with L the negative unnormalized log posterior, the Fokker-Planck stationary solution is q∞(z)∝e−L(z), “i.e. the true posterior.” Hamiltonian flow on an augmented space (z,ω) is the dynamics of HMC. This yields a unifying view (Sec. 5): NICE (Dinh et al. 2014) is a finite volume-preserving flow with coupling layers f(z)=(zA,zB+hλ(zA)) and unit Jacobian; Hamiltonian variational inference (Salimans et al. 2015) is an infinitesimal volume-preserving flow that converges to the posterior but needs likelihood gradients at every step, at both training and test time.
Evidence (Sec. 6)
2-D test densitiesp(z)∝e−U(z) with multimodality and periodicity (Table 1): planar flows with K=2,8,32 show “a substantial improvement in the approximation quality as we increase the flow length”; NICE reaches similar asymptotic quality but planar flows need “far fewer parameters” (Fig. 3).
Binarized MNIST, deep latent Gaussian model with 40 latents, bound on −lnp(x) (Table 2): diagonal-covariance baseline ≤89.9; planar NF ≤87.5,86.5,85.7,85.1 for K=10,20,40,80; NICE ≤88.6,87.9,87.3,87.2 for the same K. Increasing flow length “systematically improves the bound” and “reduces the KL-divergence between the approximate posterior q(z∣x) and the true posterior” (Fig. 4).
CIFAR-10 patches, 30 latents (Table 3): the reported −lnp(x) improves monotonically from −293.7 (K=0) to −320.7 (K=10).
Training used an annealed free energy, βt=min(1,0.01+t/10000) multiplying the logp(x,zK) term, which the authors found “to provide better results”: flexible posteriors are harder to optimize.
Used on a fixed-dimensional Bayesian posterior (no encoder), this is “ADVI with a learned transform.” Banana-shaped or funnel-shaped posteriors, the kind produced by multiplicative saturation-times-coefficient terms in a media mix model or by hierarchical scales, are the natural targets.
Practical caveats. A more flexible Q makes the ELBO surface harder (the annealing above; the Bayesian Workflow book: “the richer the family of approximations, the more challenging the optimization”). Reverse KL remains mode-seeking, so a flow can represent several modes but is not guaranteed to find them. Planar flows are weak per layer in high dimension, which is why later architectures (coupling, autoregressive and spline flows; see Normalizing Flows as Conditional Density Estimators) dominate in practice. And a flow posterior still needs the same verification as any other: [[Diagnosing Variational Inference (PSIS k-hat and VSBC)|k^]] works unchanged because qK has a computable density.