# Multitask Detox Utility Eval

> 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).

- Skill: `qhjqhj00/multitask-detox-utility-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/multitask-detox-utility-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/multitask-detox-utility-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/multitask-detox-utility-eval

---


# 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

```python
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

```bibtex
@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}
}
```

- arXiv: 2410.05559

