← Explainer Library

Interactive Explainer

ELBO, Decomposed

The Evidence Lower Bound is the VAE's loss — and it's just two things added: reconstruction cost and KL to the prior. Watch them fight as you train.

Step 1

The loss

$\mathcal{L} = \underbrace{-\mathbb{E}_{q_\phi(z|x)}[\log p_\theta(x|z)]}_{\text{reconstruction}} + \beta \cdot \underbrace{\text{KL}(q_\phi(z|x) \,\Vert\, p(z))}_{\text{regularizer}}$

$\beta = 1$ gives the classical VAE; $\beta = 0$ degenerates to a plain AE; large $\beta$ pushes toward disentangled latents at reconstruction cost.

Try it

The widget

Train a tiny MNIST VAE in the browser.

Live: two bars (recon + KL), 2D latent scatter, reconstruction grid.

Slider: β from 0 to 50.

Status: scaffold. Implementation pending.

Step 2

What you should see