Introduction
Language models (LMs) frequently internalize and amplify societal biases from their training data. While methods to measure these biases are well-established, identifying the specific parameters responsible for stereotypical behavior remains a challenge. Traditional mitigation strategies, such as full-model retraining or extensive fine-tuning on debiased datasets, are computationally expensive and risk degrading the model's general linguistic capabilities. This paper introduces "Local Contrastive Editing," a surgical approach designed to pinpoint and modify the specific weights—often less than 0.5% of the total—that drive gender stereotypes.
Methodology: Local Contrastive Editing
The proposed framework consists of two primary stages: localization and weight editing.
1. Localization
To identify weights associated with bias, the researchers employ Iterative Magnitude Pruning (IMP). They compare two versions of a base model (BERT-base-uncased): one fine-tuned on stereotypical data and another on "anti-stereotypical" data created via Counterfactual Data Augmentation (CDA). Localization is achieved through two methods:
- Mask-based: Identifying weights present in the "winning ticket" of only one model.
- Value-based: Selecting weights with the largest numerical difference between the stereotypical and anti-stereotypical versions.
2. Weight Editing
Once localized, the target weights are modified relative to a reference model using several strategies:
- Interpolation (IP): Moving target weights toward reference values.
- Extrapolation (EP): Pushing weights further away from biased values.
- Pruning (PR): Zeroing out the identified weights.
- Mask Switching (SW): Applying the reference model's structural mask to the target.
The "Address" of Bias in Parameter Space
A key finding of this work is that bias is highly localized. The localization process consistently identified weights in the later layers of the transformer architecture, particularly within the attention output dense layers. This suggests that while early layers manage fundamental syntax, social associations are encoded deeper in the processing pipeline. Crucially, "uninformed" (random) edits served as a control and failed to affect bias levels, confirming that the localization method successfully identified the specific drivers of stereotype encoding.
Experimental Results
The effectiveness of these edits was evaluated using standard benchmarks: WEAT for word-level associations, and StereoSet and CrowS-Pairs for sentence-level preferences.
Bias Mitigation and Performance Preservation
The surgical approach allowed for significant bias reduction with minimal impact on general performance. Using mask-based interpolation, the researchers could effectively "dial" the model's bias level. Unlike traditional fine-tuning, which often leads to catastrophic forgetting, this method maintained nearly identical perplexity and downstream task accuracy (GLUE scores typically dropped by less than 1%).
However, the study noted that value-based pruning is risky; simply zeroing out weights based on numerical differences caused significant performance degradation, indicating these weights still contribute to general language modeling tasks despite their role in bias.
Conclusion and Future Directions
Local Contrastive Editing demonstrates that gender bias in LMs is concentrated in a tiny fraction of the model's parameters. By targeting these specific "bias neurons," it is possible to steer model behavior without compromising general utility.
Future research should explore whether these findings generalize to larger decoder-only models (e.g., GPT-4) and more complex, intersectional social biases. Additionally, while the editing process is efficient, the current localization method is computationally intensive, highlighting a need for more efficient, gradient-based discovery of biased parameters.
Summary updated