Back to paper library
Paper notesarXiv 2020ICLR 2021

VDVAE

How Deep Is Very Deep?

Original paper

Very Deep VAEs Generalize Autoregressive Models and Can Outperform Them on Images

Paper authors

Rewon Child

Publication
ICLR 2021Conference
First submitted to arXiv
arXiv:2011.10650
Cite this paper · BibTeX

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

@misc{imagegenerationvdvae2020,
  title = {{Very Deep VAEs Generalize Autoregressive Models and Can Outperform Them on Images}},
  author = {Rewon Child},
  year = {2020},
  eprint = {2011.10650},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.10650}
}
On this page

A 32×3232\times32 color image is 3,072 numbers. An autoregressive model like PixelCNN generates it one number after another, so the network has to run 3,072 times; a VAE decodes the whole image from its latent variables in one go, so the network runs just once.

Intuitively, a model with latent variables ought to be closer to how images actually come about. Behind a photo there are a scene, objects, poses and lighting, and the pixels are merely their result; an autoregressive model only builds dependencies between pixels and has to lean on a very strong network to piece together long-range relationships. Yet ever since PixelCNN in 2016, autoregressive models had stayed at the top of the log-likelihood leaderboard.

This paper has a single author, Rewon Child of OpenAI. Child wanted to know whether the autoregressive assumption really suits images better, or whether VAEs simply weren't deep enough.

This note first looks at how the paper proves that "a deep enough VAE contains autoregressive models," then at the stabilization techniques an architecture needs to stack 78 stochastic layers, and finally reads the numbers, along with how far they are from the title.

Defining the problem

Autoregressive models are VAEs too

An autoregressive model breaks the probability of an image into a chain of conditional probabilities, each pixel conditioned on all the pixels before it:

p(x)=∏i=1Dp(xi∣x<i)p(x)=\prod_{i=1}^{D}p(x_i\mid x_{<i})

A hierarchical VAE instead arranges its latent variables in several layers. The paper uses a top-down VAE, in which both the prior and the approximate posterior start from the top layer and generate layer by layer in the same order:

pθ(z)=pθ(z0) pθ(z1∣z0)⋯pθ(zN∣z<N)p_\theta(z)=p_\theta(z_0)\,p_\theta(z_1\mid z_0)\cdots p_\theta(z_N\mid z_{<N}) qϕ(z∣x)=qϕ(z0∣x) qϕ(z1∣z0,x)⋯qϕ(zN∣z<N,x)\begin{aligned} q_\phi(z\mid x)={}&q_\phi(z_0\mid x)\,q_\phi(z_1\mid z_0,x)\\ &\cdots q_\phi(z_N\mid z_{<N},x) \end{aligned}

Here z0z_0 sits at the top, a small number of low-resolution latent variables; zNz_N sits at the bottom, at the highest resolution. The paper says this structure was introduced by Sønderby et al., that is, Ladder VAE. On top of that, VDVAE requires the decoder p(x∣z)p(x\mid z) to be independent across pixels, so that generation time doesn't grow with the number of pixels.

The paper's Proposition 1 says that when the number of stochastic layers NN equals the data dimension DD, a VAE like this can represent any autoregressive model. Let's walk through it with an image of only 4 pixels, x=(x1,x2,x3,x4)x=(x_1,x_2,x_3,x_4).

Prepare 4 layers of latent variables, each holding a single number ziz_i. The encoder learns nothing and just copies the pixels, q(zi=xi∣z<i,x)=1q(z_i=x_i\mid z_{<i},x)=1; the decoder copies them straight back, p(xi=zi∣z)=1p(x_i=z_i\mid z)=1. Pixel values are discrete, from 0 to 255, so these are legitimate probabilities.

Plug this setup into the ELBO:

Eq[log⁡p(x∣z)+log⁡p(z)−log⁡q(z∣x)]\mathbb E_{q}\big[\log p(x\mid z)+\log p(z)-\log q(z\mid x)\big]
  • log⁡p(x∣z)=log⁡1=0\log p(x\mid z)=\log 1=0, since the decoder is guaranteed to copy correctly.
  • log⁡q(z∣x)=log⁡1=0\log q(z\mid x)=\log 1=0, since the encoder is guaranteed to copy correctly too.
  • What remains is log⁡p(z)=∑ilog⁡p(zi∣z<i)\log p(z)=\sum_i\log p(z_i\mid z_{<i}). Since z=xz=x, this is exactly ∑ilog⁡p(xi∣x<i)\sum_i\log p(x_i\mid x_{<i}).

The approximate posterior puts all its probability on z=xz=x, and so does the true posterior; the two are equal, so the ELBO's inequality becomes an equality. The log-likelihood of the whole VAE is exactly the log-likelihood that the prior, an autoregressive model, assigns to the pixels. In other words, a 3,072-layer VAE whose encoder can do nothing but copy is a PixelCNN.

Two diagrams. The left one is titled Latent variables are identical to observed variables: at the bottom, Input is five colored squares, each connected by a curve to a latent variable of the same color in a row in the middle; next to this row is a gray box p_θ(z), and the last latent variable connects to Output at the lower right, which is identical to Input. The right one is titled Latent variables allow for parallel generation: Input goes through a gray box q_φ(z|x) to give one black square on top and three black squares side by side below, next to p_θ(z); the black squares then go through p_θ(x|z) to produce the five colored squares of Output all at once.
Original Figure 2, Child, from PDF page 3, arXiv license, scholarly quotation.

The left figure is the construction we just built. The latent variables are identical to the pixels, and all the autoregressive work is handed to the prior pθ(z)p_\theta(z).

The right figure is what the author really hopes for. The encoder learns a more compact set of latent variables (the black squares); if the three at the bottom are conditionally independent of one another given the one on top, they can be generated in parallel within the same layer, and the whole generation process takes only two layers.

So the VAE family already contains autoregressive models; it's just that representing one in the dumbest possible way takes a stack as deep as the data dimension. Proposition 2 adds that an NN-layer VAE can approximate any NN-dimensional latent distribution, because the layer-by-layer prior and posterior form an autoregressive flow along the depth direction. The author also admits that every layer uses a Gaussian, which limits the distributions it can actually express.

Not deep enough?

From these two propositions, the author draws an explanation. Autoregressive models win because they are deeper, in the sense of statistical dependence: a 32×32 image takes 3,072 steps. If there really are latent variables of K<DK<D dimensions that describe images more efficiently, a KK-layer VAE is enough; but nobody knows what KK is, and it may be far deeper than past VAEs.

Hierarchical VAEs at the time mostly had no more than 3 layers. BIVA used 15, IAF-VAE 12, and NVAE, a few months earlier, 30.

So this paper sets out to test two things. Does adding only stochastic layers, with no extra parameters, improve log-likelihood? And once stacked past 70 layers, can a VAE beat PixelCNN? Answering them first requires an architecture that trains stably with more than 70 layers.

Solving the problem

Architecture

Left half, a network diagram: on the left, the Bottom-up path goes up from the Input kitten image at the bottom through several res blocks and pools, the boxes narrowing toward the top; on the right, the Top-down path goes from top to bottom through several topdown blocks and unpools, finally outputting a blurry Reconstruction image; at each resolution, arrows connect the bottom-up features to several topdown blocks at the same resolution. Right half, two block diagrams. The upper res block: the input goes through conv 1×1, conv 3×3, conv 3×3, conv 1×1, then is added to the input. The lower topdown block: the input splits in two; the left path is concatenated with the features coming from bottom-up and goes through conv 1×1, 3×3, 3×3, 1×1 to give q_φ(z_i|z_<i, x); the right path goes through the same four convolutions, part of which gives p_θ(z_i|z_<i) and part of which is added back to the trunk; the sampled z goes through a conv 1×1 and is added back to the trunk, which finally passes through one more res block.
Original Figure 3, Child, from PDF page 4, arXiv license, scholarly quotation.

The author says no existing VAE implementation could hold up under that many stochastic layers, so the author rewrote a minimal VAE from scratch, with nothing but convolutions, nonlinearities and Gaussian stochastic layers, for a single purpose: letting stochastic layers keep piling on.

The left side shows the whole. The bottom-up path is a chain of res blocks, with average pooling at each change of resolution; the top-down path is a chain of topdown blocks, with nearest-neighbor upsampling at each change of resolution. The res block is ResNet's bottleneck structure, four convolutions of 1×11\times1, 3×33\times3, 3×33\times3 and 1×11\times1, each preceded by a GELU.

At the lower right is the topdown block, and each topdown block is one stochastic layer. Take the ImageNet-32 setting through it: the trunk is 512 channels wide, the bottleneck 128, and each layer's latent variables have 16 channels. Say we are at a 16×1616\times16 layer and the decoder trunk's current state is a 16×16×51216\times16\times512 feature map, which we'll call ss.

  1. Approximate posterior. Concatenate ss with the bottom-up path's features at 16×1616\times16 (also 512 channels) into 1,024 channels, pass them through a four-convolution bottleneck, and output 32 channels, the first 16 being the mean and the last 16 log⁡σ\log\sigma. This is qϕ(zi∣z<i,x)q_\phi(z_i\mid z_{<i},x), with shape 16×16×1616\times16\times16.
  2. Prior. Pass ss alone through another bottleneck that outputs 16+16+51216+16+512 channels: the prior's mean, its log⁡σ\log\sigma, and a feature map to add back to the trunk. The last convolution of this branch is initialized to 0, so at the start of training the prior is a standard normal and what gets added back to the trunk is 0.
  3. Sample. During training zz is sampled from the approximate posterior; during generation, from the prior. Both are diagonal Gaussians, so this layer's KL is computed directly in closed form.
  4. Write back to the trunk. zz goes through a 1×11\times1 convolution back to 512 channels and is added to ss, which passes through one more res block before going to the next layer.

In the official code, only one copy of the bottom-up features is kept per resolution, and all the topdown blocks at that resolution share it; that is what the left side of Figure 3 draws, with a single arrow per resolution heading right and splitting among several topdown blocks.

Set against the two generations before it, where Ladder VAE merges the prior and the evidence from the data with precision weighting and NVAE has the approximate posterior predict a shift relative to the prior, VDVAE simply concatenates the trunk state with the bottom-up features and computes the approximate posterior's parameters with convolutions.

Of ImageNet-32's 78 layers, 2 are at 1×11\times1, 5 at 4×44\times4, 10 at 8×88\times8, 20 at 16×1616\times16 and 41 at 32×3232\times32. With 16 channels per layer, there are about 765,000 latent variables in all, 250 times the image's dimension, 88% of them at the 32×3232\times32 level. The top of the trunk starts from a learnable constant tensor.

The main text of the paper doesn't say what distribution the decoder p(x∣z)p(x\mid z) uses. The official code uses PixelCNN++'s discretized logistic mixture, with 10 components per pixel and pixels independent given zz.

No warm-up needed

Ladder VAE and NVAE both use KL warm-up, and NVAE adds KL balancing on top. VDVAE uses neither, and no free bits either. The author says that with nearest-neighbor upsampling as the unpool, combined with the residual structure, no posterior collapse was observed.

Line chart titled Average rate (KL) per layer by network type at 80k updates. The horizontal axis is the layer index from 0 to about 73, and the vertical axis is the cumulative rate (KL) in bpd, from 0 to 1.6. The blue line, ResNet (Nearest Neighbors), ELBO=3.27, starts rising slowly from layer 0 and levels off at 1.33 around layer 55. The orange line, ResNet (Convolution), ELBO=3.30, is 0 for the first 13 layers, then rises and levels off at 1.37 around layer 57. The green line, FFN, ELBO=3.42, is almost 0 for the first 45 layers, then rises quickly to about 1.53.
Original Figure 5, Child, from PDF page 12, arXiv license, scholarly quotation.

This is a 73-layer network on ImageNet-32, trained for 80k steps. The horizontal axis is the layer index, starting from the low-resolution layers at the top; the vertical axis is the KL accumulated from layer 0 up to that layer, in bits/dim. Wherever a stretch of the curve is flat, those layers encode no information, which means they have collapsed to the prior.

  • The green line removes the residual connections from the res blocks in the top-down path. The first 45 layers all collapse, and its ELBO is the worst, 3.42.
  • The orange line replaces the upsampling with a learnable transposed convolution. The first 13 layers collapse, ELBO 3.30.
  • The blue line is the official setting, nearest-neighbor upsampling. Information comes in from the very first layer, and its ELBO is the best, 3.27.

What the caption leaves out is that the blue line goes flat too after about layer 55, so at this point in training the last dozen or so layers also encode no information. The collapse has moved from the top to the bottom.

Residual initialization

Once you stack dozens of layers, the first problem is that values grow as they keep adding up. Every res block adds its output back to the trunk; if each block's output has variance vv, then after NN blocks the trunk's variance accumulates to roughly NvNv.

The author's fix is to multiply the weights of the last convolution in each bottleneck by 1/N1/\sqrt N, where NN is the depth. The output shrinks by a factor of N\sqrt N and the variance by NN, so NN blocks added together still come to about vv. The official code does this for the res blocks of both the bottom-up and top-down paths, and for the 1×11\times1 projection of zz.

The appendix compares training with and without this scaling, at various depths, giving the loss and the number of skipped updates after 80k steps:

DepthUnscaledSkippedScaledSkipped
152.50132.510
302.36412.381
452.31482.300
602.30762.291
75Diverged−2.280

Compiled from Table 3 of the paper.

For shallow networks, adding the scaling actually makes things slightly worse; from 45 layers up, the scaled version is better, and almost no updates get skipped. The unscaled 75-layer network simply diverges.

Gradient skipping

The author writes that VAEs have notorious "optimization difficulties," which are "not frequently discussed in the literature but nevertheless well-known by practitioners." Partway through training, a huge reconstruction loss or KL suddenly appears, the gradient norm can reach as high as 101510^{15}, and a single update wrecks the network.

VDVAE's countermeasure is blunt. At every step it first computes the gradient norm, and if the norm exceeds a threshold, the whole step is skipped without any update. The thresholds are set high, so fewer than one in ten thousand updates get skipped, yet this almost eliminates divergence. The threshold per dataset is 400 for CIFAR-10, 300 for ImageNet-32, 380 for ImageNet-64, 180 for FFHQ-256 and 500 for FFHQ-1024.

Here is the official code's training step, excerpted and simplified (with the multi-GPU statistics synchronization left out):

python
stats = vae.forward(x, x_target)   # elbo = distortion + rate, in nats/dim
stats['elbo'].backward()
# returns the total norm before clipping; also clips the gradients to grad_clip
grad_norm = torch.nn.utils.clip_grad_norm_(vae.parameters(), H.grad_clip).item()
has_nan = torch.isnan(stats['distortion']).any() or torch.isnan(stats['rate']).any()
if not has_nan and grad_norm < H.skip_threshold:
    optimizer.step()
    update_ema(vae, ema_vae, H.ema_rate)   # EMA weights move only when an update really happens

Two things here aren't in the paper. First, besides skipping, the code also clips gradients. A step whose gradient norm falls between grad_clip (200 for CIFAR-10) and skip_threshold (400) is first clipped to 200 and then applied. Second, a step is also skipped whole whenever the loss contains NaN.

Other settings

  • Optimizer. The paper says Adam; the official code uses FusedAdam in its AdamW form, with β1=β2=0.9\beta_1=\beta_2=0.9 and a linear warm-up over the first 100 steps. CIFAR-10 uses a learning rate of 2×10−42\times10^{-4} and weight decay 0.01; ImageNet and FFHQ-256 use 1.5×10−41.5\times10^{-4}, and FFHQ-1024 7×10−57\times10^{-5}.
  • EMA. Evaluation and sampling use an exponential moving average of the weights. The author said on GitHub that late in training, EMA helps both log-likelihood and sample quality noticeably.
  • Compute. CIFAR-10 trains for 6 days on 2 V100s; every other dataset trains for about 2.5 weeks on 32 V100s.
DatasetLayersParamsBatch
CIFAR-104539M32
ImageNet-3278119M256
ImageNet-6475125M128
FFHQ-25662115M32
FFHQ-102472115M32

Compiled from Table 4 of the paper.

Discussion

Does depth alone help?

The first experiment pulls "depth" and "parameter count" apart. On ImageNet-32, the author fixes a network of 48 blocks and 41 million parameters, and uses a trick to reduce the number of stochastic layers.

Normally the ii-th topdown block takes input xix_i and outputs xi+1=xi+f(xi)x_{i+1}=x_i+f(x_i), and the next block's latent variables are conditioned on this block's sample. If KK consecutive blocks are all given the same input xix_i, they see exactly the same thing and their latent variables no longer condition on one another, so they effectively merge into one stochastic layer with KK times as many latent variables. Not a single parameter is lost, but the statistical depth drops to 1/K1/K of what it was.

Stochastic depthTest loss
34.30
64.18
124.06
243.98
483.95

Compiled from the left half of Table 1 of the paper, ImageNet-32, 600k training steps.

With the same parameter count and only the number of stochastic layers changing, the loss falls all the way from 4.30 to 3.95. The gain from 24 to 48 layers is smaller, but it is still a gain, and 48 layers was already deeper than anything the literature had tried at the time.

The right half of the same table spreads the 48 layers over five resolutions, 32×3232\times32, 16×1616\times16, 8×88\times8, 4×44\times4 and 1×11\times1, in different proportions. The more of them go to high resolutions, the better, from 3.98 for 10, 10, 10, 10, 8 to 3.95 for 16, 16, 10, 4, 2. The author's reading is that global features may take up less information than local details and textures, so high resolutions need lots of latent variables.

Main results

ModelTypeParamsbits/dim
CIFAR-10
PixelCNN++AR53M2.92
PixelSNAILAR2.85
Sparse TransformerAR59M2.80
BIVAVAE103M≤ 3.08
NVAEVAE131M≤ 2.91
VDVAEVAE39M≤ 2.87
ImageNet-32
Gated PixelCNNAR177M3.83
Image TransformerAR3.77
Flow++Flow169M≤ 3.86
NVAEVAE268M≤ 3.92
VDVAEVAE119M≤ 3.80
ImageNet-64
Gated PixelCNNAR177M3.57
SPNAR150M3.52
Sparse TransformerAR152M3.44
Flow++Flow73M≤ 3.69
VDVAEVAE125M≤ 3.52

Compiled from Table 2 of the paper. AR is an autoregressive model, whose sampling runs the network DD times; VAE and Flow need only one run. The parameter counts of PixelCNN++ and Gated PixelCNN are the author's estimates.

First, against VAEs. VDVAE gets 2.87 on CIFAR-10, better than NVAE's 2.91, with only 30% of its parameters; on ImageNet-32 it gets 3.80 to NVAE's 3.92, with less than half the parameters.

Next, against the PixelCNN branch. On CIFAR-10, PixelCNN++ has 2.92, and on ImageNet, Gated PixelCNN has 3.83 and 3.57; VDVAE beats all three, with roughly 30% fewer parameters. The abstract's claim that it "outperforms the PixelCNN in log-likelihood on all natural image benchmarks" holds up on the table.

But the same table has other autoregressive models too. On CIFAR-10, PixelSNAIL has 2.85 and Sparse Transformer 2.80; on ImageNet-32, Image Transformer has 3.77; on ImageNet-64, Sparse Transformer has 3.44, and SPN ties VDVAE at 3.52. VDVAE beats none of these (so the "Them" in the title's "Can Outperform Them" turns out to mean the PixelCNN branch). The paper honestly lists all of these stronger models in its table, and the main text limits its claims to PixelCNN-type models and non-autoregressive models; only the title is written more broadly.

At high resolution, VDVAE gets 0.61 on FFHQ-256 (5-bit), where the NVAE paper itself reports 0.69. FFHQ-1024 is full 8-bit color, and VDVAE gets 2.42 there, with no other model in the table to compare against. The author says the same network can go from 32×3232\times32 to 1024×10241024\times1024 just by adding a few upsampling layers, training for about the same number of steps with about the same resources (32 GPUs, roughly 2.5 weeks); for an autoregressive model to generate a megapixel image, the network has to run more than a million times.

The "thousands of times faster" sampling is counted by the paper in network evaluations, DD against 1; actual sampling time isn't measured separately.

The learned hierarchy

Two rows of FFHQ-256 faces, seven per row, labeled above with 1x1, 4x4, 8x8, 16x16, 32x32, 64x64, 128x128 and below with <0.001%, 0.03%, 0.15%, 1.1%, 9.5%, 30.1%, 74%. In the first row, 1x1 is a blurry generic face with glasses and a smile; by 4x4 it has already become a woman with long black hair and a red scarf, and moving right the hair and facial features grow clearer, with strands of hair, skin texture and background details appearing from 32x32 on. The second row goes from a generic male face at 1x1 to a person with short gray hair and glasses at 4x4, and from 32x32 on the facial wrinkles and hair texture become clear.
Original Figure 4, Child, from PDF page 7, arXiv license, scholarly quotation.

This figure answers the question from the beginning, whether VDVAE really learns a representation more compact than pixels. Each row corresponds to one FFHQ image. The latent variables up to a given resolution are taken from the approximate posterior, meaning they really are encoded from this image; the rest are sampled from the prior at low temperature. Above are the resolutions; below, the latent variables up to that resolution as a cumulative fraction of all latent variables.

Using only the 1×11\times1 latent variables (less than one in a hundred thousand), you get an average face with little connection to the original. Add 4×44\times4, still only 0.03% cumulatively, and the hairstyle, glasses, clothing color and overall composition are settled. By 16×1616\times16, at 1.1% cumulatively, the outline of the face and the positions of the features are fixed; at 32×3232\times32, 9.5% cumulatively, details like age and expression finally appear, and this is where the second row turns from a young face into an older one. The remaining ninety percent or so of the latent variables, at 64×6464\times64 and above, take care of strands of hair, skin texture and background details.

This is exactly what the right side of Figure 2 was hoping for. The latent variables that decide global structure are few; the high-resolution latent variables, which make up the vast majority, look spatially independent of one another and can be generated in parallel within a few layers. The author believes this learned, parallel, multiscale way of generating may be why VDVAE can beat PixelCNN on log-likelihood with fewer parameters and faster sampling. This is the author's conjecture; the paper makes only a qualitative observation with this figure.

Official code and reproduction

The official code is released under the MIT license, with checkpoints for every dataset, and the README lists what each checkpoint should score, for example 2.6364 nats/dim for ImageNet-32, which is 3.80 bits/dim. CIFAR-10 comes with models from four seeds, at 2.879, 2.842, 2.898 and 2.864, averaging 2.87. Work it out, and the four seeds differ by as much as 0.056, more than the 0.04 between VDVAE and NVAE, so keep that in mind when comparing the two models.

There are a few discrepancies between the paper and the code. The output distribution, the gradient clipping and β2=0.9\beta_2=0.9 mentioned earlier exist only in the code. Counting the decoder settings in the official hps.py gives 43 layers for CIFAR-10 and 66 for FFHQ-256, which don't match the 45 and 62 in the paper's table; the authors of the later Efficient-VDVAE also note in a footnote that the official code's parameters sometimes differ from the paper, and that they went with the code.

People training from scratch had a rougher time.

  • Single GPU. In issue #8, a user training CIFAR-10 on a single GPU with batch 16 was stuck for a long time on a plateau around 4.7 nats/dim; another user, training on Omniglot, ran into it too, with a KL of almost 0, which is posterior collapse. That user also found that switching the output distribution from the logistic mixture to a Gaussian broke training entirely, and it only ran after turning off gradient clipping and adding instance norm, while the logistic mixture itself often brought very large gradient norms and NaN. The author replied that the model is sensitive to batch size and learning rate, and that when the batch shrinks by a factor of 4, the learning rate may need to come down by more than half; the author had tried adjusting the KL weight and found it didn't help.
  • The skip threshold. In the same issue, the author added that the skip threshold depends on the learning rate and batch size: if your configuration produces generally higher gradient norms, updates may keep getting skipped and training stops, so the threshold should be set where only very few updates get skipped. Four years later, someone in issue #25 (June 2025) trained CIFAR-10 from scratch with the default threshold of 400; after a few steps the gradient norm reached about 450, and from then on every batch sat around 420, every step was skipped, and the model never updated again. Nobody replied to the issue, and the repo was archived afterward (the fuse installed against divergence sometimes just cuts the power to the whole run).
  • NaN. In 2021, Dehaene and Brossard trained CIFAR-10 with the official code and the provided hyperparameters, and both the KL and the reconstruction term hit NaN several times, silently skipped by the code. After they switched the variance of every Gaussian to a bounded parameterization, none of their three seeds showed high gradients or NaN again, and performance didn't get any worse.
  • Units. Several people took the distortion the code logs for the paper's number and couldn't match 2.87. The author has explained that the paper reports the ELBO, that is, rate plus distortion, and that the code logs in nats/dim; divide by ln⁡2\ln 2 to get bits/dim.

In 2022, a team at Cash App Labs published Efficient-VDVAE, going back over what VDVAE costs to train. They report convergence up to 2.6 times faster and up to 20 times less training memory, with comparable or better negative log-likelihood. Their changes include producing the standard deviation with a gentler softplus, so that the gradient of 1/σ1/\sigma is less spiky, which sharply cuts the number of skipped updates, and replacing Adam with AdaMax, because the large gradients from the logistic mixture output blow up Adam's second moment. In their table, the original VDVAE's total training memory on ImageNet and FFHQ is 512 GB.

Conclusion

VDVAE's case splits into one proof and one set of experiments. The proof says that a deep enough top-down VAE can represent any autoregressive model; the experiments say that at a fixed parameter count, more stochastic layers give better log-likelihood, and VDVAE, stacked to 78 layers, reaches 3.80 bits/dim on ImageNet-32, beating the PixelCNN branch and every non-autoregressive model with 30% fewer parameters. What holds that depth up is the 1/N1/\sqrt N residual initialization, nearest-neighbor upsampling, and gradient skipping, which throws a broken step away whole.

Before using the official code, know that the log records nats/dim, which you divide by ln⁡2\ln 2 to compare with the paper. During training, watch the number of skipped updates in the log, which should be almost 0; once every step is being skipped, lower the learning rate or reset the threshold rather than waiting for it to recover by itself. Sample with the EMA weights, with the temperature at 0.8 to 0.9 as the author recommends; and when comparing models, check how many seeds you have.

Of the "Them" in the title, the one still sitting above VDVAE in the CIFAR-10 and ImageNet-64 rows is the author's own Sparse Transformer from the year before.