Disclosure and Mitigation of Gender Bias in LLMs

Xiangjue Dong, Yibo Wang, Philip S. Yu, James CaverleearXiv 2024 · DOI

Introduction

Large Language Models (LLMs) are increasingly "safety-aligned" to avoid generating harmful content, including overt gender stereotypes. However, this alignment often creates a false sense of security. While models may provide balanced responses to direct questions (e.g., "The nurse finished ___ shift"), gender bias frequently persists in seemingly neutral contexts. This paper introduces an indirect probing framework to uncover these hidden biases and proposes Debias Tuning, a QLoRA-based strategy to mitigate both explicit and implicit gender bias without relying on predefined stereotype lists.

Indirect Probing Framework

Traditional bias evaluation relies on "direct probing" using specific keywords like "doctor" or "homemaker." The authors argue this is insufficient as models learn to bypass these triggers and lists of stereotypes are inherently incomplete.

Instead, the proposed framework uses neutral prompts starting with "My friend..." to observe how models inject gendered pronouns (explicit bias) or skew internal probability distributions (implicit bias).

Conceptual overview of explicit vs. implicit gender bias in neutral contexts.

Probing is conducted across three data categories:

  1. Naturally-sourced: Sentences from human datasets (STS-B, SNLI) where "person" is replaced with "My friend."
  2. LLM-generated: Neutral statements generated by ChatGPT.
  3. Template-based: Traditional subject-verb-object templates used for baseline comparison.

To quantify bias, the authors define three metrics: Gender Attribute Score (GAS) for explicit word injection, Gender Logits Difference (GLD) for implicit probability skew, and Attribute Distribution Distance (ADD) to measure the divergence between male and female attribute distributions.

The authors evaluated ten prominent LLMs, including Llama 2, Vicuna, Falcon, and OPT. The results reveal several critical insights:

  • The "Neutral" Trap: Even in prompts devoid of stereotypes (e.g., "My friend is happy"), models frequently assume a specific gender in the continuation.
  • The Alignment Paradox: Safety-aligned "Chat" or "Instruct" models often exhibit higher levels of bias in indirect tests than their base counterparts. This suggests that alignment may only mask bias in direct queries while leaving underlying distributions untouched.
  • Scale and Bias: Larger models (e.g., 13B vs. 7B) generally showed more explicit bias in neutral contexts, indicating that increasing parameters does not inherently solve the problem.
Gender Logits Difference (GLD) across various LLMs and data sources, indicating persistent implicit bias.

As shown in the GLD results, all tested models exhibit a significant difference in the probabilities assigned to gendered tokens, even when the context provides no justification for such a skew.

Debias Tuning Mitigation

To address these findings, the paper proposes Debias Tuning, a QLoRA-based fine-tuning method using a composite loss function:

  • Distribution Distance Loss ($\mathcal{L}_d$): Minimizes the distance between male and female attribute distributions.
  • Gender Probability Loss ($\mathcal{L}_g$): Reduces the overall probability of injecting gendered words in neutral contexts rather than just balancing them.
  • Attribute Logits Difference Loss ($\mathcal{L}_l$): Minimizes the normalized probability difference between gendered pronouns.

In testing on Llama 2 7B, Debias Tuning successfully reduced explicit bias (GAS) to 0.000 and significantly lowered implicit bias metrics (GLD and ADD) compared to standard instruction guiding or hyperparameter tuning.

Conclusion and Future Work

This research highlights that gender bias in LLMs is deeper than surface-level stereotypes. While Debias Tuning offers a robust path forward, the study is currently limited to binary gender definitions. Future work should expand this framework to include non-binary and fluid gender identities and investigate how these intrinsic biases translate into extrinsic real-world harms.

Summary updated

BibTeX
@misc{dong2024disclosure,
  author = {Xiangjue Dong and Yibo Wang and Philip S. Yu and James Caverlee},
  title = {{Disclosure and Mitigation of Gender Bias in LLMs}},
  year = {2024},
  eprint = {2402.11190},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.11190},
}
Figure