Reducing Gender Bias in BERT-Based Sentiment Analysis Using Counterfactual Training: A Multi-Architecture Sensitivity and Robustness Analysis
Pretrained Transformer models such as BERT, RoBERTa, and DeBERTa absorb social and gender biases from large, uncurated text corpora, and when fine-tuned for sentiment analysis they often change predictions solely because a demographic or gendered term is swapped . This study tests a combined counterfactual training approach—pairing Context-Aware Counterfactual Data Augmentation (Context-CDA) with Counterfactual Logit Pairing (CLP)—to reduce gender bias in fine-tuned sentiment classifiers without hurting overall accuracy . Four Transformer architectures are evaluated across the SST-2 and IMDB sentiment benchmarks and audited for bias using the Equity Evaluation Corpus (EEC), with demographic bias measured via Counterfactual Token Fairness (CTF) sentiment flip rates and the Wasserstein-1 distance between male and female score distributions . Without debiasing, standard BERT-base flips its sentiment predictions on 12.8% of gendered sentence pairs in the EEC ; applying Context-CDA alongside CLP regularization (λCLP = 1.0) drops the flip rate to 1.7% in BERT-base, 1.4% in RoBERTa-base, and 1.1% in DeBERTav3, while the Wasserstein-1 gender distance falls from 0.084 to 0.009 and SST-2 accuracy drops by less than 0.4% . Combining context-aware counterfactual augmentation with logit pairing therefore reliably reduces gender sensitivity across different Transformer architectures while keeping downstream classification accuracy intact.
Authors
- Divya S.
- Soumya V
- Shubhashree DM
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-01
- DOI
- https://doi.org/10.5281/zenodo.24712968
- Primary Topic
- Ethics and Social Impacts of AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00