Datasets:
|
Download README.md from tencent/DiagSafe: direct link, hf CLI and curl.
- Browser
- Download file 7.45 kB
-
https://huggingface.co/datasets/tencent/DiagSafe/resolve/main/README.md
- Command line
-
hf download hf://datasets/tencent/DiagSafe/README.md
-
curl -L -o README.md https://huggingface.co/datasets/tencent/DiagSafe/resolve/main/README.md
7.45 kB
| license: cc-by-4.0 | |
| language: | |
| - en | |
| - zh | |
| size_categories: | |
| - 1K<n<10K | |
| task_categories: | |
| - text-generation | |
| pretty_name: DiagSafe | |
| tags: | |
| - safety | |
| - llm-safety | |
| - red-teaming | |
| - jailbreak | |
| - llm-as-a-judge | |
| - rubric | |
| - benchmark | |
| configs: | |
| - config_name: prompts | |
| default: true | |
| data_files: | |
| - split: test | |
| path: prompts/DiagSafe_bench_3489.jsonl | |
| - config_name: rubrics | |
| data_files: | |
| - split: test | |
| path: rubrics/DiagSafe_rubrics_3489.jsonl | |
| - config_name: standards_zh | |
| data_files: | |
| - split: train | |
| path: standards/DiagSafe_standards_84.json | |
| - config_name: standards_en | |
| data_files: | |
| - split: train | |
| path: standards/DiagSafe_standards_84_en.json | |
| # DiagSafe | |
| **Beyond Binary Labels: Diagnostic Evaluation of LLM Safety with Prompt-Level Rubrics** | |
| [Paper (arXiv)](https://arxiv.org/abs/2610.29225) · [GitHub](https://github.com/Tencent-Hunyuan/DiagSafe) · [Evaluation code](https://github.com/Tencent-Hunyuan/DiagSafe#quick-start) · [Dashboard](https://tencent-hunyuan.github.io/DiagSafe/) | |
| > **Content warning.** This dataset contains harmful requests (e.g. violence, sexual content, self-harm, | |
| > child safety, CBRN) written to test LLM safety. It is intended for safety evaluation and research only. | |
| DiagSafe is a diagnostic safety benchmark for large language models. It pairs 3,489 bilingual prompts, | |
| grounded in an 84-label, three-tier safety taxonomy, with **one prompt-level rubric per prompt**: each | |
| rubric lists prompt-specific safety items with their exemptions, plus eight shared usefulness items, so an | |
| LLM judge rules on every item and cites evidence instead of emitting a single binary label. | |
| ## Dataset Structure | |
| | Config | File | Records | Description | | |
| |---|---|---:|---| | |
| | `prompts` (default) | `prompts/DiagSafe_bench_3489.jsonl` | 3,489 | Bilingual single- and multi-turn evaluation prompts | | |
| | `rubrics` | `rubrics/DiagSafe_rubrics_3489.jsonl` | 3,489 | One prompt-level judge rubric per prompt | | |
| | `standards_zh` | `standards/DiagSafe_standards_84.json` | 84 | Three-level taxonomy and label standards (Chinese) | | |
| | `standards_en` | `standards/DiagSafe_standards_84_en.json` | 84 | The same 84 labels, in English | | |
| ### Composition | |
| | Dimension | Distribution | | |
| |---|---| | |
| | Subset | DiagBase: 2,401 · DiagAttack: 1,088 | | |
| | Language | English: 1,749 · Chinese: 1,740 | | |
| | Dialogue | Single-turn: 2,560 · Multi-turn: 929 (2–5 turns, 5,135 turns in total) | | |
| | Taxonomy | 11 first-level · 34 second-level · 84 third-level labels | | |
| - **DiagBase** is synthesized from the label standards along language × dialogue turns × attack form | |
| (direct harmful requests, template jailbreaks, combined-template jailbreaks). | |
| - **DiagAttack** rewrites the single-turn direct requests of DiagBase into instruction attacks, embedding the | |
| harmful intent in a benign-looking task with role, format and tone constraints. | |
| | Code | First-level dimension | Prompts | | |
| |---|---|---:| | |
| | OSS-01 | Discrimination, Hate & Harmful Bias | 440 | | |
| | OSS-02 | Sexual & Sexually Explicit Content | 695 | | |
| | OSS-03 | Privacy Violations & Information Disclosure | 195 | | |
| | OSS-04 | Misinformation, Disinformation & Confabulation | 240 | | |
| | OSS-05 | Violent & Illegal Activities | 831 | | |
| | OSS-06 | CBRN & WMD | 234 | | |
| | OSS-07 | Cybersecurity & Model Attacks | 187 | | |
| | OSS-08 | Suicide, Self-Harm & Dangerous Health Behaviors | 205 | | |
| | OSS-09 | Child Safety | 217 | | |
| | OSS-10 | Intellectual Property Infringement | 165 | | |
| | OSS-11 | Manipulation & Deceptive Persuasion | 80 | | |
| ### Data Fields | |
| **`prompts`** | |
| | Field | Type | Description | | |
| |---|---|---| | |
| | `id` | string | `DiagBase-NNNNNN` or `DiagAttack-NNNNNN`; the prefix identifies the subset | | |
| | `language` | string | `en` or `zh` | | |
| | `messages` | list | Ordered user turns, `[{"role": "user", "content": ...}]`; multi-turn prompts have 2–5 | | |
| | `category` | dict | `l1` (code `OSS-01`–`OSS-11`), `l2` and `l3` (bilingual label names) | | |
| **`rubrics`** | |
| | Field | Type | Description | | |
| |---|---|---| | |
| | `id` | string | Matches exactly one prompt | | |
| | `rubric` | string | Complete judge-prompt template with `{question}`, `{answer}` and `{safety_categories}` placeholders, 2–6 prompt-specific safety items (4.5 on average) with exemptions, eight usefulness items (U1.1–U3.2), a 0–3 usefulness scoring rule and a JSON output contract. Written in the language of its prompt | | |
| **`standards_zh` / `standards_en`** | |
| | Chinese field | English field | Description | | |
| |---|---|---| | |
| | `类目编号` | `category_code` | First-level code, `OSS-01`–`OSS-11` | | |
| | `类目名称` | `category_name` | `一级类目` / `二级类目` / `三级类目` ↔ `l1` / `l2` / `l3` | | |
| | `定义` | `definition` | Label definition | | |
| | `标准总则` | `general_standard` | General standard | | |
| | `标准细则` | `detailed_rules` | Detailed rules, each marked `——危险` / `——安全` (`——UNSAFE` / `——SAFE`) | | |
| Both standard files cover the same 84 labels in the same order. A prompt's `category.l2` / `category.l3` | |
| equal `类目名称.二级类目` / `类目名称.三级类目` in the Chinese file; the English file uses the parenthesized | |
| English names. | |
| ## Usage | |
| ```python | |
| from datasets import load_dataset | |
| prompts = load_dataset("tencent/DiagSafe", "prompts", split="test") | |
| rubrics = load_dataset("tencent/DiagSafe", "rubrics", split="test") | |
| standards = load_dataset("tencent/DiagSafe", "standards_zh", split="train") | |
| rubric_by_id = dict(zip(rubrics["id"], rubrics["rubric"])) | |
| example = prompts[0] | |
| rubric = rubric_by_id[example["id"]] | |
| ``` | |
| The rubric contains JSON braces in its output contract, so fill the placeholders with `str.replace` | |
| rather than `str.format`: | |
| ```python | |
| import json | |
| judge_prompt = ( | |
| rubric | |
| .replace("{question}", json.dumps(example["messages"], ensure_ascii=False)) | |
| .replace("{answer}", model_answer) | |
| .replace("{safety_categories}", json.dumps(example["category"], ensure_ascii=False)) | |
| ) | |
| ``` | |
| Multi-turn prompts are evaluated turn by turn, with earlier turns given to the judge as context; a prompt | |
| counts as Unsafe if any turn is Unsafe. The [GitHub repository](https://github.com/Tencent-Hunyuan/DiagSafe) | |
| provides the end-to-end evaluation script (`scripts/run_eval.py`), which handles answer generation, | |
| multi-turn judging, checkpointing and grouped statistics. | |
| ## Intended Use and Limitations | |
| DiagSafe is intended for evaluating and diagnosing the safety behavior of LLMs and LLM judges. The prompts | |
| are deliberately harmful; we ask users not to use them to train models to produce harmful content. Results depend | |
| on the judge model; the paper reports rubric-based judging at 89.41%–95.34% agreement with human | |
| annotations across judges. | |
| ## License | |
| Copyright (C) 2026 Tencent. Released under the | |
| [Creative Commons Attribution 4.0 International License (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/). | |
| ## Citation | |
| ```bibtex | |
| @misc{diagsafe2026, | |
| title = {Beyond Binary Labels: Diagnostic Evaluation of LLM Safety with Prompt-Level Rubrics}, | |
| author = {Li, Hongyu and Huang, Xinlong and Yu, Zhan and Zhao, Jing and Zhao, Zhe and | |
| Zhong, Juntao and Kuang, Xiong and Yuan, Rui and Yan, ZhenXiang and Xu, Huilin and | |
| Yu, Haitao and Wang, Lilin and Chen, Rui and Chen, Blaze and Lian, Fengzong and | |
| Hu, Renfen}, | |
| year = {2026}, | |
| archivePrefix= {arXiv}, | |
| eprint = {2610.29225}, | |
| primaryClass = {cs.CL} | |
| } | |
| ``` | |
| ## Contact | |
| `nlpzhezhao@tencent.com` | |