Quant Memo
Advanced

Beta-VAE and Disentanglement

Turning up a single dial in a variational autoencoder's training objective pushes it to encode data using latent variables that each control one independent, human-interpretable factor instead of a tangled mix.

Prerequisites: Variational Autoencoders

A regular variational autoencoder (VAE) learns to compress data — say, images of faces — into a handful of latent numbers and reconstruct the image from them. Nothing forces those numbers to mean anything individually: one latent might blend together hair colour, head tilt, and lighting all at once. Disentanglement is the goal of getting each latent variable to control exactly one interpretable factor — one number for pose, another for smile, another for lighting — so that changing one latent changes one thing about the image.

A VAE's training objective has two competing parts: reconstruct the input accurately, and keep the latent distribution close to a simple prior (usually a standard normal), weighted by a term often written as a β\beta multiplier on that second part. Beta-VAE's entire idea is to increase β\beta above its default value of 11. A larger β\beta squeezes the latents harder toward independence, at the cost of blurrier reconstructions — the model is forced to be economical, and the cheapest way to satisfy that pressure, empirically, is to let each latent grab one clean, independent factor of variation rather than share information across several latents.

Setting β=1\beta = 1 recovers an ordinary VAE; pushing β\beta to, say, 44 or 88 on a face dataset can produce latents that individually control azimuth, skin tone, or smile — verified by fixing every latent but one and sweeping it while watching the decoded image change along a single recognizable axis. The trade-off is real: too high a β\beta degrades reconstruction quality enough that disentangled factors become individually blurry rather than sharp.

Beta-VAE gets disentangled latents for free from one hyperparameter — turning up the weight on the prior-matching term until the model finds it cheaper to encode independent factors than tangled ones, at some cost to reconstruction sharpness.

Related concepts

Practice in interviews

Further reading

  • Higgins et al., beta-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework (2017)
ShareTwitterLinkedIn