NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Right for the Right Latent Factors: Debiasing Generative Models via Disentanglement

Xiaoting Shao, Karl Stelzner, Kristian KerstingarXiv 2022

Abstract

Generative models trained on biased datasets often learn spurious correlations, limiting their ability to generate novel, unbiased combinations of features. This paper introduces a method to debias Variational Autoencoders (VAEs) by learning disentangled representations guided by a very small amount of human feedback. By augmenting the standard VAE objective with match-pairing and classification losses, the model isolates independent factors of variation. Our results on benchmark datasets like Colored MNIST and 3D Shapes show that this approach enables the generation of unseen feature combinations and provides latent spaces that are highly robust to downstream distribution shifts.

Introduction

A fundamental challenge in machine learning is the presence of biases and spurious correlations in training data. When a model learns these "shortcuts"—such as associating a specific object shape exclusively with a specific color—it exhibits "Clever-Hans-like" behavior. While significant effort has focused on debiasing classifiers, generative models have remained largely overlooked. A generative model trained on such biased data will entangle these concepts, failing to generate out-of-distribution combinations (e.g., a blue square if only red squares were seen). This paper proposes a weakly supervised approach to force VAEs to learn true, independent underlying factors of variation, even under severe dataset bias.

Methodology: Guided Disentanglement

The core idea is to enforce a disentangled representation within a VAE's latent space, where specific variables correspond to independent factors of variation (e.g., shape, color, scale). Since purely unsupervised disentanglement is theoretically limited, the authors introduce a weak supervision framework that emulates minimal human feedback.

The proposed architecture incorporates match-pairing ($L_{MP}$) and classification losses to guide the encoder in learning disentangled latent factors $Z_i$.

The standard VAE Evidence Lower Bound (ELBO) is augmented with two key components:

  1. Match-Pairing Loss ($L_{MP}$): The model processes pairs of images that share a target factor but vary in others. This encourages the designated latent variable to remain invariant to "nuisance" factors.
  2. Classification Loss ($L_{CL}$): Using a small labeled subset (~1%), parallel regression models ensure that the designated latent variable encodes the target factor (non-triviality) while other variables do not (restrictiveness).

Experiments and Results

The method was evaluated on biased versions of Colored MNIST, Colored dSprites, and 3D Shapes. In these datasets, features like shape and color were perfectly correlated during training but decoupled or reversed during testing.

Qualitative and Quantitative Performance

The proposed model successfully generated novel feature combinations that were absent from the training set. While standard baselines like $\beta$-VAE and FactorVAE failed by outputting the biased color-shape pairings, our model maintained independence between factors.

Latent traversals on the 3D Shapes dataset. Each row shows the effect of varying a single latent dimension $Z_i$, demonstrating successful isolation of factors like object color, floor color, and shape.

Quantitatively, the model outperformed existing unsupervised and weakly supervised baselines across metrics such as the FactorVAE score and DCI Disentanglement. Furthermore, linear classifiers trained on the learned latent variables achieved nearly 100% accuracy on out-of-distribution test sets, demonstrating the robustness of the representations to covariate shift.

Conclusion

This work demonstrates that "Generative Clever-Hans" behavior can be mitigated by anchoring the latent space with a small amount of targeted feedback. By forcing the model to learn the "right" latent factors for the "right" reasons, we can build generative systems that generalize far beyond the biases of their training data. Future work includes making this process fully interactive and extending the framework to more complex generative architectures beyond VAEs.

Summary updated

BibTeX
@misc{shao2022right,
  author = {Xiaoting Shao and Karl Stelzner and Kristian Kersting},
  title = {{Right for the Right Latent Factors: Debiasing Generative Models via Disentanglement}},
  year = {2022},
  eprint = {2202.00391},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.00391},
}
Figure