Auto-Search and Refinement: An Automated Framework for Gender Bias Mitigation in Large Language Models

Yue Xu, Chengyan Fu, Li Xiong, Sibei Yang, Wenjie Wang

TL;DR

FaIRMaker is a model-agnostic framework designed to mitigate gender bias in Large Language Models (LLMs) without incurring the typical "performance tax" on general tasks. By automatically searching for optimal "Fairwords" (bias-reducing triggers) and refining them into natural language instructions using a lightweight seq2seq model, FaIRMaker provides a portable and efficient way to debias both open-source and closed-source models like GPT-3.5.

The Challenge of LLM Bias

Because LLMs are trained on massive, unfiltered datasets, they inevitably absorb societal prejudices, particularly gender stereotypes. Current solutions generally fall into two camps, both with significant drawbacks:

  1. Parameter Modification: Methods like fine-tuning or RLHF are resource-heavy and impossible to apply to "black-box" API models (e.g., GPT-4).
  2. Instruction-based Prompting: Manually designed "fairness prompts" often confuse the model on neutral tasks, leading to a drop in general intelligence—a phenomenon known as the "utility preservation" problem.

The authors aim to bridge this gap with a system that is automated (requiring no manual prompt engineering), applicable to closed-source models, and utility-preserving (ensuring the model doesn't lose its edge in math or coding just because it's being "fair").

How FaIRMaker Works

The core of the paper is the Auto-Search and Refinement paradigm, which operates in three distinct stages:

FaIRMaker Architecture
  1. Auto-Searching (Fairwords Optimization): Using a technique called Greedy Coordinate Gradient (GCG), the system searches for "Fairwords"—sequences of tokens that, when added to a query, maximize the probability of a "fair" response and minimize a "biased" one. Initially, these Fairwords are often nonsensical "gibberish" tokens that are highly effective but unreadable.
  2. Filtering: Not all searched triggers are created equal. The framework evaluates these triggers on a held-out set and keeps only the "Fairwords Bag"—the ones that genuinely reduce bias while maintaining response quality.
  3. Refinement (The Secret Sauce): Because nonsensical tokens don't transfer well to closed-source API models, the authors train a small seq2seq refiner (Llama 3.2-3B). This refiner takes a user query and a "vanilla" Fairword and transforms them into a natural language instruction.
  4. For gender-related queries, it generates debiasing instructions.
  5. For neutral queries, it generates performance-boosting prompts.

This makes the framework a "plug-and-play" module that sits seamlessly between the user and the LLM.

Datasets Used

The authors utilized a robust suite of datasets for training and evaluation:

  • Training/Search: GenderAlign (8k gender-related dialogues with "chosen" and "rejected" responses).
  • Bias Evaluation: GA-test (open-ended) and BBQ-gender (a standard multiple-choice benchmark for bias in ambiguous/disambiguated contexts).
  • General Utility Evaluation: MMLU (general knowledge), HellaSwag (commonsense), and various instruction-following benchmarks like Dolly Eval, Instruct Eval, and BPO Eval.

Key Insights

  • The "Emotional" Trigger: In a fascinating interpretability analysis, the authors found that the optimized "gibberish" Fairwords often encoded emotional tones like urgency, frustration, or seriousness. These cues implicitly steer the model toward more careful, less stereotypical responses without needing explicit "don't be biased" commands.
  • Beyond Debiasing: FaIRMaker doesn't just "fix" bias; it often acts as a prompt optimizer. Because the refiner is trained on both biased and neutral tasks, it can actually improve performance on general benchmarks (like MMLU) by providing clearer task instructions.
  • Transferability: Because the system converts optimized triggers into natural language, a "Fairword" discovered on an open-source model (Llama 2) can be successfully used to debias a closed-source model (GPT-3.5).

Key Results

FaIRMaker demonstrates strong performance in both reducing bias and maintaining the model's core capabilities.

Response Scores Across Models
  • Bias Reduction: On the BBQ-gender benchmark, FaIRMaker reduced bias scores (sDIS and sAMB) by at least half across all tested models.
  • Utility Preservation: Unlike baseline methods (like CF-D or Desc-D) which often degraded response quality, FaIRMaker consistently improved general task scores. For example, Llama2-Alpaca saw a +4.44% gain on MMLU and a significant jump in Dolly Eval scores (from 2.55 to 3.94).
  • Efficiency: The refinement process adds roughly 1.5 seconds of latency per query, making it viable for real-time applications.
  • Compatibility: The framework showed consistent wins across the Llama 2, Qwen, and GPT-3.5 families, proving its model-independent nature.

Limitations and Future Work

  • Binary Scope: The current study focuses primarily on binary gender bias. The authors acknowledge that future work needs to expand this to non-binary identities and other protected groups (race, religion, age).
  • Scalability Overhead: While 1.5 seconds is low, it is still an extra step. The authors suggest exploring "lightweight refinement" or batching to further reduce this overhead.
  • Fine-Grained Refinement: The authors hope to move toward even more specific refinement that can handle highly nuanced societal norms that change over time.

Summary updated

BibTeX
@inproceedings{xu2025auto,
  author = {Yue Xu and Chengyan Fu and Li Xiong and Sibei Yang and Wenjie Wang},
  title = {{Auto-Search and Refinement: An Automated Framework for Gender Bias Mitigation in Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=Hehoz0QgeF},
}
Figure