TL;DR
This paper introduces FAIRPAIR, a novel framework for evaluating subtle biases in language models by comparing model outputs for counterfactual prompts that are carefully constructed to control for confounding factors. By grounding comparisons within the same demographic group and accounting for sampling variability, FAIRPAIR offers a more robust and reliable measure of differential treatment than existing methods.
What Problem Does This Paper Address?
As language models (LMs) become more integrated into our lives, ensuring they treat all users fairly and without bias is paramount. Existing methods for evaluating bias in LMs often fall short. Some rely on extreme or rare cases, missing biases that appear in everyday usage. Others use prompts that are not representative of real-world scenarios. A common evaluation technique involves perturbing text (e.g., changing "man" to "woman") and comparing token likelihoods. However, this can be confounded by the model's familiarity with certain terms rather than genuine bias. Another approach, evaluating downstream properties like toxicity, might miss subtle biases, such as a tendency to associate certain topics (e.g., family, hobbies) more with one gender than another. This paper aims to address these limitations by providing a more robust, extendable, and realistic evaluation framework.
Methods
FAIRPAIR operates by constructing "paired perturbations." For a given prompt containing an entity (e.g., "John"), they create a perturbed prompt where the entity is replaced with a counterpart from a different demographic group (e.g., "Jane"). Crucially, both the original and perturbed prompts are then used to generate continuations from the LM. The core of FAIRPAIR lies in comparing two specific continuations:
- Perturbed Original Generation (p(g(x))): The original prompt's continuation (g(x)) is perturbed (e.g., "John is a professor" becomes "Jane is a professor").
- Perturbation Generation (g(p(x))): The perturbed prompt (p(x)) is used to generate a continuation (e.g., "Jane is a professor" is generated directly).
By comparing these two continuations, which are both grounded in the same target entity (e.g., "Jane"), FAIRPAIR ensures that any observed differences are due to the LM's treatment of the demographic attribute, not superficial differences between entities or the perturbation process itself.
To account for the non-deterministic nature of LMs, FAIRPAIR generates multiple continuations for each prompt. This allows for the estimation of both:
- Bias (B): The difference between the scores of the paired continuations.
- Sampling Variability (V): The variability within the set of continuations for a single prompt.
The FAIRPAIR metric ($F(x)$) is then defined as the ratio of bias to sampling variability, providing a more robust measure where a higher $F(x)$ indicates a stronger indication of internal model bias beyond random chance.
The paper explores two scoring functions for comparing continuations:
- Sentiment Dissimilarity: Using the VADER sentiment classifier.
- Token Dissimilarity: Using Jaccard similarity.
Datasets
The authors introduce a new dataset called Common Sents. This dataset consists of natural, commonplace sentences constructed from templates, primarily focusing on occupations. For example, a template might be "{Name A|Name B} is (a {descriptor})*, working as a {occupation}." This dataset is designed to elicit biases that might appear in everyday usage, unlike some existing datasets with more contrived prompts. The occupations are sourced from the Winogender dataset.
Key Insights and Ideas
- Grounding is Key: The most significant insight is the importance of grounding counterfactual comparisons within the same target entity. This elegantly sidesteps issues where differences might arise simply because the model is more familiar with one name or entity over another, allowing for a cleaner assessment of demographic bias.
- Sampling Variability Matters: LMs are inherently stochastic. Ignoring this variability can lead to overestimating bias. FAIRPAIR's explicit modeling of sampling variability provides a more nuanced and reliable measure of bias.
- Subtle Biases are Real: The qualitative analysis reveals that LMs can exhibit subtle biases, such as associating women more with topics like family, hobbies, and personality traits, while men are more associated with occupational capabilities, finance, and technology. These are not necessarily overtly toxic but represent differential treatment.
- Larger Models, Different Bias Profile: While larger models like LLaMa and InstructGPT show lower absolute bias, when this bias is scaled by their sampling variability (as captured by the $F$ metric), it can sometimes indicate a more pronounced bias effect than in smaller models.
Key Results
- Quantitative Evaluation: The FAIRPAIR metric ($F$) was applied to several LMs (GPT-2, GPT-2 XL, Tk-Instruct, GPT-J, LLaMa, InstructGPT). For Jaccard dissimilarity, most models had an $F$ value close to 1, suggesting that observed differences were largely attributable to sampling variability. However, for sentiment dissimilarity, InstructGPT showed a higher $F$ value (1.09), indicating a stronger bias signal relative to its sampling variability.
- Sample Size and Fold Ablation: The study found that bias metrics tend to converge with around 100 samples and 200 k-folds for evaluation.
- Qualitative Findings: Analysis of n-grams from LLaMa and InstructGPT continuations revealed distinct topic associations: prompts starting with "John" (male) tended to generate text related to occupational capabilities, finance, and technology, while prompts starting with "Jane" (female) discussed family, hobbies, and personality traits.
Limitations and Future Work
- Computational Cost: FAIRPAIR incurs additional computational cost due to the multiple sampling and perturbation steps.
- Perturbation Function Quality: The effectiveness of FAIRPAIR hinges on the quality of the perturbation function. Defining appropriate counterparts for less common demographic terms (e.g., bigender, Desi) or for attributes like "disability" can be challenging.
- Scope of Common Sents: The Common Sents dataset focuses on common, non-toxic text and gender bias. The authors acknowledge that more adversarial prompts might be needed to stress-test systems for preventing harms.
- Future Work: The authors suggest extending FAIRPAIR to other demographic groups and axes, and using different scoring functions. They also note that while Common Sents focuses on non-toxic text, ensuring safety and preventing harms might require more adversarial prompts.
Summary updated