Debiasing Algorithm through Model Adaptation

Tomasz Limisiewicz, David Mareček, Tomáš Musil

TL;DR

Researchers have developed DAMA (Debiasing Algorithm through Model Adaptation), a novel method that identifies and "mutes" gender bias within Large Language Models (LLMs) like LLaMA. By using causal tracing to locate specific "bias mediator" layers and applying linear projections to their weights, DAMA significantly reduces stereotypical associations without degrading the model's general reasoning or language capabilities.

What Problem Does This Paper Address?

Large Language Models (LLMs) are notorious for absorbing the societal biases present in their massive training datasets. This often manifests as gender stereotyping—for example, a model might consistently associate "doctor" with "he" and "nurse" with "she."

While many attempts have been made to "debias" these models, they often face a "tax": reducing bias frequently comes at the cost of the model's general performance (its "intelligence" on downstream tasks) or its ability to generate coherent text (measured by perplexity). Furthermore, many existing methods are "black boxes" that don't explain where the bias is stored. This paper seeks a surgical solution: find exactly where the bias lives within the network and neutralize it without breaking the rest of the machine.

Methods

The authors' approach, DAMA, consists of two primary phases:

  1. Causal Tracing (The Diagnosis): To find the "bias mediators," the researchers used a technique called causal tracing. They fed the model a stereotypical prompt (e.g., "The lifeguard laughed because...") and monitored the internal activations. They then "corrupted" the input by adding noise to the profession word and systematically "restored" specific layers to see which ones brought the biased prediction back. They discovered that mid-to-upper feed-forward (MLP) layers (roughly the 65th to 93rd percentile of layers) are the primary culprits for storing stereotypical associations.

  2. Model Adaptation (The Cure): Once the problematic layers were identified, the authors treated the MLP layers as memory units that map "keys" (input representations) to "values" (output predictions).

  3. They used Partial Least Squares (PLS) to identify a "stereotype subspace"—the specific directions in the model's internal math that correlate most strongly with gendered pronouns.

  4. They then applied an orthogonal projection matrix to the weight matrices of those specific layers. Essentially, they "flattened" the dimensions that convey stereotypical bias, ensuring that the output of those layers is orthogonal (unrelated) to the guarded bias subspace.
Overview of the DAMA method, showing the architectural intervention and its effect on output probabilities.

Crucially, DAMA does not change the model's architecture or parameter count; it simply edits the existing weights to filter out the biased directions.

Datasets and Evaluation

The study evaluated the LLaMA family (7B to 65B parameters) using several benchmarks:

  • WinoBias: A coreference resolution task testing if models can link pronouns to professions in both pro-stereotypical and anti-stereotypical contexts.
  • StereoSet: A dataset measuring stereotypical bias across various domains via sentence completion.
  • Wikipedia 103: Used to measure perplexity to ensure the model still understands general English.
  • Downstream Tasks: ARC (Reasoning), OpenBookQA, and MMLU (Multitask Language Understanding) to verify that the "surgery" didn't impair general intelligence.
  • New Diagnostic Metric: The authors introduced an interpretable metric for language generation that uses a set of 200+ professions (annotated for factual vs. stereotypical gender) to measure how strongly a model's predictions are influenced by stereotypes.

Key Insights and Ideas

  • Bias is Localized: Stereotypical bias isn't evenly distributed. It lives primarily in the MLP (feed-forward) blocks of the mid-upper layers. This reinforces the theory that MLPs act as the "knowledge base" of Transformers.
  • Surgical vs. Global: Unlike fine-tuning (which shifts all weights slightly), DAMA is a targeted intervention. By only modifying the "bias-vulnerable" layers, the authors preserved the model's performance on unrelated tasks like science questions or logic puzzles.
  • Factual vs. Stereotypical: The model's internal representation of "factual" gender (e.g., "king" vs. "queen") is distinct from "stereotypical" gender (e.g., "doctor" vs. "nurse"). DAMA aims to suppress the latter while leaving the former intact.

Key Results

  • Significant Bias Reduction: In LLaMA-7B, the "stereotypical impact" coefficient dropped from 0.235 to -0.005 (essentially zero), indicating that stereotypical cues no longer drove the model's pronoun predictions.
  • Performance Retention: On the MMLU benchmark, the DAMA-edited LLaMA-7B scored 30.8%, actually slightly higher than the original model's 30.3%.
  • Superiority over Baselines: DAMA outperformed other model-editing techniques like MEMIT and LoRA. While LoRA (fine-tuning) reduced bias, it significantly degraded the model's perplexity (making its speech less natural); DAMA maintained high-quality text generation.

Limitations and Future Work

  • English-Centric: The study focused exclusively on English and binary gender (he/she). The authors acknowledge that morphologically rich languages (like those with gendered nouns/adjectives) present a much harder challenge.
  • Subspace Identification: While PLS worked well, the authors suggest that more advanced methods like "convex search" might find even more precise projection matrices.
  • Scaling: While the method worked on models up to 65B parameters, the hyperparameter search for the "correct" layers to edit becomes more complex as models grow.
  • Other Biases: The framework is theoretically applicable to racial, religious, or political biases, but this paper only validated it for gender.

Summary updated

BibTeX
@inproceedings{limisiewicz2024debiasing,
  author = {Tomasz Limisiewicz and David Mareček and Tomáš Musil},
  title = {{Debiasing Algorithm through Model Adaptation}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=XIZEFyVGC9},
}
Figure