De-Biasing Generative Models using Counterfactual Methods

Sunay Bhat, Jeffrey Jiang, Omead Pooladzandi, Gregory J. PottiearXiv 2022

Abstract: Variational autoencoders (VAEs) and other generative methods have garnered growing interest not just for their generative properties but also for the ability to dis-entangle a low-dimensional latent variable space. However, few existing generative models take causality into account. We propose a new decoder based framework named the Causal Counterfactual Generative Model (CCGM), which includes a partially trainable causal layer in which a part of a causal model can be learned without significantly impacting reconstruction fidelity. By learning the causal relationships between image semantic labels or tabular variables, we can analyze biases, intervene on the generative model, and simulate new scenarios. Furthermore, by modifying the causal structure, we can generate samples outside the domain of the original training data and use such counterfactual models to de-bias datasets. Thus, datasets with known biases can still be used to train the causal generative model and learn the causal relationships, but we can produce de-biased datasets on the generative side. Our proposed method combines a causal latent space VAE model with specific modification to emphasize causal fidelity, enabling finer control over the causal layer and the ability to learn a robust intervention framework. We explore how better disentanglement of causal learning and encoding/decoding generates higher causal intervention quality. We also compare our model against similar research to demonstrate the need for explicit generative de-biasing beyond interventions. Our initial experiments show that our model can generate images and tabular data with high fidelity to the causal framework and accommodate explicit de-biasing to ignore undesired relationships in the causal data compared to the baseline.

Introduction

Generative models like Variational Autoencoders (VAEs) excel at learning low-dimensional representations but often remain "causally blind," capturing statistical correlations rather than underlying causations. If a training dataset contains inherent biases—such as a specific shadow position always coinciding with a pendulum's location—a standard VAE will encode this bias into its latent space. While previous attempts like CausalVAE introduced causal layers, they frequently suffer from "information leakage," where exogenous noise terms carry residual information that bypasses the causal structure. This prevents effective intervention and counterfactual reasoning. Researchers at UCLA have introduced the Causal Counterfactual Generative Model (CCGM) to address these limitations, allowing users to de-bias models by directly manipulating their underlying causal structure.

The CCGM Framework

To address the shortcomings of existing causal generative models, CCGM introduces several architectural innovations designed to ensure causal fidelity:

  1. Causal Bottleneck: Latent variables $z$ are forced through a mutatable bottleneck defined by $z = A^T z$, where $A$ is a learned adjacency matrix representing the causal graph.
  2. Leakage Elimination: By removing the exogenous noise term ($\epsilon$) typically found in causal layers, CCGM forces the model to encode all relevant information directly into the causal structure, preventing biases from persisting through hidden channels.
  3. Non-linear Masking: To accommodate complex real-world relationships that are not simple linear combinations, a non-linear mask $g_i$ is applied to the causal layer.
  4. Counterfactual Surgery: The explicit representation of the causal structure in matrix $A$ allows for post-training manipulation. Specific elements of $A$ can be zeroed out to "break" causal paths (e.g., removing a confounding variable's influence) without retraining the entire network.
  5. DAG Enforcement: A differentiable loss function ensures that the learned matrix $A$ remains a Directed Acyclic Graph (DAG), preventing circular logic.

Experimental Evaluation

We evaluated CCGM on two distinct datasets to test its performance across visual and tabular domains.

Sun Pendulum Dataset

The Sun Pendulum is a synthetic physics dataset where the positions of a pendulum and the sun (exogenous variables) determine the shadow's width and position (endogenous variables). This provides a clear ground truth for evaluating visual causal interventions.

Causal graph and sample image from the Sun Pendulum dataset.

National Study of Learning Mindsets

This simulated tabular dataset represents a real-world educational study involving variables such as "School Mindset," "Success Expectation," and "Achievement Score." It tests the model's ability to handle noisy data with complex underlying structures.

Causal structure of the National Study of Learning Mindsets tabular dataset.

Key Results and Insights

CCGM demonstrates a fundamental trade-off between reconstruction fidelity and causal fidelity. While "leakage" in standard models can slightly improve image reconstruction by providing more representational freedom, it undermines causal tasks. CCGM prioritizes causal fidelity, enabling cleaner interventions. In the pendulum dataset, breaking the link between the sun and shadow position resulted in stable shadows even as the sun moved in the latent space—a feat previous models like CausalVAE struggled to achieve.

In the tabular Mindset data, CCGM successfully "de-biased" the dataset. The initial "naïve" Average Treatment Effect (ATE) of 0.468 was reduced to approximately 0.242 after removing the link between student expectations and achievement. This result aligns with advanced statistical adjustment methods like Augmented Inverse Probability Weighting (AIPW), confirming that the generative model learned to simulate away the bias effectively.

Conclusion and Future Work

CCGM provides a robust framework for de-biasing generative models without the need for expensive retraining. By allowing for "what-if" scenarios through simple matrix manipulation, it offers a flexible tool for counterfactual reasoning. However, limitations remain, including sensitivity to extreme noise and challenges in scaling to very large causal graphs with hundreds of variables. Future research will focus on improving noise robustness and exploring automated causal discovery within the CCGM framework to reduce reliance on prior structural knowledge.

Summary updated

BibTeX
@misc{bhat2022de,
  author = {Sunay Bhat and Jeffrey Jiang and Omead Pooladzandi and Gregory J. Pottie},
  title = {{De-Biasing Generative Models using Counterfactual Methods}},
  year = {2022},
  eprint = {2207.01575},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.01575},
}
Figure