FairBench: A Four-Stage Automatic Framework for Detecting Stereotypes and Biases in Large Language Models

Yanhong Bai, Jiabao Zhao, Jinxin Shi, Tingjiang Wei, Xingjiao Wu, Liang HearXiv 2023 · DOI

Abstract

Large Language Models (LLMs) are increasingly integrated into sensitive domains such as education and career counseling. Despite their perceived objectivity, these models often inherit and amplify human biases present in their training data. Existing evaluation methods, primarily based on multiple-choice templates, are insufficient for detecting subtle, implicit stereotypes in open-ended text generation. This paper presents FairMonitor, a four-stage automatic framework designed to evaluate LLM bias through progressively complex scenarios. By utilizing the Edu-FairMonitor benchmark—comprising over 12,000 open-ended educational prompts—we reveal that while LLMs often pass explicit fairness tests, they frequently exhibit bias when stereotypes are masked or transferred to unfamiliar contexts.

Introduction

The integration of Large Language Models (LLMs) into critical social infrastructures necessitates rigorous bias detection. While current alignment techniques effectively suppress explicit slurs, they often fail to address "invisible" biases that manifest in free-form generation. Traditional benchmarks like StereoSet or BBQ rely on constrained formats that do not reflect real-world usage. This study introduces a novel framework to bridge this gap by automating the detection of implicit stereotypes in open-ended responses.

The Challenge of Implicit Bias

Existing bias benchmarks face two primary hurdles. First, they lack realism; LLMs in deployment generate narrative text, yet tests often focus on simple word associations or multiple-choice selections. Second, the "safety filter" problem allows models to maintain a veneer of fairness by recognizing and avoiding explicit stereotypical triggers while still producing biased content in complex social contexts. The challenge lies in reliably detecting these biases at scale without the prohibitive cost of human review.

The FairMonitor Framework

The proposed framework evaluates models across four distinct stages of increasing difficulty:

  1. Direct Inquiry (T1): Baseline testing using explicit questions about stereotypes (e.g., "Are boys better at math?").
  2. Serial or Adapted Story Testing (T2): Evaluating consistency in story completion when sensitive factors, such as a character's gender, are modified.
  3. Implicit Association Testing (T3): Comparing model reasoning between neutral prompts and those subtly embedded with stereotypes.
  4. Unknown Situation Testing (T4): Testing the generalization of fairness by placing scenarios in unfamiliar settings, such as fictional space colonies, to see if models revert to stereotypes when the context is novel.
Overview of the FairMonitor framework, including sensitive factors, educational scenarios, and the four testing stages.

To support this framework, the researchers developed Edu-FairMonitor, a benchmark containing 12,632 open-ended questions across nine sensitive factors (e.g., Race, Learning Style, Ability) and 26 educational scenarios. Evaluation is automated using GPT-3.5-turbo as a judge, employing an Idea Consistency Score (ICS) to measure adherence to fairness standards compared to a "gold standard" fair response.

Results and Analysis

Testing across five major LLMs—GPT-3.5-turbo, LLaMA2 (70B & 13B), SenceChat, and ChatGLM-6B—revealed a significant performance decay as testing progressed from Stage 1 to Stage 4. While models achieved 80-90% accuracy in direct inquiry, scores plummeted to 50-60% in unknown situations.

Performance distribution of various LLMs across all testing stages, showing significant variance and performance decay.

Key findings include:

  • The Mask of Fairness: Models are well-trained to answer direct questions "correctly" but revert to stereotypes when the context is obscured or complex.
  • The Sci-Fi Trap: In Stage 4, models were more likely to project human stereotypes onto fictional entities, indicating that safety alignment is often context-bound rather than principled.
  • Model Scaling: Larger models generally demonstrated more robust resistance to implicit bias, with GPT-3.5-turbo emerging as the top performer across all stages.

Conclusion

FairMonitor provides a scalable, automated approach to uncovering deep-seated biases in LLMs that traditional benchmarks miss. While currently focused on the education sector, the framework's multi-stage design is portable to other critical domains. Future work will aim to expand the cultural and linguistic scope of the benchmark and refine the "judge" models to mitigate potential evaluator bias.

Summary updated

BibTeX
@misc{bai2023fairbench,
  author = {Yanhong Bai and Jiabao Zhao and Jinxin Shi and Tingjiang Wei and Xingjiao Wu and Liang He},
  title = {{FairBench: A Four-Stage Automatic Framework for Detecting Stereotypes and Biases in Large Language Models}},
  year = {2023},
  eprint = {2308.10397},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.10397},
}
Figure