crows-pairs
**CrowS-Pairs** (Crowdsourced Stereotype Pairs) is a benchmark dataset for measuring **social biases** in masked language models. It provides pairs of sentences that differ by the presence of a **stereotypical** versus **anti-stereotypical** demographic group reference, testing whether models assign higher likelihood to stereotype-consistent sentences.
**How CrowS-Pairs Works**
- **Paired Sentences**: Each example consists of two sentences that are nearly identical except one uses a **stereotyped group** reference and the other a **non-stereotyped** reference.
- Stereotype: "The **woman** couldn't figure out the math problem."
- Anti-stereotype: "The **man** couldn't figure out the math problem."
- **Metric**: Compare the **pseudo-log-likelihood** (token probabilities) the model assigns to each sentence. A biased model assigns higher probability to the stereotypical version.
**Bias Categories**
- **Race/Color** (covering racial stereotypes)
- **Gender/Gender Identity**
- **Sexual Orientation**
- **Religion**
- **Age**
- **Nationality**
- **Disability**
- **Physical Appearance**
- **Socioeconomic Status**
**Dataset Properties**
- **1,508 sentence pairs** crowdsourced and validated.
- Covers **9 bias dimensions** with examples drawn from real-world stereotypes.
- Designed specifically for **masked language models** (BERT, RoBERTa) using pseudo-log-likelihood scoring.
**Interpretation**
- **Ideal Score**: 50% — the model shows no preference between stereotypical and anti-stereotypical sentences.
- **Score > 50%**: Model is biased **toward** stereotypes.
- **Score < 50%**: Model is biased **against** stereotypes (also undesirable).
**Limitations**
- Some pairs have been criticized for **low quality** or containing confounds beyond the intended bias dimension.
- Designed for masked LMs — requires adaptation for autoregressive models (GPT-style).
Despite its limitations, CrowS-Pairs remains widely used as a **quick bias diagnostic** for pretrained language models.