Latent-Variable Representations › The Information Bottleneck and Posterior Collapse

Michael BrenndoerferJune 15, 20268 min read
World Models HandbookAll chapters
Part 3 of 12Representing Agents and Worlds
Chapter 15Latent-Variable Representations › The Information Bottleneck and Posterior Collapse
Reading section 4 of 11 · The Information Bottleneck and Posterior Collapse · 8 minSection 4 of 11 · 8 min

Book contents

Section 4 of 11 · 8 min read

Latent-Variable Representations › The Information Bottleneck and Posterior CollapseOne section · Sections in this chapter4 / 11 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

The ELBO can be read as an information-theoretic tradeoff between compression and reconstruction, which makes the strength of the bottleneck an explicit knob. This section develops that reading, introduces the beta-weighted objective, and studies posterior collapse, the silent failure in which the model stops using its latent state.

KL as rate, reconstruction as distortion

The ELBO also has a rate-distortion reading. Define the joint distribution induced by the data and encoder as q(x,z)=pdata(x)q(z∣x)q(x,z) = p_{\text{data}}(x)q(z\mid x), and define its marginal q(z)=∫pdata(x)q(z∣x) dxq(z) = \int p_{\text{data}}(x)q(z\mid x)\,dx, called the aggregated posterior. Let Iq(X;Z)I_q(X;Z) denote mutual information under that induced joint. Averaged over data, the KL term then decomposes as

Epdata(x) ⁣[KL(q(z∣x)∥p(z))]=Iq(X;Z)+KL(q(z)∥p(z)).\mathbb{E}_{p_{\text{data}}(x)}\!\left[\mathrm{KL}(q(z\mid x)\|p(z))\right] = I_q(X;Z) + \mathrm{KL}(q(z)\|p(z)).

The expected KL is therefore an upper bound on the mutual information Iq(X;Z)I_q(X;Z) and serves as an operational rate surrogate; reconstruction error serves as distortion. A β\beta sweep produces achieved operating points, but those points need not lie on the optimal rate-distortion frontier.

This reading matters because a world model need not preserve every pixel equally: required fidelity depends on its likelihood, downstream task, and observation model. A driving simulator may need the positions of cars, the road layout, and the traffic light state without regenerating every leaf on every tree. A bottleneck can squeeze out detail that is irrelevant to those requirements. Bigger, sharper reconstructions are therefore not sufficient evidence of better representations. Detail that the dynamics model must then carry forward is not free; it expands the state the model and planner must process. Task-aware compression can be a contribution to a world model rather than merely a compromise.

For a scalar memoryless Gaussian source with variance σ2\sigma^2, mean-squared-error distortion, and 0<D≤σ20 < D \leq \sigma^2, the optimal curve is R(D)=12log⁡(σ2/D)R(D) = \frac{1}{2}\log(\sigma^2 / D). It is an analytic benchmark for optimal codes, not a guarantee about a trained VAE's sweep.

In[2]:
Code
## Exact Gaussian rate-distortion curve, computed analytically.
## No randomness: sigma_sq is fixed and the distortion grid is a linspace.
import numpy as np

sigma_sq = 1.0
d_grid = np.linspace(
    0.02, 0.95, 60
)  # distortion D (fraction of variance kept as error)
r_curve = 0.5 * np.log(sigma_sq / d_grid)  # rate R(D) in nats

## Mark four valid points on the analytic frontier.
d_marks = np.array([0.05, 0.15, 0.35, 0.7])
r_marks = 0.5 * np.log(sigma_sq / d_marks)
Out[3]:
Visualization
Decreasing analytic curve of optimal rate versus distortion with four marked distortion levels.
The exact rate-distortion frontier for a scalar unit-variance Gaussian source under squared-error distortion. A trained VAE can be compared with this benchmark but need not attain it.

The knob that controls the squeeze is β\beta:

Lβ=Eqϕ(z∣x)[log⁡pθ(x∣z)]−β KL(qϕ(z∣x) ∥ pθ(z)).\mathcal{L}_\beta = \mathbb{E}_{q_\phi(z \mid x)} \big[ \log p_\theta(x \mid z) \big] - \beta\, \mathrm{KL}\big(q_\phi(z \mid x) \,\|\, p_\theta(z)\big).

With β=1\beta = 1 you have the standard VAE. A β\beta-VAE with β>1\beta > 1 charges more for posterior deviation from the prior and can empirically encourage factorized representations in some settings. It does not guarantee disentanglement or semantic factor selection; optimization, decoder capacity, data statistics, and inductive biases determine what survives. Lower β\beta permits a higher achieved rate and often improves reconstruction, but the added information may be useful structure or nuisance detail. Treat β\beta as a swept hyperparameter selected with downstream sufficiency and uncertainty criteria.

Posterior collapse: the silent failure

A particularly consequential VAE failure mode is not bad reconstruction, but the model quietly learning not to use its latents at all.

Posterior collapse

Posterior collapse occurs when the approximate posterior equals the prior for every observation: qϕ(z∣x)=pθ(z)q_\phi(z \mid x) = p_\theta(z). The KL term is then zero, zz carries no information about xx, and the decoder generates from the prior alone. The ELBO is still being optimized, so training looks successful. If zz is the model's only observation-dependent state pathway, collapse leaves that state empty; other recurrent or autoregressive pathways may still carry predictive information.

Collapse can be a stable stationary point, and in some decoder and data regimes an optimum, because the KL is perfectly satisfied while a capable decoder remains competitive without zz. Aggregate loss may look normal. An instrumented log does distinguish collapse: near-zero KL, few active units, and weak decoder sensitivity to latent traversals are direct warnings.

Collapse is common in sequence VAEs with powerful autoregressive decoders because local context can reduce the marginal value of a global latent. It can become self-reinforcing: as the decoder ignores zz, reconstruction gradients reaching the encoder weaken, making recovery difficult, though not mathematically impossible. Optimization schedule and model mismatch matter alongside decoder capacity.

The symptoms are worth memorizing, because they are easy to miss:

  • Per-dimension KL values near zero for most or all latent dimensions.
  • Samples from the prior that look as good as reconstructions, used as a supporting symptom rather than a diagnosis by itself.
  • Latent traversals that change nothing in the decoded output.

Collapse arises from objective incentives interacting with optimization and decoder capacity. Mitigations target one or more of those factors.

  • KL annealing: start with β=0\beta = 0 so the decoder learns to use zz, then ramp β\beta up. Once dependence on zz improves reconstruction, later removal may be less attractive because it incurs a reconstruction penalty.
  • Free bits: replace each KL penalty by max⁡(KLj,λ)\max(\mathrm{KL}_j, \lambda). Below λ\lambda, the penalty is constant and exerts no gradient pressure to shrink further; above it, the usual KL gradient applies. This offers up to λ\lambda nats of penalty-free capacity per dimension, but it does not guarantee that the model uses that capacity.

The effect of the clamp is easiest to see on a concrete set of per-dimension KL values. The next cell uses a fixed, hand-chosen array of hypothetical per-dimension KLs, spanning dead, weakly used, and heavily used dimensions, and applies the free-bits clamp max⁡(KLj,λ)\max(\mathrm{KL}_j, \lambda) with λ=0.5\lambda = 0.5 nats. No model or randomness is involved.

In[4]:
Code
## Hypothetical per-dimension KL values (nats), ordered from dead to healthy.
kl_dims = np.array([0.001, 0.02, 0.08, 0.25, 0.6, 1.4, 2.8, 4.5])
lam = 0.5
kl_clamped = np.maximum(kl_dims, lam)
Out[5]:
Visualization
Grouped bars of raw and clamped per-dimension KL, with a floor line at 0.5 nats.
Free-bits penalty with lambda = 0.5 nats: raw per-dimension KL values and the values charged by max(KL, lambda). Below the floor, the charged penalty is constant and has zero shrinkage gradient.
  • Weaken the decoder: remove skip connections that bypass the bottleneck, reduce decoder capacity, or drop out decoder inputs. This raises the reconstruction cost of collapse and can make informative latents favorable over a practical range of β\beta.

For architectures whose downstream dynamics and planner rely on zz as their observation-dependent state, posterior collapse is an existential risk rather than a nuisance. Collapse empties that state of information about xx. The consequences can compound: the dynamics model learns transitions over an uninformative variable, and the planner optimizes over a state that omits observation-dependent distinctions. Aggregate reconstruction loss may rise, as it does in the high-β\beta sweep below, or it may remain competitive while failing to reveal which downstream information was lost. Architectures with another recurrent or autoregressive state path can retain predictive information even when one stochastic latent collapses, so diagnose every state pathway explicitly. This is why later chapters on world-model architectures treat per-dimension KL and latent-sensitivity probes as standard operating instrumentation.