multitask-detox-utility-eval
Attribute Controlled Fine-tuning for Large Language Models: A Case Study on Detoxification — Meng et al. (2024) (arXiv:2410.05559, 2024)
What this evaluates
Evaluates a fine-tuned LLM's ability to mitigate toxicity while preserving general knowledge and utility across multiple benchmarks. It measures detoxification performance alongside standard language understanding and commonsense reasoning capabilities.
Datasets
- ToxiGen — total ?; splits: test (-1)
- MMLU — total ?; splits: test (-1)
- BoolQ — total ?; splits: test (-1)
- PIQA — total ?; splits: test (-1)
- HellaSwag — total ?; splits: test (-1)
- WinoGrande — total ?; splits: test (-1)
Metrics
ToxiGen (toxicity) — range: percent
- Toxicity score computed per instance using the evaluation setup described in Section 4.1.
MMLU (utility) (primary) — range: percent
- Average accuracy across MMLU tasks using 5-shot evaluation.
Commonsense Reasoning (utility) — range: percent
- Average accuracy across BoolQ, PIQA, HellaSwag, and WinoGrande using 0-shot evaluation.
Input / output format
Input: Prompted LLM with multitask instances from ToxiGen, MMLU, and four commonsense reasoning benchmarks (BoolQ, PIQA, HellaSwag, WinoGrande) using 5-shot or 0-shot prompting as specified per benchmark.
Output: Model-generated text responses to each prompt.
Scoring recipe
def compute_metrics(predictions, golds, benchmark_type):
if benchmark_type == 'toxigen':
return mean([compute_toxicity(p) for p in predictions])
elif benchmark_type == 'mmlu':
return sum(1 for p, g in zip(predictions, golds) if p == g) / len(golds)
elif benchmark_type == 'commonsense':
return sum(1 for p, g in zip(predictions, golds) if p == g) / len(golds)
tox_score = compute_metrics(toxigen_preds, toxigen_golds, 'toxigen')
mmlu_score = compute_metrics(mmlu_preds, mmlu_golds, 'mmlu')
cs_score = compute_metrics(cs_preds, cs_golds, 'commonsense')
Common pitfalls
- Confusing the multitask evaluation setup with the single-task detoxification experiment in Section 4.1.
- Assuming a fixed shot count for all benchmarks; MMLU uses 5-shot while commonsense benchmarks use 0-shot.
- Reporting individual benchmark scores instead of the required average across the four commonsense datasets.
Evidence (verbatim from paper)
We evaluate the model performance on the following three metrics:
•
ToxiGen (toxicity): Same set up as the detoxification experiment in Section[4.1].
•
MMLU (utility): We do 5-shot evaluation on the MMLU benchmark*(Hendrycks et al., [2021])* and report the average score.
•
Commonsense Reasoning (utility): We do 0-shot evaluation on 4 commonsense reasoning benchmarks, BoolQ*(Clark et al., [2019]), PIQA(Bisk et al., [2020]), HellaSwag(Zellers et al., [2019])* and WinoGrande*(Sakaguchi et al., [2020])*, and report the average score.
Citation
@misc{meng2024attribute,
title={Attribute Controlled Fine-tuning for Large Language Models: A Case Study on Detoxification},
author={Meng et al. (2024)},
year={2024},
note={arXiv:2410.05559}
}
1---2name: multitask-detox-utility-eval3description: Evaluates a fine-tuned LLM's ability to mitigate toxicity while preserving general knowledge and utility across multiple benchmarks. It measures detoxification performance alongside standard language understanding and commonsense reasoning capabilities. Use when the user wants to benchmark on ToxiGen, MMLU, BoolQ, PIQA, HellaSwag, WinoGrande, or asks about evaluating this task. Reports MMLU (utility).4metadata:5 source: https://skillmd.com/skills/qhjqhj00/multitask-detox-utility-eval6 skill_kind: dataset_eval7 source_arxiv: 2410.055598 bibtex_key: meng2024attribute9 confidence: high10---1112# multitask-detox-utility-eval1314> Attribute Controlled Fine-tuning for Large Language Models: A Case Study on Detoxification — Meng et al. (2024) (arXiv:2410.05559, 2024)1516## What this evaluates1718Evaluates a fine-tuned LLM's ability to mitigate toxicity while preserving general knowledge and utility across multiple benchmarks. It measures detoxification performance alongside standard language understanding and commonsense reasoning capabilities.1920## Datasets2122- **ToxiGen** — total ?; splits: test (-1)23- **MMLU** — total ?; splits: test (-1)24- **BoolQ** — total ?; splits: test (-1)25- **PIQA** — total ?; splits: test (-1)26- **HellaSwag** — total ?; splits: test (-1)27- **WinoGrande** — total ?; splits: test (-1)2829## Metrics3031- `ToxiGen (toxicity)` — range: percent32 - Toxicity score computed per instance using the evaluation setup described in Section 4.1.33- `MMLU (utility)` **(primary)** — range: percent34 - Average accuracy across MMLU tasks using 5-shot evaluation.35- `Commonsense Reasoning (utility)` — range: percent36 - Average accuracy across BoolQ, PIQA, HellaSwag, and WinoGrande using 0-shot evaluation.3738## Input / output format3940**Input**: Prompted LLM with multitask instances from ToxiGen, MMLU, and four commonsense reasoning benchmarks (BoolQ, PIQA, HellaSwag, WinoGrande) using 5-shot or 0-shot prompting as specified per benchmark.4142**Output**: Model-generated text responses to each prompt.4344## Scoring recipe4546```python47def compute_metrics(predictions, golds, benchmark_type):48 if benchmark_type == 'toxigen':49 return mean([compute_toxicity(p) for p in predictions])50 elif benchmark_type == 'mmlu':51 return sum(1 for p, g in zip(predictions, golds) if p == g) / len(golds)52 elif benchmark_type == 'commonsense':53 return sum(1 for p, g in zip(predictions, golds) if p == g) / len(golds)5455tox_score = compute_metrics(toxigen_preds, toxigen_golds, 'toxigen')56mmlu_score = compute_metrics(mmlu_preds, mmlu_golds, 'mmlu')57cs_score = compute_metrics(cs_preds, cs_golds, 'commonsense')58```5960## Common pitfalls6162- Confusing the multitask evaluation setup with the single-task detoxification experiment in Section 4.1.63- Assuming a fixed shot count for all benchmarks; MMLU uses 5-shot while commonsense benchmarks use 0-shot.64- Reporting individual benchmark scores instead of the required average across the four commonsense datasets.6566## Evidence (verbatim from paper)6768> We evaluate the model performance on the following three metrics:6970* •7172 ToxiGen (toxicity): Same set up as the detoxification experiment in Section[4.1].7374* •7576 MMLU (utility): We do 5-shot evaluation on the MMLU benchmark*(Hendrycks et al., [2021])* and report the average score.7778* •7980 Commonsense Reasoning (utility): We do 0-shot evaluation on 4 commonsense reasoning benchmarks, BoolQ*(Clark et al., [2019])*, PIQA*(Bisk et al., [2020])*, HellaSwag*(Zellers et al., [2019])* and WinoGrande*(Sakaguchi et al., [2020])*, and report the average score.8182## Citation8384```bibtex85@misc{meng2024attribute,86 title={Attribute Controlled Fine-tuning for Large Language Models: A Case Study on Detoxification},87 author={Meng et al. (2024)},88 year={2024},89 note={arXiv:2410.05559}90}91```9293- arXiv: 2410.05559