Source-linked AI summary

From Variational to Deterministic Autoencoders

Partha Ghosh, Mehdi S. M. Sajjadi, Antonio Vergari, Michael Black, Bernhard Schölkopf

arXiv:1903.12436v4cs.LGstat.ML

TL;DR

VAEs raise theoretical and practical challenges in generative modeling, including prior mismatch and difficult regularization. The paper introduces deterministic, regularized autoencoders with ex-post density estimation, finding competitive or better sample quality across image and structured-data settings. The approach simplifies optimization but no longer guarantees a simple latent prior or direct prior-based sampling.

  • Problem

    VAEs face practical and theoretical challenges, including aggregated-posterior mismatch that can make prior-based sampling generate out-of-distribution samples.

  • Method

    The paper replaces stochastic VAE encoders with deterministic autoencoders using explicit or implicit decoder regularization, then fits an ex-post latent density estimator.

  • Results

    RAEs generate samples comparable to or better than VAEs and stronger alternatives, while ex-post density estimation consistently improves sample quality across models.

  • Takeaways & Limitations

    Deterministic regularization can provide a meaningful latent space and generative samples without requiring the latent space to follow a fixed simple prior.

  • Takeaways & Limitations

    Removing the KL term detaches RAEs from the prior, so they cannot ensure a simple latent distribution or retain direct prior-based sampling.

Abstract

from arXiv · show

Variational Autoencoders (VAEs) provide a theoretically-backed and popular framework for deep generative models. However, learning a VAE from data poses still unanswered theoretical questions and considerable practical challenges. In this work, we propose an alternative framework for generative modeling that is simpler, easier to train, and deterministic, yet has many of the advantages of VAEs. We observe that sampling a stochastic encoder in a Gaussian VAE can be interpreted as simply injecting noise into the input of a deterministic decoder. We investigate how substituting this kind of stochasticity, with other explicit and implicit regularization schemes, can lead to an equally smooth and meaningful latent space without forcing it to conform to an arbitrarily chosen prior. To retrieve a generative mechanism to sample new data, we introduce an ex-post density estimation step that can be readily applied also to existing VAEs, improving their sample quality. We show, in a rigorous empirical study, that the proposed regularized deterministic autoencoders are able to generate samples that are comparable to, or better than, those of VAEs and more powerful alternatives when applied to images as well as to structured data such as molecules. \footnote{An implementation is available at: \url{https://github.com/ParthaEth/Regularized_autoencoders-RAE-}}

1 INTRODUCTION

VAEs face practical and theoretical challenges, including a difficult sample–reconstruction trade-off and latent-space mismatch. The paper proposes deterministic Regularized Autoencoders with ex-post density estimation as a simpler alternative.

  • VAEs balance stochastic autoencoding quality against matching a fixed prior distribution in latent space.
  • VAEs can trade off sample quality against reconstruction quality because of simplistic priors or over-regularization from the KL term.
  • The paper proposes deterministic RAEs that replace encoder stochasticity with decoder-input noise and other regularization schemes.The approach targets simpler optimization while preserving meaningful latent spaces and competitive samples.
  • RAEs obtain a generative mechanism by fitting a density estimator after training on the learned latent space.
  • The study evaluates RAEs against VAEs and other baselines on image datasets and structured molecule-generation tasks.

2 VARIATIONAL AUTOENCODERS

VAEs use stochastic encoder–decoder mappings and variational optimization to model high-dimensional data, but their regularization and prior assumptions create practical shortcomings. These include difficult loss balancing and aggregated posterior mismatch that can harm generation.

  • VAEs model data with a fixed latent prior, a stochastic decoder likelihood, and a stochastic encoder posterior.
  • The ELBO combines expected reconstruction quality with a KL penalty that encourages each posterior qφ(z | x) to match p(z).
  • Gaussian VAEs commonly use Gaussian encoder and decoder distributions, reparameterize encoder noise, and fix the decoder covariance to the identity.
  • A too-large KL weight can dominate the objective and over-regularize the model, making optimization require careful balancing with reconstruction loss.
  • After training, the aggregated posterior may not match the assumed prior, so prior-sampled latent codes can fall in unseen regions and produce out-of-distribution samples.
  • Constant-Variance VAEs simplify the encoder by fixing its variance, while retaining a scalar noise level that can be fitted as a hyperparameter.

3 DETERMINISTIC REGULARIZED AUTOENCODERS

RAEs reinterpret VAE stochasticity as decoder-input noise, then replace that noise and the KL-based encoder regularization with deterministic decoder regularization. This yields a simplified autoencoder framework with several regularization choices and an ex-post sampling step.

  • Deterministic view: A VAE can be viewed as a deterministic autoencoder whose decoder receives Gaussian noise added to the encoder’s latent mean.In CV-VAEs, the noise magnitude is fixed across data points.
  • Deterministic view: Noise injection regularizes the decoder, smoothing its learned function and supporting smoother latent-space interpolation and random sample quality.The trade-off is increased gradient variance during training.
  • RAE framework: RAEs remove encoder noise and the KL term, then apply explicit decoder regularization while retaining a latent-size constraint in the simplified loss.The explicit regularizer is represented by LREG, while β and λ balance loss terms.
  • RAE framework: RAE training needs no Monte Carlo reconstruction estimate and no fixed prior, but it loses the VAE’s direct mechanism for sampling from the latent space.The paper addresses sampling through density estimation over the learned latent codes.
  • Regularization schemes: Candidate decoder regularizers include L2 weight decay, gradient penalties that bound input gradients, and spectral normalization that bounds Lipschitzness.Spectral normalization divides each decoder weight matrix by an estimate of its largest singular value.
  • Regularization schemes: The study also tests implicitly regularized deterministic autoencoders without explicit decoder regularization and combinations of regularizers.The implicit-regularization baseline optimizes reconstruction loss only.
  • Regularization schemes: The RAE framework can be formally derived by augmenting VAE ELBO optimization with an explicit constraint without fixing a parametric encoder posterior.The derivation motivates bounding decoder gradients and supports spectral normalization.

4 EX-POST DENSITY ESTIMATION

Removing the KL term detaches RAEs from a fixed latent prior, so the paper restores sampling with ex-post density estimation over the learned latent codes. The estimator must balance expressiveness against simplicity.

  • Motivation: Removing stochasticity and the KL term detaches the encoder from the prior, eliminating both a guaranteed simple latent distribution and the VAE’s direct sampling mechanism.This is the principal generative limitation introduced by the deterministic formulation.
  • Method: Ex-post density estimation fits qδ(z) to the encoded training latents, restoring sampling and addressing aggregated-posterior mismatch without adding training-phase computational overhead.The procedure can also be applied to VAEs and WAEs after training.
  • Estimator choice: The density estimator trades expressiveness against generalization, avoiding a Dirac distribution that would reproduce training reconstructions without generalizing.The experiments compare a full-covariance multivariate Gaussian with a 10-component GMM.

5 RELATED WORKS

RAEs position deterministic autoencoding with ex-post latent density estimation as a simpler alternative to variational, adversarial, and other generative autoencoder approaches. The paper compares their trade-offs in image and structured-data settings.

  • Positioning: RAE frames generative modeling as a simpler deterministic alternative to diagnosing and augmenting VAE objectives.The comparison concerns whether deterministic models can remain competitive for generative modeling.
  • Deterministic predecessors: Earlier deterministic denoising and contractive autoencoders targeted smooth manifolds, but their MCMC-based generative mechanisms were difficult to tune and did not scale beyond MNIST.These limitations distinguish the RAE approach from those heuristic generative extensions.
  • Latent density modeling: More expressive VAE priors and second-VAE latent estimators address aggregated-posterior mismatch but require altered objectives, additional computation, or renewed optimization difficulties.RAE instead fits a simple qδ(z) after training.
  • Adversarial autoencoders: Adversarial autoencoders can produce sharper samples but introduce higher computational overhead and training instabilities from adversarial optimization.WAEs generalize AAEs through an optimal-transport formulation with adversarial or MMD regularization.
  • Image comparisons: On CelebA, RAE provides slightly sharper samples and reconstructions than the compared VAE, WAE, and 2sVAE qualitative baselines while interpolating smoothly.Corresponding qualitative overviews for MNIST and CIFAR-10 appear in Appendix F.
  • VQ-VAE comparison: VQ-VAEs resemble RAEs through ex-post density estimation, but require complex discrete autoregressive estimators and a non-differentiable quantization loss.RAEs instead use deterministic encoders with deterministic decoders and continuous latent modeling.
  • GLO comparison: RAEs differ from GLO by retaining deterministic encoders, whereas GLO constructs latent codes on demand and can be interpreted as an autoencoder without an encoder.Both approaches share deterministic components but organize latent representation differently.

6 EXPERIMENTS

Experiments compare RAEs with VAEs, WAEs, 2sVAEs, and structured-data baselines across reconstruction, random sampling, interpolation, and Bayesian optimization. RAEs are competitive or superior, while ex-post density estimation consistently improves sample quality.

  • 6 EXPERIMENTS: The evaluation measures reconstruction, random-sample, and interpolation quality using FID, with PRD scores provided separately.These metrics respectively assess autoencoding quality, generalization, and learned latent-space structure.
  • 6.1 RAEs for Image Modeling: RAE variants are competitive with VAE, WAE, and 2sVAE image quality, and sampling RAEs achieve the best FIDs across datasets with a 10-component GMM.RAEs also rank first when sampling from a Gaussian fitted to qδ(z), except on MNIST, where they tie a VAE for second.
  • 6.1 RAEs for Image Modeling: No clear regularization scheme wins across settings, and combining multiple schemes provides no significant boost over singly regularized RAEs.RAE-L2 may be preferred for simplicity over GP and SN variants.
  • 6.1 RAEs for Image Modeling: AEs reduce FID from 58.73 to 10.66 on MNIST and from 127.85 to 45.10 on CelebA when qδ(z) is fit with GMMs.The same passage reports sharper RAE interpolations and smoother transitions than competitors in qualitative evaluations.
  • 6.1 RAEs for Image Modeling: A 10-component GMM halves WAE and RAE FIDs from ∼20 to ∼10 on MNIST and from 116 to 46 on CelebA.The improvement comes from ex-post density estimation and is cheaper and simpler than training a second-stage VAE.
  • 6.2 GrammarRAE: Modeling Structured Inputs: Across five Bayesian-optimization trials, GRAEs achieve better average scores than CVAEs and GVAEs for expressions and molecules.GCVVAE performs better on the simpler equation task, whereas GRAEs produce higher-scoring molecule samples.
  • 6.2 GrammarRAE: Modeling Structured Inputs: The proportion of syntactically valid molecules rises from 28% with GVAEs to 72% with GRAEs, while expression performance is almost equivalent.Figure 2 reports validity percentages, average mean scores, and the best generated expressions and molecules.

7 CONCLUSION

The paper reframes VAE encoder sampling as noise injection and develops deterministic autoencoders with alternative regularization. Ex-post density estimation restores sampling and consistently improves sample quality across model families.

  • 7 CONCLUSION: RAEs use deterministic autoencoding with regularization to learn meaningful latent spaces without a fixed prior.The framework avoids stochastic-framework drawbacks while producing samples comparable to or better than VAEs.
  • 7 CONCLUSION: Fitting a simple density estimator ex-post improves sample quality for RAEs, VAEs, WAEs, and 2sVAEs.The method addresses the mismatch between the prior and the aggregated posterior in VAEs.

A RECONSTRUCTION AND REGULARIZATION TRADE-OFF

VAE training exposes a trade-off between reconstruction fidelity and latent-space regularization, while more accurate Monte Carlo estimation increases computational demands.

  • Larger Monte Carlo sample counts improve VAE training accuracy but require more memory and computation, making k = 1 the common choice.
  • Enforcing latent-space structure and smoothness creates a quality penalty, requiring a compromise between reconstruction and random samples.
  • Higher LKL weights improve random sample quality but hurt reconstruction quality in MNIST VAEs.
  • β ≈101 marks a particularly noticeable region of the reconstruction–random-sample quality trade-off.

B A PROBABILISTIC DERIVATION OF REGULARIZATION

The probabilistic formulation links decoder smoothness to encoder entropy and decoder gradients, yielding a gradient-penalty regularized deterministic autoencoder under simplifying assumptions.

  • A decoder constraint requires outputs for latent draws encoding the same input to differ by less than ϵ under an Lp norm.
  • Bounding decoder-output variation connects the smoothness constraint to the decoder’s gradient norm and the encoder distribution’s support.
  • Isotropic encoder distributions are motivated as a robustness measure against decoder over-fitting, rather than allowing entropy to collapse along dimensions.
  • The smoothness constraint becomes r(H(qφ(z | x))) · sup{||∇Dθ(z)∥|p} < ϵ, linking entropy and decoder gradients.
  • Fixing encoder entropy to a constant simplifies the constrained formulation by treating encoder variance as fixed across samples.
  • Under this simplification, the decoder gradient norm becomes the gradient penalty LGP, recovering the RAE framework.

C NETWORK ARCHITECTURE, TRAINING DETAILS AND EVALUATION

The experiments use convolutional architectures across three image datasets, standardized optimization settings, fitted latent densities, and FID/PRD-based evaluation protocols.

  • Network architecture: Latent dimensions are 16 for MNIST, 128 for CIFAR-10, and 64 for CelebA.
  • Training details: All models use Adam with an initial learning rate of 10^-3, plateau-based halving, batch size 100, and dataset-specific epoch limits.
  • Evaluation: Random samples come from fixed isotropic priors for VAEs and WAEs or Gaussian parameters estimated from training embeddings for other models.
  • Network architecture: The image encoders and decoders use convolutional or transposed-convolutional layers with batch normalization and ReLU activations.
  • Network architecture: VAE encoders use M = 2 because they produce both mean and variance, whereas other models use M = 1.
  • Evaluation: FID evaluates reconstructions, random samples, and interpolation endpoints against test data, while PRD and FID use 10k samples.

E EVALUATION BY PRECISION AND RECALL

Precision–recall evaluation shows consistent gains from ex-post density estimation, with RAE-SN strong among RAEs and distinct precision–recall trade-offs among density models.

  • Precision and recall: GMM density estimation improves both precision and recall throughout the experiments and gives the best results in all cases.
  • Precision and recall: 0.88 recall on MNIST for WAE rises to 0.95 after fitting a GMM.
  • Density estimation: Fitting GMMs with up to 100 components improves results only marginally.
  • PRD curves: RAE-SN performs best among RAE methods on both precision and recall, while traditional VAE variants have no clear winner.
  • PRD curves: WAE-GMM has higher recall but lower precision than RAE+SN-GMM despite comparable FID scores.
  • XPDE: XPDE greatly boosts both precision and recall for models evaluated on MNIST, CIFAR-10, and CelebA.

F MORE QUALITATIVE RESULTS

Qualitative evaluations compare reconstructions, random samples, and interpolations for VAEs, WAEs, and RAEs on MNIST and CIFAR-10. Ex-post density estimation reduces latent prior mismatch, while additional regularization offers limited gains and increases tuning difficulty.

  • Figures 8 and 9 compare reconstructed samples, randomly generated samples, and spherical interpolations for VAEs, WAEs, and RAEs on MNIST and CIFAR-10.
  • Ex-post density estimation effectively reduces the mismatch between the aggregated posterior and prior in a 2-dimensional MNIST VAE latent space.The visualization uses test-sample scatterplots to show the effect of expressive density estimation.
  • Ex-post density estimation is visibly beneficial across the 16-dimensional MNIST latent spaces learned by all evaluated models.The latent spaces are projected into two dimensions with t-SNE, comparing test samples against samples from different estimators.
  • Additional regularization produces generally comparable but hardly better reconstruction, random-sample, and interpolation quality while making hyperparameter tuning more difficult.Combining regularization techniques also increases hyperparameters and training difficulty, conflicting with the framework’s simplicity goal.
  • An autoencoder without explicit decoder regularization performs reasonably well, suggesting that convolutional networks and gradient-based optimization provide implicit regularization.This motivates testing decoder regularization while removing regularization in the latent space.
Loading 1903.12436v4…