Table of Contents
Fetching ...

QueerBench: Quantifying Discrimination in Language Models Toward Queer Identities

Mae Sosto, Alberto Barrón-Cedeño

TL;DR

QueerBench introduces a template-based masked language modeling framework to quantify the potential harm of English LLM sentence completions toward LGBTQIA+ individuals. By combining neutral templates with subject substitutions and evaluating model predictions using AFINN, HurtLex, and Perspective API, the paper derives a composite QueerBench score that ranges from 0 to 100. The results show measurable bias: queer noun subjects yield higher harmfulness scores than non-queer counterparts (e.g., 16.9% vs. 9.2%), and certain pronoun contexts exhibit model- and category-dependent toxicity, with top-5 predictions generally more harmful than top-1. The work provides new resources and code to enable reproducibility and invites broader, intersectional bias mitigation in language models to improve safety and inclusivity in NLP systems.

Abstract

With the increasing role of Natural Language Processing (NLP) in various applications, challenges concerning bias and stereotype perpetuation are accentuated, which often leads to hate speech and harm. Despite existing studies on sexism and misogyny, issues like homophobia and transphobia remain underexplored and often adopt binary perspectives, putting the safety of LGBTQIA+ individuals at high risk in online spaces. In this paper, we assess the potential harm caused by sentence completions generated by English large language models (LLMs) concerning LGBTQIA+ individuals. This is achieved using QueerBench, our new assessment framework, which employs a template-based approach and a Masked Language Modeling (MLM) task. The analysis indicates that large language models tend to exhibit discriminatory behaviour more frequently towards individuals within the LGBTQIA+ community, reaching a difference gap of 7.2% in the QueerBench score of harmfulness.

QueerBench: Quantifying Discrimination in Language Models Toward Queer Identities

TL;DR

QueerBench introduces a template-based masked language modeling framework to quantify the potential harm of English LLM sentence completions toward LGBTQIA+ individuals. By combining neutral templates with subject substitutions and evaluating model predictions using AFINN, HurtLex, and Perspective API, the paper derives a composite QueerBench score that ranges from 0 to 100. The results show measurable bias: queer noun subjects yield higher harmfulness scores than non-queer counterparts (e.g., 16.9% vs. 9.2%), and certain pronoun contexts exhibit model- and category-dependent toxicity, with top-5 predictions generally more harmful than top-1. The work provides new resources and code to enable reproducibility and invites broader, intersectional bias mitigation in language models to improve safety and inclusivity in NLP systems.

Abstract

With the increasing role of Natural Language Processing (NLP) in various applications, challenges concerning bias and stereotype perpetuation are accentuated, which often leads to hate speech and harm. Despite existing studies on sexism and misogyny, issues like homophobia and transphobia remain underexplored and often adopt binary perspectives, putting the safety of LGBTQIA+ individuals at high risk in online spaces. In this paper, we assess the potential harm caused by sentence completions generated by English large language models (LLMs) concerning LGBTQIA+ individuals. This is achieved using QueerBench, our new assessment framework, which employs a template-based approach and a Masked Language Modeling (MLM) task. The analysis indicates that large language models tend to exhibit discriminatory behaviour more frequently towards individuals within the LGBTQIA+ community, reaching a difference gap of 7.2% in the QueerBench score of harmfulness.
Paper Structure (32 sections, 4 equations, 9 figures, 7 tables)

This paper contains 32 sections, 4 equations, 9 figures, 7 tables.

Figures (9)

  • Figure 1: QueerBench's workflow: (1) template intersection with subjects generates a new dataset; (2) the dataset is fed into an LM to generate predictions; (3) the predictions undergo QueerBench framework assessment.
  • Figure 2: Our framework's MLM task implementation. The highlighted noun (in green) acts as the subject within the neutral sentence. The completed sentence, part of our dataset, is inputted into the model, which generates top-1 and top-5 predictions (in orange). In the first scenario, "person" is the top prediction; in the second, all five predictions are assessed.
  • Figure 3: The image shows an example of Perspective API. On the left part of the image, there is the input sentence; on the right, there is Perspective's result.
  • Figure 4: HurtLex test on from RoBERTa models' prediction. The partial bars represent HurtLex categories, see Table \ref{['tab: hurtlex_categories']}.
  • Figure 5: Perspective test on ALBERT models' predictions.
  • ...and 4 more figures