Abstract
Disentanglement in Variational Autoencoders (VAEs) is traditionally attributed to the regularization term (KL-divergence). This paper challenges that view, arguing that the reconstruction loss is the primary driver of latent space alignment. By analyzing standard benchmarks and introducing an adversarial dataset, the authors demonstrate that disentanglement occurs when the reconstruction loss's "perceived distance" aligns with ground-truth factors. When this alignment is broken, disentanglement collapses, necessitating the design of spatially-aware reconstruction losses.
Introduction
In representation learning, "disentanglement" aims to map independent generative factors (e.g., color, position) to individual dimensions of a latent vector. While the community has focused on the KL-divergence term—exemplified by the $\beta$-VAE—there is no inherent mathematical reason for latent axes to align with human-intuitive factors. This research investigates why VAEs align with ground-truth factors and demonstrates that this behavior is often a byproduct of the interaction between the dataset structure and the reconstruction loss.
Methodology
The authors define perceived distance as the distance between two data points measured by the VAE’s reconstruction loss ($L_{rec}$).
- Correlation Analysis: The relationship between ground-truth factor changes and the resulting Mean Squared Error (MSE) between images was analyzed.
- Adversarial Dataset (XYSquares): A dataset was designed where objects move without overlapping. Under pixel-wise MSE, the perceived distance between any two non-overlapping states is constant, regardless of their spatial distance, creating a "blind spot" for the model.
- Spatially-Aware Loss ($L_{Overlap}$): To address the failure on non-overlapping data, the authors introduced a loss that applies a box blur to both input and reconstruction before calculating the error. This forces the model to recognize spatial proximity even without direct pixel overlap.
Datasets
The study utilizes several standard benchmarks alongside a new adversarial challenge.
- Standard Benchmarks: 3D Shapes, Cars3D, dSprites, and NORB.
- XYSquares: An adversarial dataset with three colored squares on a grid, designed to have zero pixel overlap between different positions, thus appearing equidistant to standard MSE.
Theoretical Insights
The core finding is that disentanglement is often "accidental." In datasets like dSprites, pixel-wise overlap changes smoothly as factors change, providing a gradient for the VAE to organize its latent space.
If the reconstruction loss perceives the distance between points as constant (the "Constant Overlap Trap"), the VAE has no incentive to order them linearly, leading to collapsed representations. Thus, disentanglement is a property of the interaction between data, ground-truth factors, and the loss function. While regularization (KL-divergence) creates the necessary overlap in latent distributions, it is the reconstruction loss that uses that overlap to "push" similar-looking images together, effectively organizing the space.
Key Results
- Failure on Adversarial Data: On XYSquares, state-of-the-art models like $\beta$-VAE and Ada-GVAE failed completely, yielding near-zero Mutual Information Gap (MIG) and DCI scores.
- The Overlap Effect: Simply decreasing grid spacing to force pixel overlap significantly improved disentanglement without changing the model architecture.
- Loss Function Efficacy: The proposed $L_{Overlap}$ (blur-augmented loss) successfully enabled disentanglement on the adversarial dataset, matching performance on standard benchmarks.
Discussion and Future Work
This work highlights that "ground truth" is subjective and dependent on the choice of loss. While the box-blur loss solves spatial issues, it is a heuristic that may not generalize to categorical or complex textural factors. Future research must explore how to systematically choose reconstruction losses that align with specific human-intuitive factors, especially for high-dimensional, real-world data where simple spatial heuristics may fail.
Summary updated