Adversarial Concept Erasure in Kernel Space

Shauli Ravfogel, Francisco Vargas, Yoav Goldberg, Ryan Cotterell

Abstract

The representation space of neural models for textual data emerges in an unsupervised manner during training. Understanding how those representations encode human-interpretable concepts is a fundamental problem. One prominent approach for the identification of concepts in neural representations is searching for a linear subspace whose erasure prevents the prediction of the concept from the representations. However, while many linear erasure algorithms are tractable and interpretable, neural networks do not necessarily represent concepts in a linear manner. To identify non-linearly encoded concepts, we propose a kernelization of a linear minimax game for concept erasure. We demonstrate that it is possible to prevent specific non-linear adversaries from predicting the concept. However, the protection does not transfer to different nonlinear adversaries. Therefore, exhaustively erasing a non-linearly encoded concept remains an open problem.

Introduction

Deep learning models represent data as high-dimensional vectors that often encode human-interpretable concepts, ranging from semantic properties like "size" to sensitive attributes like "gender" or "race." While linear concept erasure—projecting out a specific direction in vector space—has been a standard approach, it fails to address the non-linear nature of neural networks. Even if linear evidence is removed, "pockets" of information may persist in non-linear manifolds. This research introduces a kernelized maximin game to identify and neutralize concepts encoded non-linearly.

Methodology: Kernelized Concept Erasure

The proposed framework transforms concept erasure into a maximin game played within a Reproducing Kernel Hilbert Space (RKHS).

  1. The Maximin Game: An "erasor" seeks a projection that minimizes concept predictability, while an "adversary" attempts to recover the concept from the projected data.
  2. Kernelization: By employing kernels (e.g., Polynomial, RBF), the problem is mapped to a higher-dimensional space where non-linear relationships can be treated linearly.
  3. Nyström Approximation: To manage the computational complexity of standard kernel methods, the Nyström method is used to approximate the kernel space, ensuring scalability for large datasets.
  4. Pre-image Mapping: Since erasure occurs in an abstract kernel space, a Multilayer Perceptron (MLP) is trained to map cleaned kernel features back to the original input space, producing "neutralized" embeddings.

Experimental Evaluation

The method was evaluated on three benchmarks:

  • GloVe: Testing binary gender erasure in static word embeddings.
  • Bias-in-Bios: Assessing the impact of gender erasure on profession prediction (extrinsic task).
  • SimLex-999: Measuring "intrinsic damage" to ensure semantic meaning is preserved.

Results and Discussion

The Challenge of Transferability

A primary finding of this work is the failure of the "Exhaustive RKHS Hypothesis." Mapping data into a high-dimensional kernel space and erasing a concept there does not guarantee its permanent removal. As shown in the transferability matrix, while a method might fool an adversary using the same kernel, other non-linear models—especially MLPs—can still recover the concept with high accuracy.

Transferability of concept erasure across different kernels and an MLP adversary.

The "MLP God Mode" is particularly striking: a simple MLP with one hidden layer recovered gender information with approximately 97% accuracy across all kernel erasure types. This suggests that concept information is "leaky" and deeply woven into the geometry of the representation space.

Bias Mitigation and Utility Preservation

Despite the lack of exhaustive erasure, the method effectively reduces measurable bias. The Word Embedding Association Test (WEAT) scores show a significant reduction in bias compared to original embeddings, with results comparable across different kernel types.

WEAT scores showing bias reduction across various kernel erasure methods compared to the original embeddings.

Furthermore, the erasure is "surgical." In the Bias-in-Bios task, profession prediction accuracy only slightly decreased (from 76.93% to 74.19%), and SimLex-999 scores remained stable, indicating that general semantic utility is preserved.

Conclusion

This research demonstrates that while specific non-linear adversaries can be neutralized in kernel space, "exhaustive" concept erasure remains an open challenge due to the lack of transferability between different non-linear spaces. Future work should focus on protecting against diverse sets of adversaries simultaneously and exploring the theoretical limits of erasure in finite-dimensional spaces.

Summary updated

BibTeX
@inproceedings{ravfogel2022adversarial,
  author = {Shauli Ravfogel and Francisco Vargas and Yoav Goldberg and Ryan Cotterell},
  title = {{Adversarial Concept Erasure in Kernel Space}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.405},
}
Figure