Why can a deterministic autoencoder not generate realistic new images by sampling from its latent space, and how does the VAE’s KL term fix this? What is posterior collapse in VAEs, when does it happen, and how do β-VAE and KL annealing address it?

Deep learning, Variational autoencoders
Level L4 Advanced. Length Medium. Nature Th Theoretical.

What's being asked

Whether you understand both why VAEs enable generative sampling and the classic optimisation failure mode where the latent code is ignored.

Key idea

A deterministic autoencoder maps training points to isolated islands in latent space, so random samples land in dead zones. A VAE forces posteriors qϕ(z∣x) to overlap smoothly inside N(0,I) via DKL(qϕ(z∣x)∥p(z)); conversely, posterior collapse occurs when the optimiser drives DKL→0 so qϕ(z∣x)≈p(z) and the decoder ignores z.

Steps

  1. Explain why deterministic autoencoders fail at sampling: reconstruction loss alone puts no constraint on where codes lie or whether nearby latent points decode meaningfully, leaving large gaps between encoded training points.
  2. Explain the VAE fix: the ELBO Eqϕ[log⁡pθ(x∣z)]−DKL(qϕ(z∣x)∥p(z)) forces each encoded distribution to have non-zero spread and stay close to the prior p(z)=N(0,I), filling latent space continuously so sampling z∼N(0,I) decodes plausibly.
  3. Define posterior collapse: qϕ(z∣x)=p(z) for every x, making z independent of x (DKL=0). This often happens when the decoder pθ(x∣z) is a powerful autoregressive model (such as PixelCNN or an LSTM) that can model p(x) well on its own, so early in training—when z is noisy—the easiest way to cut the ELBO penalty is to turn off z completely.
  4. Explain mitigations: KL annealing (gradually raising the KL weight from 0 to 1 during training so the encoder–decoder first learns useful codes before the prior pulls them in), β-VAE (weighting the KL term by β: β<1 preserves reconstruction and mutual information against collapse, whereas β>1 trades reconstruction for more factorised, disentangled axes) or "free bits" (clamping per-dimension KL below a floor).

Common mistakes

How long your answer should be

Half a page; 3–4 minutes.

Last checked on 4 December 2026.

Read this

Previous in Deep learning: What does the universal approximation theorem say for networks with one hidden layer, what does it not guarantee, and why are deep networks used anyway?
Next in Deep learning: Why do gradients of the original minimax GAN objective vanish when pdata and pg have disjoint supports, what is mode collapse, and how does the Wasserstein-1 distance in WGAN fix both?