Table of Contents
Fetching ...

A Practical Method for Generating String Counterfactuals

Matan Avitan, Ryan Cotterell, Yoav Goldberg, Shauli Ravfogel

TL;DR

The paper tackles the challenge of translating representation-space interventions in language models into natural-language counterfactuals. It introduces a practical pipeline that pairs representation surgery (LEACE, MiMiC, MiMiC+) with an inversion-based decoding step to produce string counterfactuals. Through BiasBios, it demonstrates that these counterfactuals are semantically coherent, reveal latent gender cues, and can mitigate bias when used for data augmentation without harming primary task performance. The work provides a framework for meta-interpretability and fairness-aware augmentation, while outlining limitations and avenues for extending beyond binary gender and refining inversion fidelity.

Abstract

Interventions targeting the representation space of language models (LMs) have emerged as an effective means to influence model behavior. Such methods are employed, for example, to eliminate or alter the encoding of demographic information such as gender within the model's representations and, in so doing, create a counterfactual representation. However, because the intervention operates within the representation space, understanding precisely what aspects of the text it modifies poses a challenge. In this paper, we give a method to convert representation counterfactuals into string counterfactuals. We demonstrate that this approach enables us to analyze the linguistic alterations corresponding to a given representation space intervention and to interpret the features utilized to encode a specific concept. Moreover, the resulting counterfactuals can be used to mitigate bias in classification through data augmentation.

A Practical Method for Generating String Counterfactuals

TL;DR

The paper tackles the challenge of translating representation-space interventions in language models into natural-language counterfactuals. It introduces a practical pipeline that pairs representation surgery (LEACE, MiMiC, MiMiC+) with an inversion-based decoding step to produce string counterfactuals. Through BiasBios, it demonstrates that these counterfactuals are semantically coherent, reveal latent gender cues, and can mitigate bias when used for data augmentation without harming primary task performance. The work provides a framework for meta-interpretability and fairness-aware augmentation, while outlining limitations and avenues for extending beyond binary gender and refining inversion fidelity.

Abstract

Interventions targeting the representation space of language models (LMs) have emerged as an effective means to influence model behavior. Such methods are employed, for example, to eliminate or alter the encoding of demographic information such as gender within the model's representations and, in so doing, create a counterfactual representation. However, because the intervention operates within the representation space, understanding precisely what aspects of the text it modifies poses a challenge. In this paper, we give a method to convert representation counterfactuals into string counterfactuals. We demonstrate that this approach enables us to analyze the linguistic alterations corresponding to a given representation space intervention and to interpret the features utilized to encode a specific concept. Moreover, the resulting counterfactuals can be used to mitigate bias in classification through data augmentation.
Paper Structure (46 sections, 12 equations, 3 figures, 7 tables)

This paper contains 46 sections, 12 equations, 3 figures, 7 tables.

Figures (3)

  • Figure 1: The counterfactual lens induces diverse string counterfactuals by leveraging different representation surgery (i.e., representation-level interventions.) Green denotes the intended or expected behavior following a gender shift, while blue marks stereotypical or otherwise undesired expansions.
  • Figure 2: An illustration of our method. We first encode the original text to obtain a representation $\mathbf{h} \in {\color{MacroColor} \mathbb{R}^D}$. We then apply some form of representation surgery, i.e., to steer or erase a particular concept to produce a modified representation $\mathbf{h}'$. Finally, we invert the representation-level counterfactual to obtain a string-level counterfactual.
  • Figure 3: Words with the largest change in PMI.