Back to paper library
Paper notesICLR 2017

β-VAE

Now in Beta

Original paper

beta-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework

Paper authors

Irina Higgins · Loic Matthey · Arka Pal …

Show all 8 authors

Irina Higgins · Loic Matthey · Arka Pal · Christopher Burgess · Xavier Glorot · Matthew Botvinick · Shakir Mohamed · Alexander Lerchner

Publication
ICLR 2017Conference
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@inproceedings{imagegenerationbetavae2017,
  title = {{beta-VAE: Learning Basic Visual Concepts with a Constrained Variational Framework}},
  author = {Irina Higgins and Loic Matthey and Arka Pal and Christopher Burgess and Xavier Glorot and Matthew Botvinick and Shakir Mohamed and Alexander Lerchner},
  year = {2017},
  booktitle = {ICLR},
  url = {https://openreview.net/forum?id=Sy2fzU9gl}
}
On this page

Feed a photo of a face into a VAE's encoder and you get a latent vector. Hold the other dimensions fixed, push just one of them slowly from −3 to 3, and decode each step into an image. What would you hope to see?

Ideally only one thing changes, say the head slowly turning, and nothing else moves. Try it with an ordinary VAE, and as the head turns, the smile disappears, glasses show up, and even the gender changes. Each dimension of the latent space mixes several factors together; such a representation is called entangled.

In November 2016, eight authors from DeepMind proposed that changing a single coefficient is enough for a VAE to pull these factors apart on its own. The coefficient is called β, and with β equal to 1 it is the original VAE.

This note first looks at how β is derived from a constraint and how the authors "measure" disentanglement, then at the problems later research found in each of the two.

Defining the Problem

What disentanglement means

The paper adopts the definition of Bengio et al. from 2013. In a disentangled representation, a single latent unit is sensitive only to a single generative factor and relatively invariant to changes in the others.

Take a dataset of 3D objects, where each image is determined by factors such as object identity, position, size, lighting and color. A disentangled model uses one dimension for position and one for size, and they don't interfere with each other; its decoder works like a rendering engine, and its encoder does the reverse job, inferring the scene parameters back from the image. The authors cite Lake et al.'s view that such representations help with transfer learning, with recombining learned factors to understand things never seen before, and with detecting anomalies.

Where existing approaches got stuck

Approaches at the time fell roughly into three groups.

  • Methods that need to know the factors in advance. Most earlier work needed to know beforehand how many factors there were and what they were. Semi-supervised methods like DC-IGN needed training batches prepared so that "only one factor changes," telling the model which dimension is responsible for which factor. Real data mostly lacks that kind of information.
  • InfoGAN. InfoGAN, from 2016, was one of the few unsupervised approaches of the time that scaled. It picks out part of a GAN's noise variables and maximizes the mutual information between them and the generated image. The authors point out three problems with it. GAN training is unstable and sample diversity can drop; performance is sensitive to the prior and to the number of regularized variables, which still amounts to knowing in advance what the data looks like; and there is no proper inference network, so it is hard to infer latent variables back from images.
  • The original VAE. It shows some disentanglement on simple data such as FreyFaces and MNIST, but fails on complex data.

There was also a more basic gap. At the time there was no general method for quantifying "how disentangled" a representation is, so different models couldn't be compared, and there was no way to choose the hyperparameters of a given model.

So this paper has two questions to answer. Can a VAE learn disentangled representations with just one added hyperparameter? And how do you measure disentanglement?

Solving the Problem

Deriving β from a constraint

The authors think of the data as produced by a simulator. An image x∈RNx\in\mathbb R^N is determined by two sets of factors, a conditionally independent set v∈RKv\in\mathbb R^K and a possibly correlated set w∈RHw\in\mathbb R^H, with xx coming from Sim(v,w)\mathrm{Sim}(v,w). We want to learn latent variables z∈RMz\in\mathbb R^M (M≥KM\ge K) such that p(x∣z)p(x\mid z) approximates this simulator, with certain dimensions of zz lining up exactly with the individual factors of vv.

Step one is to maximize the reconstruction log-likelihood as usual, but with a constraint on the approximate posterior (Eq. 2 of the paper):

max⁡ϕ,θ Ex∼D[Eqϕ(z∣x)[log⁡pθ(x∣z)]]s.t.KL(qϕ(z∣x) ∥ p(z))<ϵ\begin{aligned} &\max_{\phi,\theta}\ \mathbb E_{x\sim D}\Big[\mathbb E_{q_\phi(z\mid x)}\big[\log p_\theta(x\mid z)\big]\Big]\\ &\text{s.t.}\quad \mathrm{KL}\big(q_\phi(z\mid x)\,\|\,p(z)\big)<\epsilon \end{aligned}

The prior is an isotropic standard Gaussian p(z)=N(0,I)p(z)=\mathcal N(0,I). ϵ\epsilon is the limit on how far zz may stray from the prior and can be read as a cap on the information in the latent channel (in nats). The authors want this constraint to do two things at once, limiting how much information zz can carry and using the isotropy of the prior to push the dimensions toward independence.

The formulas ahead get long, so give the two terms short names first. Write the reconstruction term as R=Eqϕ(z∣x)[log⁡pθ(x∣z)]R=\mathbb E_{q_\phi(z\mid x)}\big[\log p_\theta(x\mid z)\big] and the KL term as D=KL(qϕ(z∣x) ∥ p(z))D=\mathrm{KL}\big(q_\phi(z\mid x)\,\|\,p(z)\big).

Step two uses the KKT conditions to move the constraint into the objective, as a Lagrangian (Eq. 3):

F(θ,ϕ,β;x,z)=R−β (D−ϵ)\mathcal F(\theta,\phi,\beta;x,z)=R-\beta\,(D-\epsilon)

β\beta is the KKT multiplier. The further the KL exceeds the limit, the heavier the penalty.

Step three expands the parentheses:

F=R−βD⏟L+βϵ\mathcal F=\underbrace{R-\beta D}_{\mathcal L}+\beta\epsilon

The KKT dual feasibility condition requires β≥0\beta\ge0, and ϵ≥0\epsilon\ge0, so βϵ≥0\beta\epsilon\ge0 and F≥L\mathcal F\ge\mathcal L. βϵ\beta\epsilon doesn't depend on the network parameters, so for a fixed β\beta, maximizing F\mathcal F is the same as maximizing L\mathcal L. Writing RR and DD back out, this L\mathcal L is the β-VAE objective (Eq. 4):

L(θ,ϕ;x,z,β)=Eqϕ(z∣x)[log⁡pθ(x∣z)]−β KL(qϕ(z∣x) ∥ p(z))\begin{aligned} \mathcal L(\theta,\phi;x,z,\beta) &=\mathbb E_{q_\phi(z\mid x)}\big[\log p_\theta(x\mid z)\big]\\ &\quad-\beta\,\mathrm{KL}\big(q_\phi(z\mid x)\,\|\,p(z)\big) \end{aligned}

Compared with the VAE's evidence lower bound, the only difference is the β\beta in front of the KL. β=1\beta=1 is the original VAE; the authors argue that disentanglement requires β>1\beta>1, a tighter bottleneck than before. Their hypothesis is that limited capacity, combined with the pressure to maximize likelihood, forces the model to find the most efficient representation; and since the data is generated by a few independent factors in the first place, the most efficient representation is one dimension per factor.

What does the size of β\beta mean? Appendix A.7 offers an interpretation. Solve for the optimal parameters at a fixed ϵ\epsilon and call the optimal reconstruction value G(ϵ)G(\epsilon); then

∂G∂ϵ=β∗(ϵ)\frac{\partial G}{\partial \epsilon}=\beta^*(\epsilon)

β\beta is the rate at which the optimal reconstruction value rises as the limit is relaxed. With β=4\beta=4, for example, relaxing the KL limit by 1 more nat at the optimum raises the reconstruction log-likelihood by only about 4 nats. Put the other way around, a piece of information goes into zz only if every extra nat of KL it takes up raises the reconstruction log-likelihood by more than β\beta nats. The larger β\beta, the tighter the limit, and only the information that helps reconstruction most gets into zz.

The cost is written into the formula too. As the bottleneck tightens, high-frequency details are the first to go and reconstructions get blurry; so the authors say plainly that the data log-likelihood is a poor metric for evaluating disentanglement in β-VAE, and another metric is needed.

Comparing β across datasets

The experiments use β anywhere from 4 to 250. The numbers differ so much because the reconstruction term is a sum over all pixels and the KL is a sum over all latent dimensions, so the scale of each side changes with the input size NN and the latent dimension MM. Appendix A.6 assumes that pixels are conditionally independent given zz and latent dimensions are conditionally independent given xx, divides both sides of Eq. 4 by NN, and multiplies the KL term by M/MM/M:

L ∝ Eq En[log⁡pθ(xn∣z)]−βMN Em[KL(qϕ(zm∣x) ∥ p(zm))]\begin{aligned} \mathcal L\ \propto\ &\mathbb E_{q}\,\mathbb E_n\big[\log p_\theta(x_n\mid z)\big]\\ &-\frac{\beta M}{N}\,\mathbb E_m\Big[\mathrm{KL}\big(q_\phi(z_m\mid x)\,\|\,p(z_m)\big)\Big] \end{aligned}

This becomes the "average reconstruction per pixel" minus the "average KL per latent dimension" times βnorm=βM/N\beta_{\text{norm}}=\beta M/N. Converting each experiment in the paper:

DataInput NNMMββ_norm
2D shapes4,0961040.0098
2D shapes (VAE)4,0961010.0024
3D chairs4,0963250.039
3D faces4,09632200.16
CelebA12,288322500.65

Compiled for this note, converted using the definition in Appendix A.6 of the paper and the architecture tables in its appendix.

After conversion, CelebA is still the largest at 0.65, while 2D shapes is only 0.0098. Normalization lets inputs of different sizes be compared on the same scale, but the best value still varies with the data, which will become clearer when we get to the heat map.

How to measure disentanglement

The metric in Section 3 starts by asking what properties a disentangled representation should have.

If the simulator's factors are independent, it can draw a small green apple, and it can draw a large red apple. In a representation disentangled with respect to these factors, each factor occupies its own dimensions, and even the simplest linear classifier can classify robustly; a classifier that looks only at shape won't be thrown off by changes in size or color.

Independent dimensions alone aren't enough. PCA and ICA can both project data onto mutually independent bases, but those bases don't necessarily line up with the generative factors, and you can't read any meaning off them. So simply computing the correlations between latent dimensions can't serve as a disentanglement metric either. The authors' metric has to check independence and interpretability at the same time.

The procedure goes like this:

  1. Draw a factor yy uniformly from the KK factors, say "size".
  2. Repeat LL times: draw two sets of factors v1v_1 and v2v_2 that share the same value of factor yy, with the other factors random; render x1x_1 and x2x_2 with the simulator, feed them to the encoder, take the posterior means z1=μ(x1)z_1=\mu(x_1) and z2=μ(x2)z_2=\mu(x_2), and compute the per-dimension difference zdiff=∣z1−z2∣z_{\text{diff}}=|z_1-z_2|.
  3. Average the LL differences into z^diff\hat z_{\text{diff}} and hand it to a linear classifier that guesses which factor was held fixed. The classification accuracy is the disentanglement score.

Think it through with the four factors of 2D shapes (horizontal position, vertical position, size, rotation). Suppose the model is perfectly disentangled and one dimension handles only size. In a batch of pairs with size held fixed, the difference in the size dimension is 0 every time, while the other useful dimensions are above 0 because their factors are changing; after averaging, "which dimension is closest to 0" points straight at size as the fixed factor. Unused dimensions are close to 0 no matter which factor is fixed, and the classifier quickly learns to ignore them.

If the representation is entangled, say one dimension handles both position and size, then with size held fixed that dimension still wobbles as position changes, and the classifier has a hard time telling.

Each design detail has its reason. The classifier is linear, with a low VC dimension, so it can't do nonlinear disentangling of its own and inflate the representation's score. Taking the difference of two samples reduces the variance of the input and the dependence on any particular image xx.

Appendix A.4 spells out a few more settings. The classifier is a fully connected linear layer with softmax, trained to convergence with Adagrad at learning rate 0.01; yy is drawn from only four factors, and shape is not among them; the score is the accuracy on 5,000 test samples. Each model is trained as 10 replicas, and each replica is scored once with each of 3 classifier initializations; of the 30 scores, the bottom half is thrown away and the rest reported, to "control for the outlier results from the few experiments that diverged during training" (a few, as in half). The rule applies to every model, so the comparison is still fair; just remember when reading the error bars in the table that they come from the filtered top half. As for how many pairs (LL) go into each sample and how many samples make up a batch, the paper doesn't say.

Discussion

Faces, chairs and 3D faces

The qualitative experiments use three datasets: CelebA (64×6464\times64 color faces), 3D chairs (CAD renderings of chairs) and 3D faces (synthetic faces). The network is four 4×44\times4 convolutions with stride 2 (32, 32, 64, 64 channels) followed by a fully connected layer of 256, with 32 latent dimensions and a decoder of transposed convolutions mirroring it; chairs and 3D faces use Bernoulli outputs and CelebA uses Gaussian outputs, all trained with Adam at learning rate 10−410^{-4}.

Latent traversal comparison on CelebA. The three columns are β-VAE, VAE and InfoGAN, and the three row blocks are (a) azimuth (head turning), (b) emotion (smile) and (c) fringe. Each block has five rows of seed images, and each row of seven shows the decoded results as a single latent dimension is pushed from one end to the other. β-VAE's images are blurrier, but within each block roughly only one thing changes; in VAE's head-turning block, the faces also change expression, gain glasses or change gender; InfoGAN's images are sharper and are taken from the original InfoGAN paper.
Original Figure 1, Higgins et al., from PDF page 2, scholarly quotation.

Read this figure one block at a time. Each block corresponds to one latent dimension and each row is a different seed image; the encoder first infers the image's latent vector, the other dimensions are held fixed, and only this one is pushed from −3 to 3. InfoGAN has no encoder, so its rows come from randomly sampled noise, and its images are taken directly from the original InfoGAN paper.

CelebA uses β=250. In the β-VAE column, the five faces in (a) only turn their heads, in (b) only the smile changes, and in (c) only the fringe grows. The VAE column's head-turning block is already a mess. In the second row, sunglasses appear as the head turns, and in the first row even the gender has changed by the end; the paper says the VAE's emotion dimension is also tangled up with hairstyle, skin color and identity, and its fringe dimension also controls baldness and head size.

The cost is visible too. β-VAE's faces are noticeably blurrier than the VAE's, and the background is smeared almost into a single patch.

Latent traversal comparison on 3D chairs. The four columns are DC-IGN, InfoGAN, β-VAE and VAE, and the three rows are (a) azimuth, (b) width and (c) leg style. DC-IGN is marked Factor not learnt in the width and leg rows, and InfoGAN is marked Factor not learnt in the leg row. β-VAE has all three rows: the chair rotates, goes from wide to narrow, and its legs change between four legs and a single-pillar base. In the VAE's width and leg rows, the chair's width, style and angle change together.
Original Figure 2, Higgins et al., from PDF page 3, scholarly quotation.

Chairs use β=5. Azimuth has labels in the data, and every model except the VAE learned it. Width and leg style have no labels. DC-IGN, a semi-supervised method, can only learn labeled factors, so both of its rows read "Factor not learnt"; InfoGAN found width but not leg style; β-VAE found all three in a single model. The VAE mixes width and leg style into the same dimension. The paper also makes a point of noting that β-VAE can generate an armchair with a round office-chair base, even though such armchairs don't exist "in the dataset (or, perhaps, reality)."

3D faces use β=20. All four models learn lighting and elevation; on azimuth, DC-IGN and the VAE can't rotate continuously, while β-VAE can, and it also covers the widest range of angles.

This comparison has a limitation. The InfoGAN and DC-IGN figures are taken from their own papers, with different seeds, resolutions and traversal ranges; the authors even note in the caption that InfoGAN's traversal range is [−1, 1]. It is a curated qualitative comparison, and the quantitative part comes in the next section.

2D shapes: the quantitative comparison

To have exact answers to check against, the authors built their own synthetic dataset: 737,280 binary 64×6464\times64 images, drawn from every combination of shape (heart, oval, square), 32 horizontal positions, 32 vertical positions, 6 sizes and 40 rotations (covering 2π2\pi), with adjacent values differing as little as possible in pixel space. Apart from these five independent factors there are no nuisance factors at all. The dataset was later released under the name dSprites and became one of the standard test sets in disentanglement research.

The β-VAE here is a fully connected network. The input is flattened to 4,096 dimensions, the encoder has two layers of 1,200, the latent has 10 dimensions, and the decoder has three layers of 1,200 followed by 4,096 Bernoulli outputs, trained with Adagrad, with β=4. The VAE and the untrained VAE use the same architecture.

On the left, a table of the disentanglement metric on 2D shapes: Ground truth 100%, Raw pixels 45.75 ± 0.8%, PCA 84.9 ± 0.4%, ICA 42.03 ± 10.6%, DC-IGN 99.3 ± 0.1%, InfoGAN 73.5 ± 0.9%, VAE untrained 44.14 ± 2.5%, VAE 61.58 ± 0.5%, β-VAE 99.23 ± 0.1%. On the right, a heat map with latent size 10 to 200 on the horizontal axis and normalized β (0.002 to 10) on the vertical axis; darker means a higher score, and the orange box marks roughly unnormalized β = 1. A dark band runs from the lower left to the upper right, and the region above it, where β is too large, is pale. On the far right are an original image and reconstructions under three settings: blurry at high β, sharp at very small β.
Original Figure 6, Higgins et al., from PDF page 9, scholarly quotation.

Start with the table on the left. Ground truth uses the simulator's factors directly as the representation, so 100% is the ceiling. β-VAE gets 99.23%, on par with the semi-supervised DC-IGN (99.3%), while the original VAE gets only 61.58%. InfoGAN's 73.5% comes from the authors' own training; the paper says that "despite our best efforts" they could not get it to disentangle rotation, size and shape.

The table has another number that is easy to skip over. PCA scores 84.9%, higher than both the VAE and InfoGAN. The metric only looks at "which dimensions go quiet when a factor is held fixed," and a linear projection can naturally gather quite a few factors into a handful of components, so a score in the 80s isn't hard to get; the 99% of β-VAE and DC-IGN is where they pull away from the other methods.

Appendix A.5 adds another check, predicting each factor's value directly with a linear classifier. β-VAE has the highest average accuracy at 43.04%, followed by PCA at 41.25% and DC-IGN third at 40.03%; but PCA is best on horizontal and vertical position (60.66% and 60.15%, against β-VAE's 52.25% and 49.5%), and every model does poorly on rotation, with even the best, β-VAE, reaching only 20.36% (40 classes).

How large should β be?

The heat map on the right of Figure 6 answers how to choose β. The horizontal axis is the number of latent dimensions (10 to 200), the vertical axis is normalized β, the color is the normalized metric score, and the orange box marks roughly unnormalized β=1.

  1. β can't be too large or too small. Fix the number of latent dimensions and look up along the vertical axis: the score first rises, then falls, an inverted U. With β too small, the channel has too much capacity, the model doesn't have to choose what information to keep, and the representation is entangled; with β too large, the capacity is smaller than the number of factors, several factors have to be squeezed into the same dimension, and the representation is necessarily entangled too.
  2. More latent dimensions need a larger β. The dark band runs from the lower left to the upper right.
  3. Sharper reconstructions tend to come with more entangled representations. The small images on the right are reconstructions under three settings. At very small β the reconstruction is sharpest, but the representation is entangled; well-disentangled settings tend to reconstruct blurrily. The authors therefore suggest that when β-VAE is used as an unsupervised feature learner, there's no need to chase perfect reconstruction; they also say, though, that it's often possible to find an architecture and a β that get both.

As for how to choose, the authors offer two routes. If you have labels for a small subset of the factors, sweep hyperparameters with the disentanglement metric; with no labels at all, eyeball the traversal plots. On 2D shapes, the two methods picked very similar values of β.

Appendix A.8 has one more observation. Making the factor sampling of 2D shapes sparser, so that neighboring images differ more, lowers the disentanglement score, and this still holds after re-tuning; keeping continuity but using only about 55% of the data still yields disentangled representations. Sampling the data densely enough along its factors seems to be one of the prerequisites for disentanglement.

What each dimension stores

Latent analysis of two models on 2D shapes. A is β-VAE (β = 4), with six columns, in order z2, z6, z1, z5, z7 and an unused dimension. The top three rows are mean responses: z2 shows a smooth gradient over vertical position and z6 over horizontal position, z1 rises monotonically with size, and z5 and z7 oscillate with rotation, most visibly for green (oval). The bottom five rows are reconstructions as a single dimension is pushed from 3 to −3: the shape moves up and down, moves left and right, shrinks from large to small, and rotates in place, while the last column doesn't change. At the very bottom, the learned variances are 0.08, 0.08, 0.22, 0.50, 0.51, 0.99, labeled pos. Y, pos. X, scale, rotation, rotation. B is the VAE (β = 1): the position responses of z4, z10, z1, z2, z9 are mixed patches of color, and in the traversals the shape changes position and size at the same time; the variances are 0.07, 0.13, 0.18, 0.18, 0.47, 0.99.
Original Figure 7, parts A and B, Higgins et al., from PDF page 10, scholarly quotation.

This figure lays out what each dimension of β-VAE learned. Each column is a latent dimension, sorted by its learned posterior variance.

The top three rows are mean responses. The first row places the object at each of 32×3232\times32 positions and shows how this dimension's mean changes; the second and third rows plot curves against size and rotation, with red, green and blue for square, oval and heart. In group A, z2z_2 responds only to vertical position, z6z_6 only to horizontal position, and z1z_1 rises monotonically with size. z5z_5 and z7z_7 oscillate with rotation, and the frequency of the oscillation matches each object's rotational symmetry: a heart takes 2π2\pi to come back to its original orientation, an oval π\pi, a square π/2\pi/2. These two dimensions look like they are recording the cos and sin of the rotation angle.

The bottom five rows are traversals. Again pushing one dimension from 3 to −3, the shapes in group A move up and down, move left and right, shrink, and rotate, in that order; the last column is unused and doesn't move when pushed. The VAE in group B is different. The paper says every dimension except the rotation one handles at least two factors at once, and in the traversals the shape changes size as it moves.

The row of variances at the bottom can be read too. The unused dimension has a variance of 0.99, almost the prior itself; the two position dimensions have only 0.08. We can think of each dimension as a noisy channel, where the signal the encoder sends is the posterior mean μj\mu_j and the noise is σj2\sigma_j^2. If each dimension's aggregated posterior is close to a standard normal and σj2\sigma_j^2 is about the same for every image, the signal variance is 1−σj21-\sigma_j^2, and the information this dimension carries is

I(x;zj)=h(zj)−h(zj∣x)=12log⁡(2πe)−12log⁡(2πe σj2)=−12log⁡σj2\begin{aligned} I(x;z_j)&=h(z_j)-h(z_j\mid x)\\ &=\tfrac12\log(2\pi e)-\tfrac12\log(2\pi e\,\sigma_j^2)\\ &=-\tfrac12\log\sigma_j^2 \end{aligned}

Plugging in the numbers from group A gives about 1.26 nats for each position dimension, 0.76 for size, about 0.35 for each of the two rotation dimensions, and 0.005 for the unused one. The five useful dimensions add up to about 4 nats. Telling all 737,280 images apart one by one would take ln⁡737,280≈13.5\ln 737{,}280\approx13.5 nats. This estimate rests on the assumptions just made and is only good for the order of magnitude; but it shows why β-VAE's reconstructions are bound to be blurry. zz can hold less than a third of the information, and it gives priority to position.

How later work saw it

After this paper, disentanglement became a hot topic, and β-VAE's derivation and metric were examined again and again.

The first thing to be taken apart was the KL term itself. In 2018, Chen et al. (β-TCVAE) averaged the KL over the whole dataset and split it into three terms (q(z)q(z) is the average of all data points' posteriors, called the aggregated posterior):

Ep(x)[KL(q(z∣x) ∥ p(z))]=Iq(x;z)+KL(q(z) ∥ ∏jq(zj))+∑jKL(q(zj) ∥ p(zj))\begin{aligned} &\mathbb E_{p(x)}\big[\mathrm{KL}(q(z\mid x)\,\|\,p(z))\big]\\ &\quad=I_q(x;z)+\mathrm{KL}\Big(q(z)\,\Big\|\,\textstyle\prod_j q(z_j)\Big)\\ &\qquad+\textstyle\sum_j\mathrm{KL}\big(q(z_j)\,\|\,p(z_j)\big) \end{aligned}

The first term is how much information zz carries about xx; the second, called total correlation, measures how dependent the dimensions are on one another; the third keeps each dimension close to the prior. β multiplies the whole KL, so all three terms get amplified together. What actually drives the dimensions toward independence is the second term; amplifying the first only makes zz carry less information and reconstructions blurrier. FactorVAE (Kim and Mnih) and β-TCVAE, from the same year, both switched to weighting only the total correlation more heavily, hoping to get disentanglement without giving up reconstruction.

The second was the metric. FactorVAE pointed out that the metric is sensitive to how the linear classifier is trained, and the score keeps rising if Adagrad runs for more iterations; worse, if K−1K-1 of the KK factors are disentangled, the score can already reach 100%, since the classifier only needs to see that those K−1K-1 dimensions are all nonzero to know the fixed factor is the remaining one. They showed a β-VAE that used only three dimensions to capture horizontal position, vertical position and size, ignored rotation entirely, and still scored 100%. Add the fact that the metric never looks at shape, and "99.23%" guarantees less than the number suggests. FactorVAE therefore proposed an improved metric, and β-TCVAE separately proposed MIG (mutual information gap), which needs no classifier.

The third was the interpretation of β. In 2018, Burgess et al., part of the same group of DeepMind authors, placed β-VAE in an information bottleneck framework. They treat each latent dimension as an independent Gaussian noise channel, with the KL as an upper bound on how much information each sample can get through. On a model that takes the generative factors directly as input, they increased the capacity step by step and watched the factors get encoded one at a time: at 3.1 nats only position could be reconstructed, size came in at 7.3 nats, shape at 15.4 nats, and rotation only at 23.8 nats. This agrees in direction with the estimate from the variances above, position first and rotation last. On this basis they changed the objective to control capacity directly:

L=Eqϕ(z∣x)[log⁡pθ(x∣z)]−γ ∣KL(qϕ(z∣x) ∥ p(z))−C∣\begin{aligned} \mathcal L &=\mathbb E_{q_\phi(z\mid x)}\big[\log p_\theta(x\mid z)\big]\\ &\quad-\gamma\,\Big|\mathrm{KL}\big(q_\phi(z\mid x)\,\|\,p(z)\big)-C\Big| \end{aligned}

γ\gamma is set very large (1000) so that the KL closely tracks the target CC; on dSprites, CC rises linearly from 0 to 25 nats over 100,000 steps, and on CelebA to 50 nats. Rather than fixing a β, this approach directly specifies how many nats zz should carry, and is claimed to disentangle while keeping reconstruction intact.

The fourth was where disentanglement comes from. The paper credits the pressure toward independence to the isotropic Gaussian prior. At the end of 2018, Rolinek et al. proved that as long as the prior is rotationally symmetric (N(0,I)\mathcal N(0,I) is exactly that), the log-likelihood and the ELBO are invariant to any rotation of the latent space, and the prior itself has no reason to prefer any particular set of axes. What breaks the symmetry is the encoder's diagonal covariance; this approximation was chosen in the first place to make computation tractable, yet it pushes the decoder toward local orthogonality, an effect close to PCA. The title of their paper says it happens "by accident."

Last came the direction as a whole. In 2019, Locatello et al. first proved theoretically that without inductive biases on both the models and the data, unsupervised disentanglement can't be learned at all; then they trained more than 12,000 models on 7 datasets. The score ranges of the various methods overlapped heavily; the choice of objective alone explained only 37% of the variance in scores on average, and adding the regularization strength brought that only to 59%, with the rest coming from random seeds. A good seed with bad hyperparameters often beat a bad seed with good hyperparameters, and without labels there was no way to pick out the good models. The β-VAE paper's claim that tuning one β and eyeballing the traversals is enough to choose a model needs a discount in light of this result; its appendix's practice of throwing away half the scores happens to be a way of dealing with seed-driven variation, too.

Conclusion

β-VAE changes a single coefficient. The authors derived it from the constraint that "the KL must not exceed a limit," used it to produce cleaner traversals than the VAE and InfoGAN on CelebA, chairs and 3D faces, and proposed a metric for quantifying disentanglement that reached 99.23% on 2D shapes. The costs are plain to see, with blurrier reconstructions, a β that has to be chosen separately, and a metric that was later shown to give full marks even when a factor is missed.

If you want interpretable latent dimensions from β-VAE, log each dimension's KL or posterior variance during training; dimensions with a variance near 1 are the unused ones. Compare settings with normalized β rather than the raw values; run several seeds for each hyperparameter setting and look at the distribution before drawing conclusions. If you have a few labels, use the disentanglement metric to pick β, because Locatello et al.'s results show that telling good models from bad ones without labels is very hard; and don't rely only on this paper's version of the metric, cross-check with the FactorVAE metric or MIG.

So how large should β be? This paper itself used 4, 5, 20 and 250.