Abstract
Learning disentangled representations with variational autoencoders (VAEs) is often attributed to the regularisation component of the loss. In this work, we highlight the interaction between data and the reconstruction term of the loss as the main contributor to disentanglement in VAEs. We note that standardised benchmark datasets are constructed in ways that are conducive to learning what appear to be disentangled representations. We design an intuitive adversarial dataset that exploits this mechanism to break existing state-of-the-art disentanglement frameworks. Finally, we supply a solution that enables disentanglement by modifying the reconstruction loss, affecting how VAEs perceive distances between data points.
Introduction
In unsupervised learning, the goal of disentanglement is to discover latent variables that correspond to independent real-world factors, such as an object's position, color, or shape. While Variational Autoencoders (VAEs) are frequently used for this task, the underlying mechanism for their success has remained elusive. Conventional wisdom credits the regularization term—the part of the loss function that constrains the latent space to a standard Gaussian distribution. However, this paper argues that disentanglement is largely a byproduct of the reconstruction loss and its interaction with specific properties of benchmark datasets.
The "Perceived Distance" Theory
The authors propose that disentanglement occurs because the reconstruction loss (typically Mean Squared Error) perceives distances between images in a way that correlates with ground-truth factors. This is termed Perceived Distance ($d_{pcv}$).
When data points "overlap" in pixel space (e.g., as an object moves slightly, many pixels remain the same), the reconstruction loss creates a smooth gradient. This gradient allows the VAE to organize its latent space. If the loss function perceives all changes as equally distant—such as when there is zero pixel overlap between different factor values—the model fails to learn the underlying structure.
Methods and Datasets
To test this hypothesis, the study evaluates several standard benchmarks alongside a novel adversarial dataset:
- Standard Benchmarks: 3D Shapes, Cars3D, dSprites, and Small NORB. These datasets are characterized by significant pixel-wise overlap as factors change.
- XYSquares: A synthetic adversarial dataset where colored squares move across a grid without ever overlapping. This creates a "constant perceived distance" for standard MSE, effectively blinding the VAE to spatial relationships.
To address the failure on non-overlapping data, the authors introduce a Spatially-Aware Loss. By applying a box blur to images before calculating the reconstruction loss, they manually introduce overlap, allowing the model to perceive that nearby objects are more similar than distant ones.
Key Results
The experiments yielded several critical insights:
- Failure of SOTA Models: State-of-the-art models like $\beta$-VAE and Ada-GVAE failed completely on the XYSquares dataset, achieving near-zero disentanglement scores (MIG and DCI).
- The Overlap Effect: Simply decreasing the spacing between squares in XYSquares to introduce minimal pixel overlap (1-2px) significantly improved disentanglement scores without changing the model architecture.
- Successful Mitigation: The proposed box-blur augmented MSE loss enabled high disentanglement scores on the original "impossible" XYSquares dataset, proving that the choice of reconstruction loss is a critical hyperparameter.
Conclusion
This work demonstrates that disentanglement is not an inherent property of data alone, but an interaction between data, ground-truth factors, and the chosen loss function. While regularization is necessary, the heavy lifting of latent space organization is performed by the reconstruction term's interaction with data overlap. Future research should focus on identifying domain-specific reconstruction losses that can provide the necessary inductive biases for complex, real-world data where simple pixel-wise overlap may not exist.
Summary updated