tencent_hunyuan/DiagSafe
Datasets
Dataset viewer
Files & versions
Pull Requests
Discussion

DiagSafe

Beyond Binary Labels: Diagnostic Evaluation of LLM Safety with Prompt-Level Rubrics

Paper (arXiv) · GitHub · Evaluation code · Dashboard

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

ConfigFileRecordsDescription
prompts (default)prompts/DiagSafe_bench_3489.jsonl3,489Bilingual single- and multi-turn evaluation prompts
rubricsrubrics/DiagSafe_rubrics_3489.jsonl3,489One prompt-level judge rubric per prompt
standards_zhstandards/DiagSafe_standards_84.json84Three-level taxonomy and label standards (Chinese)
standards_enstandards/DiagSafe_standards_84_en.json84The same 84 labels, in English

Composition

DimensionDistribution
SubsetDiagBase: 2,401 · DiagAttack: 1,088
LanguageEnglish: 1,749 · Chinese: 1,740
DialogueSingle-turn: 2,560 · Multi-turn: 929 (2–5 turns, 5,135 turns in total)
Taxonomy11 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.
CodeFirst-level dimensionPrompts
OSS-01Discrimination, Hate & Harmful Bias440
OSS-02Sexual & Sexually Explicit Content695
OSS-03Privacy Violations & Information Disclosure195
OSS-04Misinformation, Disinformation & Confabulation240
OSS-05Violent & Illegal Activities831
OSS-06CBRN & WMD234
OSS-07Cybersecurity & Model Attacks187
OSS-08Suicide, Self-Harm & Dangerous Health Behaviors205
OSS-09Child Safety217
OSS-10Intellectual Property Infringement165
OSS-11Manipulation & Deceptive Persuasion80

Data Fields

prompts

FieldTypeDescription
idstringDiagBase-NNNNNN or DiagAttack-NNNNNN; the prefix identifies the subset
languagestringen or zh
messageslistOrdered user turns, [{"role": "user", "content": ...}]; multi-turn prompts have 2–5
categorydictl1 (code OSS-01–OSS-11), l2 and l3 (bilingual label names)

rubrics

FieldTypeDescription
idstringMatches exactly one prompt
rubricstringComplete 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 fieldEnglish fieldDescription
类目编号category_codeFirst-level code, OSS-01–OSS-11
类目名称category_name一级类目 / 二级类目 / 三级类目 ↔ l1 / l2 / l3
定义definitionLabel definition
标准总则general_standardGeneral standard
标准细则detailed_rulesDetailed 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

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:

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

Citation

@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