Linear Adversarial Concept Erasure

Shauli Ravfogel, Michael Twiton, Yoav Goldberg, Ryan Cotterell

TL;DR

This paper introduces Linear Adversarial Concept Erasure (LACE), a principled framework for removing specific information—such as gender bias—from pre-trained neural representations. By formulating concept removal as a constrained linear minimax game, the authors demonstrate that even a rank-1 projection (removing a single dimension) is often sufficient to exhaustively neutralize the linear predictability of a concept while preserving the overall utility of the data.

The Problem: Unwanted Concepts in Pre-trained Models

Modern AI relies heavily on massive pre-trained models (like BERT or GloVe) that learn representations without direct supervision. Unfortunately, these representations often inadvertently capture unwanted "concepts," such as societal biases or private attributes, which then propagate into downstream applications.

The "Linear Bias Subspace Hypothesis" suggests that these concepts live within specific linear subspaces of the high-dimensional embedding space. If we can identify and "project out" these subspaces, we can theoretically neutralize the bias. However, existing methods like Iterative Nullspace Projection (INLP) are often sub-optimal or greedy. They iteratively remove dimensions, potentially discarding more information than necessary or failing to be exhaustive. The authors seek a more mathematically rigorous and "surgical" way to perform this post-hoc erasure.

Methods: A Linear Minimax Game

The authors frame the problem as a linear minimax game between two players:

  1. The Predictor ($\theta$): A linear model trying to predict the target concept (e.g., gender) from the representations.
  2. The Adversary ($P$): An orthogonal projection matrix that tries to transform the data to make the predictor's job as difficult as possible.

The goal is to find a projection matrix $P$ of a fixed rank $k$ that maximizes the predictor's loss.

Key Innovations

  • Closed-Form Solutions: For specific cases like linear regression and Rayleigh quotient problems, the authors derive exact, closed-form solutions.
  • R-LACE (Relaxed LACE): For classification tasks (like logistic regression) where no closed-form solution exists, the authors propose a convex relaxation. They relax the set of projection matrices to their convex hull, known as the Fantope. This turns a difficult non-convex problem into a "well-behaved" convex-concave game that can be solved using alternating gradient descent.

Key Insights and Ideas

Rank-1 is Surprisingly Powerful

One of the most striking findings is that for many tasks, removing just a single dimension (rank-1) is enough to drop a linear classifier's accuracy to random chance.

Surgical Precision vs. Greedy Approaches

Unlike INLP, which iteratively removes dimensions one by one, R-LACE identifies the optimal subspace globally. R-LACE reaches "majority accuracy" (equivalent to random guessing for the concept) much faster than INLP, meaning it preserves more of the original representation's useful features.

Comparison of R-LACE and INLP on post-projection accuracy. R-LACE neutralizes the concept, reaching majority accuracy with far fewer dimensions removed.

Linear Erasure for Non-linear Models

While the method is linear, the authors argue it is highly effective when applied to the final layers of deep models, which are typically linear. However, they caution that non-linear "probes" can still sometimes recover the erased information.

Key Results across Datasets

The method was evaluated across three distinct domains:

  • Static Word Embeddings (GloVe): R-LACE reduced biased associations (measured by the Word Embedding Association Test, WEAT) to nearly non-significant levels, outperforming both PCA-based methods and INLP.
  • Deep Contextualized Representations (BERT): On the Bios dataset (short biographies annotated for gender and profession), R-LACE effectively hindered the ability to predict gender from [CLS] tokens using only a rank-1 projection. In contrast, INLP required nearly 100 iterations to achieve the same effect.
  • Image Data (CelebA): When applied to raw pixels targeting concepts like "wearing glasses," the rank-1 projection visually "blurs" or "adds" features associated with the concept. For example, erasing the "glasses" concept results in images where every face appears to have a ghostly pair of frames added, effectively making the presence of real glasses uninformative to a linear classifier.
Qualitative results of rank-1 projection on CelebA images for the "glasses" concept. The projection adds a ghostly pair of frames, neutralizing the feature for linear classifiers.

Limitations and Future Work

  • Linearity Constraint: The method specifically targets linear predictability. Non-linear classifiers (like RBF-SVMs) can still recover the concept with high accuracy after linear erasure.
  • Binary Assumptions: The experiments primarily focus on binary gender, which is a simplification of a non-binary concept. The authors acknowledge this as a limitation for real-world deployment.
  • Future Directions: Extending this framework to protect against non-linear adversaries while maintaining the interpretability and tractability of the linear approach remains a significant open challenge.

Summary updated

BibTeX
@inproceedings{ravfogel2022linear,
  author = {Shauli Ravfogel and Michael Twiton and Yoav Goldberg and Ryan Cotterell},
  title = {{Linear Adversarial Concept Erasure}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=T1lx952f0X},
}
Figure