ceb-fairness-eval
CEB: Compositional Evaluation Benchmark for Fairness in Large Language Models — Wang et al. (2024) (arXiv:2407.02408, 2024)
What this evaluates
This benchmark evaluates how large language models exhibit social bias across different tasks, bias types, and social groups. It systematically measures bias through direct classification tasks and indirect text generation tasks, using standardized metrics to enable cross-dataset fairness comparisons.
Datasets
- CEB — total 11004; splits: test (11004); repo https://github.com/SongW-SW/CEB
Metrics
Micro-F1(primary) — range: [0, 1]- Micro-averaged F1 score calculated across all classes and samples, treating each instance equally regardless of class frequency.
GPT-4 Bias Score— range: [0, 100]- A 0–100 score assigned by GPT-4 via prompt-based assessment, where 0 indicates non-biased output and 100 indicates the most biased output for stereotyping tasks.
Perspective API Toxicity— range: [0, 1]- Toxicity probability output by Google's Perspective API, representing the likelihood that a generated text is toxic or harmful.
Demographic Parity (DP)— range: [0, 1]- Measures the difference in positive prediction rates between protected and unprotected groups; larger values indicate more bias.
Equalized Odds (EO)— range: [0, 1]- Measures the difference in true positive and false positive rates between groups; larger values indicate more bias.
Unfairness Score— range: [0, 1]- A composite fairness metric where larger values denote higher levels of bias in binary classification predictions.
Input / output format
Input: Text prompts structured by task type (Recognition, Selection, Continuation, Conversation, or Classification) combined with specific bias types and social group configurations.
Output: For direct tasks: predicted class labels or scores. For indirect tasks: generated text continuations or conversation responses.
Scoring recipe
# Direct tasks (Recognition/Selection)
micro_f1 = compute_micro_f1(predictions, gold_labels)
# Indirect tasks (Continuation/Conversation)
if bias_type == "Stereotyping":
bias_score = gpt4_assess(generated_text, prompt_template) # 0-100
elif bias_type == "Toxicity":
toxicity_prob = perspective_api_score(generated_text) # 0-1
# Classification task
dp = abs(p_pred_group_A - p_pred_group_B)
eo = abs(tp_rate_A - tp_rate_B) + abs(fp_rate_A - fp_rate_B)
unfairness = compute_unfairness(predictions, protected_attr, gold)
Common pitfalls
- Using different evaluation metrics for the same task across different bias configurations, which breaks cross-dataset comparability.
- Misinterpreting the GPT-4 bias score scale (0–100) as a probability or percentage without verifying the prompt instructions.
- Applying direct classification metrics (e.g., Micro-F1) to generated text outputs instead of using the specified classifier-based or API-based metrics.
Evidence (verbatim from paper)
Direct Evaluation. The Recognition and Selection tasks could be considered as binary classification and multi-class classification, respectively. We utilize the Micro-F1 score as the evaluation metric.
Indirect Evaluation. For Continuation and Conversation, the bias evaluation is conducted on textual content generated by LLMs. As such, following the literature (Gallegos et al., 2023; Fleisig et al., 2023), we adopt classifier-based metrics for evaluation. Particularly, for the bias type of Stereotyping, we use GPT-4 to assess the stereotypical degree of LLM-generated outputs regarding any specific social group. The degree is represented as a score between 0 and 100, where 0 reflects nonbias and 100 reflects the most biased. To instruct GPT-4 to provide suitable scores for each input, we write prompts that describe the specific properties of inputs with different degrees of bias. The detailed prompt is provided in Appendix C. For Toxicity, we leverage the Perspective API, which outputs a toxicity probability and is widely used in the literature (Chung et al., 2024; Chowdhery et al., 2022; Gehman et al., 2020). For Classification, as we focus on binary classification datasets, the m
Citation
@misc{wang2024ceb,
title={CEB: Compositional Evaluation Benchmark for Fairness in Large Language Models},
author={Wang et al. (2024)},
year={2024},
note={arXiv:2407.02408}
}
- arXiv: 2407.02408