Challenges in Measuring Bias via Open-Ended Language Generation

Afra Feyza Akyürek, Muhammed Yusuf Kocyigit, Sejin Paik, Derry Wijaya

Abstract

Researchers have devised numerous ways to quantify social biases vested in pretrained language models. As some language models are capable of generating coherent completions given a set of textual prompts, several prompting datasets have been proposed to measure biases between social groups -- posing language generation as a way of identifying biases. In this opinion paper, we analyze how specific choices of prompt sets, metrics, automatic tools and sampling strategies affect bias results. We find out that the practice of measuring biases through text completion is prone to yielding contradicting results under different experiment settings. We additionally provide recommendations for reporting biases in open-ended language generation for a more complete outlook of biases exhibited by a given language model. Code to reproduce the results is released under https://github.com/feyzaakyurek/bias-textgen.

Introduction

The rapid integration of Large Language Models (LLMs) into consumer applications has necessitated robust methods for identifying and quantifying social biases. A common paradigm involves prompting a model with a prefix (e.g., "The woman worked as...") and analyzing the resulting completion for toxicity, sentiment, or regard. However, this research demonstrates that such measurements are remarkably "brittle." Small experimental choices—often treated as implementation details—can lead to contradictory conclusions about a model's bias profile.

The Bias Measurement Pipeline

The standard approach to measuring bias follows a linear pipeline: a prompt is fed into a model, which generates a completion, which is then evaluated by an automated metric tool to produce a bias score. This score is typically expressed as a ratio between different demographic groups to identify disparities.

The standard pipeline for measuring bias in open-ended language generation, where prompts are completed by a model and then evaluated by various metrics.

The authors systematically varied the "knobs" of this pipeline to test its stability. These variables include the choice of metric (Toxicity, Sentiment, Regard), the specific tool used for that metric (e.g., VADER vs. DistilBERT), decoding parameters (temperature, token length), and sampling strategies (Top-1 vs. Top-20 most toxic samples).

Sensitivity to Experimental Parameters

A core finding of the study is the "non-monotonic" nature of bias. One might expect a biased model to exhibit consistent bias regardless of generation length, but the data suggests otherwise. For instance, in the BOLD dataset using GPT-2, female-associated prompts were found to be 1.4x more toxic than male-associated prompts when 50 tokens were generated, yet they appeared nearly neutral (1.07x) at a length of 10 tokens. Similar fluctuations were observed in religious bias; the toxicity ratio for Sikhism vs. Hinduism was 4.7x higher when generating 10 tokens than when generating 40 tokens.

Heatmap showing how the ratio of metrics between female and male groups varies significantly based on the number of generated tokens and the choice of metric.

Furthermore, different metrics often tell conflicting stories. A model might appear highly biased under a toxicity classifier but perfectly neutral under a sentiment analyzer. Even within the same metric category, tools can disagree; on the same text, the VADER sentiment tool favored females (ratio 1.03), while DistilBERT favored males (ratio 0.94).

The Impact of Decoding and Sampling

Technical choices in how text is sampled from the model also skew results. Decoding parameters like temperature ($\tau$) are not neutral. "Greedy decoding" ($\tau=0$) often yields higher bias ratios than sampling with higher temperatures. In some cases, a model's completions were more toxic for males at a temperature of 0.6, but became more toxic for females at a temperature of 1.0.

Additionally, the common practice of reporting the "most toxic" completion (Top-1) tends to exaggerate discrepancies. The authors show that while the single most toxic generation might show a large gap between groups, looking at the average of the "Top-5" or "Top-20" most toxic samples often sees that discrepancy vanish.

Recommendations for Rigorous Reporting

Given this sensitivity, the authors argue against reporting single-value bias scores. Instead, they propose a "Bidimensional Leaderboard" approach. Researchers should provide a comprehensive "bias profile" that reports scores across a grid of temperatures, token lengths, and multiple metrics. This multi-dimensional view prevents researchers from inadvertently "cherry-picking" settings that highlight or hide specific biases, leading to a more honest assessment of model safety.

Conclusion

Measuring bias in open-ended generation is not a settled science. The field must move away from ad-hoc experimental settings toward a standardized, rigorous protocol. Future work should focus on integrating human evaluation to ground automated metrics and expanding benchmarks to capture intersectional identities and more nuanced forms of harm.

Summary updated

Abstract

Researchers have devised numerous ways to quantify social biases vested in pretrained language models. As some language models are capable of generating coherent completions given a set of textual prompts, several prompting datasets have been proposed to measure biases between social groups -- posing language generation as a way of identifying biases. In this opinion paper, we analyze how specific choices of prompt sets, metrics, automatic tools and sampling strategies affect bias results. We find out that the practice of measuring biases through text completion is prone to yielding contradicting results under different experiment settings. We additionally provide recommendations for reporting biases in open-ended language generation for a more complete outlook of biases exhibited by a given language model. Code to reproduce the results is released under https://github.com/feyzaakyurek/bias-textgen.
BibTeX
@inproceedings{akyurek2022challenges,
  author = {Afra Feyza Akyürek and Muhammed Yusuf Kocyigit and Sejin Paik and Derry Wijaya},
  title = {{Challenges in Measuring Bias via Open-Ended Language Generation}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2022},
}
Figure