Skip to main content
QUICK REVIEW

[Paper Review] Re-parameterizing VAEs for stability

David Dehaene, Rémy Brossard|arXiv (Cornell University)|Jun 25, 2021
Generative Adversarial Networks and Image SynthesisComputer Science12 references5 citations
TL;DR

This paper proposes a theoretically grounded reparameterization scheme for Variational Autoencoders (VAEs) that stabilizes training by addressing numerical instabilities caused by unbounded variance in Normal distributions. By replacing standard parameterizations with bounded or linear-exponential variants—especially for encoded and decoded distributions—it eliminates NaN losses and high gradients without sacrificing performance, enabling stable training of deep and complex VAE architectures.

ABSTRACT

We propose a theoretical approach towards the training numerical stability of Variational AutoEncoders (VAE). Our work is motivated by recent studies empowering VAEs to reach state of the art generative results on complex image datasets. These very deep VAE architectures, as well as VAEs using more complex output distributions, highlight a tendency to haphazardly produce high training gradients as well as NaN losses. The empirical fixes proposed to train them despite their limitations are neither fully theoretically grounded nor generally sufficient in practice. Building on this, we localize the source of the problem at the interface between the model's neural networks and their output probabilistic distributions. We explain a common source of instability stemming from an incautious formulation of the encoded Normal distribution's variance, and apply the same approach on other, less obvious sources. We show that by implementing small changes to the way we parameterize the Normal distributions on which they rely, VAEs can securely be trained.

Motivation & Objective

  • Address the persistent numerical instability in deep VAEs, particularly high gradients and NaN losses during training.
  • Identify the root cause of instability in standard VAE parameterizations, especially in the variance of encoded Normal distributions.
  • Provide a theoretically motivated alternative to empirical fixes like gradient clipping or update skipping.
  • Ensure stable training of state-of-the-art VAEs, such as Very Deep VAEs (VDVAE), without relying on heuristic data filtering or update skipping.
  • Demonstrate that stable training is achievable with minimal architectural changes and no performance degradation.

Proposed method

  • Introduce the UpBounded1 parameterization for encoded Normal distributions, which constrains the variance to remain bounded and avoid divergence.
  • Propose the Bounded parameterization for decoded distributions, ensuring variance stays within the range of input data (e.g., pixel values in image generation).
  • Apply the ExpLin parameterization for encoded variances, which linearly transforms the output of a neural network to ensure positivity and stability.
  • Replace standard reparameterization of Normal distributions in both encoder and decoder with these new parameterizations to stabilize the gradient flow.
  • Use a constant variance (e.g., 1.0) in the decoder path as a baseline to test expressiveness and stability, showing it does not limit model performance.
  • Validate the method on Very Deep VAEs (VDVAE) trained on CIFAR10, comparing with original implementations that skip updates when gradients exceed thresholds.

Experimental results

Research questions

  • RQ1What causes numerical instabilities such as NaN losses and extreme gradients in modern deep VAEs, particularly in the variance parameterization of Normal distributions?
  • RQ2Can the instability in VAE training be resolved through a theoretically grounded reparameterization scheme rather than empirical heuristics?
  • RQ3Does replacing standard variance parameterization with bounded or linear-exponential alternatives improve training stability without degrading model performance?
  • RQ4Can VAEs be trained reliably without skipping updates due to high gradients, ensuring full utilization of the training data?
  • RQ5Is the expressiveness of VAEs preserved when the decoder’s variance is fixed to a constant, especially when combined with improved encoder parameterizations?

Key findings

  • The UpBounded1 parameterization for encoded variances eliminated all NaN losses and high-gradient events during VDVAE training on CIFAR10, reducing skipped updates to zero.
  • The ExpLin parameterization also stabilized training, with only one high-gradient event recorded across three random seeds, and no NaNs.
  • Fixing the decoder variance to a constant (1.0) did not degrade performance, with test NELBO values of 2.006 ± 0.008 for ExpLin/Cst1, comparable to the original model.
  • The modified VDVAE with UpBounded1 achieved a test NELBO of 2.020 ± 0.006, matching the performance of the original model (2.014 ± 0.009) while being fully stable.
  • The UpBounded1 parameterization led to 2,645 high-gradient events in the constant-variance baseline (UpBounded1/Cst1), indicating that instability is primarily due to encoder variance, not decoder variance.
  • The proposed parameterizations allow full use of training data, eliminating the need for update-skipping heuristics that discard valuable gradient updates.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.