Research map / Large language models / Language, safety and interpretability
All Should Be Equal in the Eyes of LMs: Counterfactually Aware Fair Text Generation
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes CAFIE, a training-free inference-time method that generates counterfactual prompts by swapping sensitive tokens across demographic groups and reweights next-token distributions so outputs are equitable across groups.
Problem
Bias in language model text generation; existing inference-time debiasing methods contrast against biased templates and do not enforce equitable treatment across all demographic groups.
Approach
Generate counterfactual contexts by replacing sensitive tokens with tokens from other groups in the same attribute, then adjust the source next-token distribution using tanh-based weights on differences from counterfactual distributions, mixed with the original distribution.
Key results
- Across three models, CAFIE improves the overall StereoSet stereotype score by 4.71% over baselines (overall SS 55.85 vs 58.66 best baseline for GPT-2 Small per table).
- CAFIE outperforms baselines by an overall 6.23% on CrowS-Pairs and by 6.70% in BOLD mean sentiment and 21.31% in BOLD SD.
- Human study: annotators rated baseline outputs 61% more biased and CAFIE only 11% more biased.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Apply CAFIE instead of the strongest listed baseline | GPT-2 Small · StereoSet overall | stereotype score: 59.02 -> 55.85 | Helped |
| Apply CAFIE instead of the strongest listed baseline | GPT-2 Small · StereoSet overall | ICAT: 73.53 -> 76.78 | Helped |
| Apply CAFIE instead of SDB | GPT-2 Small · CrowS-Pairs religion | stereotype score: 37.14 -> 52.38 | Helped |
| Apply CAFIE instead of the strongest listed baseline | GPT-2 Small · BOLD | mean sentiment: 0.44 -> 0.47 | Helped |
| Apply CAFIE instead of SDB | GPT-2 Small · BOLD | sentiment SD: 0.32 -> 0.18 | Helped |
| Apply CAFIE instead of SDB | GPT-2 Small · WikiText-2 | fluency (perplexity): 11.80 -> 18.19 | Hurt |
| Increase α from 0 to 0.99 (ablation) | CAFIE on GPT-2 Large · StereoSet gender | ICAT: 60.13 -> 77.32 | Helped |
| Set α to 1 rather than 0.99 (ablation) | CAFIE on GPT-2 Large · StereoSet gender | ICAT: 77.32 -> 61.47 | Hurt |
| Use tanh token weights rather than jpdf (ablation) | CAFIE on GPT-2 Large · StereoSet gender | ICAT: 59.17 -> 77.32 | Helped |
| Use tanh token weights rather than ratio averaging (ablation) | CAFIE on GPT-2 Large · StereoSet gender | ICAT: 65.52 -> 77.32 | Helped |
| Use tanh token weights rather than weight function (ablation) | CAFIE on GPT-2 Large · StereoSet gender | ICAT: 58.62 -> 77.32 | Helped |
| Use tanh token weights rather than softsign (ablation) | CAFIE on GPT-2 Large · StereoSet gender | ICAT: 58.54 -> 77.32 | Helped |
Surprising findings
- Baselines such as SDB and SD sometimes amplify bias relative to the vanilla model on certain attributes.
- Instruction and Zero-shot CoT prompting retain LM score but are worse at debiasing than CAFIE and SDB.
Limitations
- Sensitive attribute lists are not exhaustive and binary gender only.
- Oversimplifies intra-group variance across demographic groups.
- Handles toxicity only implicitly.
Experimental setup
Datasets: StereoSet CrowS-Pairs BOLD WikiText-2 NLG-bias
Benchmarks: StereoSet CrowS-Pairs BOLD WikiText-2
Metrics: stereotype score language modeling score ICAT fluency perplexity BOLD mean sentiment BOLD sentiment standard deviation VADER sentiment
Baselines: Base LM SentenceDebias Self-Debias Zero-shot CoT Instruction prompting
Builds on: SentenceDebias Self-Debias Counterfactual Data Augmentation
Closest papers by meaning
- LIDAO: Towards Limited Interventions for Debiasing (Large) Language Models (ICML 2024 · similarity 0.90)
- Auto-Search and Refinement: An Automated Framework for Gender Bias Mitigation in Large Language Models (NeurIPS 2025 · similarity 0.89)
- Evaluating the Efficacy of Prompting Techniques for Debiasing Language Model Outputs (Student Abstract) (AAAI 2024 · similarity 0.88)
- Is Your Model Fairly Certain? Uncertainty-Aware Fairness Evaluation for LLMs (ICML 2025 · similarity 0.88)
- Biases Mitigation and Expressiveness Preservation in Language Models: A Comprehensive Pipeline (Student Abstract) (AAAI 2024 · similarity 0.88)
- AIM-Fair: Advancing Algorithmic Fairness via Selectively Fine-Tuning Biased Models with Contextual Synthetic Data (CVPR 2025 · similarity 0.87)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
