Fine-tuning LLMs with Cross-Attention-based Weight Decay for Bias Mitigation

Farsheed Haque, Zhe Fu, Depeng Xu, Shuhan Yuan, Xi NiuEMNLP 2025

TL;DR

This paper introduces CrAWD, a novel fine-tuning method for Large Language Models (LLMs) that uses cross-attention to identify and decay biased associations with sensitive attributes. CrAWD effectively reduces stereotype bias and improves fairness across various LLMs and tasks without requiring extensive prior knowledge of biases, striking a good balance between utility and fairness.

What Problem Does This Paper Address?

Large Language Models (LLMs) are powerful tools but often inherit and amplify societal biases present in their training data. These biases manifest as stereotypical associations, particularly with sensitive attributes like gender and race, leading to discriminatory outputs. The self-attention mechanisms in LLMs can disproportionately emphasize these biased correlations, making it challenging to generate fair and equitable text. Existing bias mitigation techniques often require deep knowledge of specific biases or tasks, limiting their generalizability. This paper addresses the need for a more versatile and effective fine-tuning approach to mitigate these embedded biases directly within the LLM architecture.

Methods

The core of the proposed method, Cross-Attention-based Weight Decay (CrAWD), lies in modifying the LLM architecture during fine-tuning. CrAWD introduces a cross-attention mechanism that operates between the input sequence and a reference sensitive sequence (e.g., {"he", "she"}). This cross-attention layer helps the model identify input tokens that have strong correlations with these sensitive tokens, potentially indicating biased associations.

Once these potentially biased associations are identified, CrAWD applies weight decay to the cross-attention weights. Specifically, it selects the top-K% of attention weights that are most indicative of bias and decays them by a small factor ($\lambda$). This process deemphasizes, but does not completely remove, the influence of these biased associations on the model's output. The final representation of the LLM is a combination of the original self-attention representation (to preserve task performance) and the decayed cross-attention representation (to reduce bias). This approach aims to mitigate bias without significantly degrading the model's overall performance.

Datasets

The paper uses several datasets for training and evaluation:

  • Jigsaw Unintended Bias in Toxicity dataset: Used for fine-tuning LLMs and evaluating bias mitigation.
  • Bias in Bios dataset: Contains textual biographies and is used to investigate gender bias in NLP models.
  • Stanford Natural Language Inference (SNLI) corpus: Used for evaluating bias mitigation across gender, race, and age.
  • Measuring Hate Speech Corpus: Used for evaluating racial bias in text classification.

Key Insights and Ideas

  • Self-attention as a source of bias: The paper highlights how self-attention mechanisms can disproportionately amplify biased correlations with sensitive tokens, making them a key target for mitigation.
  • Cross-attention for bias identification: The novel use of cross-attention between input sequences and reference sensitive tokens effectively identifies potentially biased associations.
  • Weight decay for targeted mitigation: Applying weight decay to identified biased cross-attention weights allows for a nuanced reduction of bias without completely discarding useful contextual information.
  • Versatility of reference sequences: CrAWD does not require a comprehensive list of all possible sensitive tokens; a small, representative set is sufficient, making it adaptable to various biases and tasks.
  • Balancing utility and fairness: The method demonstrates a strong ability to reduce bias metrics (like WEAT and GAS) while maintaining competitive performance on utility metrics (like PPL and Accuracy).

Key Results

  • Improved Bias Mitigation: CrAWD consistently achieved significantly lower bias scores (e.g., WEAT, GAS, TPR Gap, AUSC) across various LLMs (GPT2, Llama2-7B, Llama3-8B, Falcon-7B, FlanT5-3B, Deepseek-6.7B) and datasets compared to pre-trained and vanilla fine-tuned models. For instance, on the Bias in Bios dataset, CrAWD achieved the lowest GAS and WEAT scores.
  • Comparable Utility: While some fine-tuning methods led to significant performance drops, CrAWD maintained a good balance between bias mitigation and utility, with only a slight increase in perplexity in some cases.
  • Effective with minimal prior knowledge: CrAWD showed strong performance even when using a minimal set of sensitive tokens (e.g., just "he" and "she" for gender bias), outperforming methods that require more extensive prior knowledge.
  • Handles multiple biases: When tested on the SNLI dataset, which includes gender, race, and age biases, CrAWD effectively reduced all three biases simultaneously, unlike some baseline methods that only addressed one bias effectively at the expense of others.

Limitations and Future Work

  • Computational Overhead: The addition of a cross-attention layer increases the LLM's parameter count and runtime complexity during training and inference, which might be a limitation for resource-constrained environments or low-latency applications.
  • Future Work: The authors suggest exploring parameter-light alternative solutions to reduce computational costs and model complexity while retaining effective bias mitigation. They also plan to investigate potential extrinsic harms that might arise from employing debiasing methods.

Summary updated

BibTeX
@inproceedings{haque2025fine,
  author = {Farsheed Haque and Zhe Fu and Depeng Xu and Shuhan Yuan and Xi Niu},
  title = {{Fine-tuning LLMs with Cross-Attention-based Weight Decay for Bias Mitigation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure