Detecting Gender Bias in Transformer-based Models: A Case Study on BERT
Not on the map. Why?
Abstract (arXiv)
In this paper, we propose a novel gender bias detection method by utilizing attention map for transformer-based models. We 1) give an intuitive gender bias judgement method by comparing the different relation degree between the genders and the occupation according to the attention scores, 2) design a gender bias detector by modifying the attention module, 3) insert the gender bias detector into different positions of the model to present the internal gender bias flow, and 4) draw the consistent gender bias conclusion by scanning the entire Wikipedia, a BERT pretraining dataset. We observe that 1) the attention matrices, Wq and Wk introduce much more gender bias than other modules (including the embedding layer) and 2) the bias degree changes periodically inside of the model (attention matrix Q, K, V, and the remaining part of the attention layer (including the fully-connected layer, the residual connection, and the layer normalization module) enhance the gender bias while the averaged attentions reduces the bias).
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 19 of its 21 references that are in the map. First posted on arXiv 15 Oct 2021.
Builds on
19 of 21 references.
References · 19
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,372
- 2021Swin Transformer: Hierarchical Vision Transformer using Shifted Windowscited by 12,139
- 2020End-to-End Object Detection with Transformerscited by 7,414
- 2020Training data-efficient image transformers & distillation through attentioncited by 4,586
- 2020Deformable DETR: Deformable Transformers for End-to-End Object Detectioncited by 3,422
- 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,811
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,790
- 2019A Survey on Bias and Fairness in Machine Learningcited by 1,917
7 more
- 2016Man is to Computer Programmer as Woman is to Homemaker? Debiasing Word Embeddingscited by 1,312
- 2018Gender Bias in Coreference Resolution: Evaluation and Debiasing Methodscited by 659
- 2019Multi-Task Deep Neural Networks for Natural Language Understandingcited by 350
- 2019A Multiscale Visualization of Attention in the Transformer Modelcited by 292
- 2018Gender Bias in Neural Natural Language Processingcited by 211
- 2021Societal Biases in Language Generation: Progress and Challengescited by 202
- 2020On Interpretability of Artificial Neural Networks: A Surveycited by 88
Built on by
Citing papers per year: 2022: 3; 2023: 3; 2024: 0; 2025: 2.
8 papers.
- 2023Efficient Avoidance of Vulnerabilities in Auto-completed Smart Contract Code Using Vulnerability-constrained Decodingcited by 14
- 2022Towards an Enhanced Understanding of Bias in Pre-trained Neural Language Models: A Survey with Special Emphasis on Affective Biascited by 8
- 2022A Machine Learning Model for Predicting, Diagnosing, and Mitigating Health Disparities in Hospital Readmissioncited by 4
- 2022Visualizing Deep Neural Networks with Topographic Activation Mapscited by 3
- 2023Gender Bias in Transformer Models: A comprehensive surveycited by 2
- 2023Explaining Relation Classification Models with Semantic Extentscited by 1
- 2025From n-gram to Attention: How Model Architectures Learn and Propagate Bias in Language Modelingcited by 1
- 2025Assessing Intersectional Bias in Representations of Pre-Trained Image Recognition Modelscited by 0
- 2025Assessing Intersectional Bias in Representations of Pre-Trained Image Recognition Models4 Jun 2025
- 2025From n-gram to Attention: How Model Architectures Learn and Propagate Bias in Language Modeling18 May 2025
- 2023Efficient Avoidance of Vulnerabilities in Auto-completed Smart Contract Code Using Vulnerability-constrained Decoding18 Sep 2023
- 2023Explaining Relation Classification Models with Semantic Extents4 Aug 2023
- 2023Gender Bias in Transformer Models: A comprehensive survey18 Jun 2023
- 2022A Machine Learning Model for Predicting, Diagnosing, and Mitigating Health Disparities in Hospital Readmission13 Jun 2022
- 2022Towards an Enhanced Understanding of Bias in Pre-trained Neural Language Models: A Survey with Special Emphasis on Affective Bias21 Apr 2022
- 2022Visualizing Deep Neural Networks with Topographic Activation Maps7 Apr 2022