Abstract
Researchers have introduced AutoEncoders within Flows (AEF), a novel framework that allows generative autoencoders to be trained deterministically using exact maximum-likelihood. By embedding the encoder-decoder structure within an invertible normalizing flow, AEFs eliminate the "variational gap" that often plagues Variational Autoencoders (VAEs). This approach results in significantly sharper generated samples and better density estimation, particularly in low-dimensional latent spaces.
The Problem: VAEs vs. Normalizing Flows
Generative modeling typically relies on two dominant paradigms: Variational Autoencoders (VAEs) and Normalizing Flows (NFs).
VAEs excel at dimensionality reduction, effectively compressing data into a compact "latent" space. However, they are notoriously difficult to train because calculating the true likelihood of the data is intractable. Instead, models optimize a surrogate metric known as the Evidence Lower Bound (ELBO). This "variational gap" often leads to blurry generated images and unstable training dynamics.
Normalizing Flows, conversely, allow for exact likelihood calculation using invertible mappings. The drawback is that standard NFs require the latent space to maintain the same dimensionality as the input data, making them unsuitable for compression or manifold learning.
The authors tackle a fundamental question: Can we build a model that possesses the architectural flexibility and compression capabilities of a VAE, but utilizes the exact, deterministic training of a Normalizing Flow?
Proposed Method: AutoEncoders within Flows (AEF)
The core innovation of AEF is treating the encoder and decoder as specific affine layers within a larger, invertible architecture. The authors propose two distinct methodologies to achieve this:
- Space Partitioning: The input data $x$ is split into "core" variables (which map to the latents $z$) and "shell" variables (which are "predicted away"). By tracking the residuals—the difference between the shell variables and their predictions—the entire transformation remains perfectly invertible.
- Ambient Space Expansion: To make AEF a "drop-in" replacement for existing VAEs, the authors deterministically expand the input space (e.g., by adding a feature expansion $w = h(x)$). This allows the definition of a latent space that is smaller than the expanded space, while still leveraging the change-of-variables formula for exact likelihood training.
Essentially, while a VAE relies on stochastic noise to explore the latent space, an AEF uses deterministic features of the data itself to fill the "missing" dimensions required to maintain invertibility.
Key Insights
- Deterministic Training Yields Sharper Images: The characteristic "blurriness" in VAEs is largely attributed to the stochastic nature of the encoding and the mismatch between the approximate posterior and the prior. Because AEF is deterministic, it avoids this "averaging" effect, producing much crisper reconstructions and samples.
- The "Prior" as an Auxiliary Flow: In the AEF framework, the "prior" and "posterior" flows are mathematically linked through the invertible architecture. The "core flow" in AEF functions similarly to the posterior flow in a VAE, but crucially, it is trained via exact likelihood.
- Bridging the Gap: AEF effectively interpolates between a standard Normalizing Flow (when latent dimension $D \approx$ data dimension $N$) and a traditional Autoencoder (when $D \ll N$).
Key Results
The models were evaluated on several standard image benchmarks, including high-resolution datasets like CelebA-HQ and ImageNet, as well as lower-resolution digit datasets like MNIST.
- Superior Likelihood: As shown in the performance table, AEFs consistently achieve better Bits Per Dimension (BPD)—a measure of how well the model captures the data distribution—compared to architecturally identical VAEs across almost all datasets.
- Better Sample Quality: In terms of FID score (measuring the realism of generated images), AEFs significantly outperform VAEs. For instance, on CelebA-HQ (64x64) with 256 latents, AEF achieved an FID of 55.8, compared to the VAE's 90.9.
- Visual Sharpness: Qualitative assessments confirm that AEF samples lack the characteristic "haze" seen in low-dimensional VAEs.
Limitations and Future Work
While powerful, the AEF framework has a few notable limitations:
- Continuous Data Only: Because the method relies on the change-of-variables formula and Jacobians, it is currently restricted to continuous data and cannot straightforwardly incorporate discrete decoders.
- Topological Constraints: Like all Normalizing Flows, AEFs are homeomorphisms and are subject to topological constraints. They may struggle to model data distributions with complex, disconnected topologies unless the architecture is sufficiently deep.
- The MNIST Anomaly: Interestingly, on MNIST with 32 latent dimensions, the VAE performed slightly better (as seen in the results table). The authors conjecture this is because the VAE's stochasticity helps "loosen" topological constraints when the latent space is relatively large compared to the actual complexity of the data's signal manifold.
Future work may explore adding stochastic auxiliary variables to AEFs, aiming to combine the benefits of deterministic training with the topological flexibility inherent in stochastic models.
Summary updated