thu-coai/SafetyBench
收藏资源简介:
SafetyBench是一个用于评估大型语言模型(LLMs)安全性的综合基准,包含11,435个多样化的选择题,涵盖了7个不同的安全类别。该数据集特别包含了中文和英文数据,支持双语评估。发布的内容包括中文测试集(`test_zh.json`)、英文测试集(`test_en.json`)和中文子集测试集(`test_zh_subset.json`),其中中文子集测试集移除了包含高度敏感关键词的样本,以测试具有严格过滤机制的API中文LLMs。此外,还发布了每个安全类别的5个示例,分别以中文(`dev_zh.json`)和英文(`dev_en.json`)提供,以支持少样本评估。测试集的标签未发布,用户需提交结果以自动获取测试准确率。
SafetyBench is a comprehensive benchmark for evaluating the safety of Large Language Models (LLMs). It comprises 11,435 diverse multiple-choice questions spanning 7 distinct safety categories, and supports bilingual safety evaluation with both Chinese and English data. The released resources include the Chinese test set (`test_zh.json`), English test set (`test_en.json`), and a Chinese subset test set (`test_zh_subset.json`), where the latter removes samples containing highly sensitive keywords for testing Chinese LLMs deployed via APIs with strict filtering mechanisms. Additionally, 5 exemplars for each safety category are released in both Chinese (`dev_zh.json`) and English (`dev_en.json`) to enable few-shot evaluation. The ground-truth labels of the test set are not publicly disclosed, and users must submit their prediction results to automatically retrieve the test accuracy.
数据集概述
数据集名称
SafetyBench
数据集描述
SafetyBench是一个综合基准,用于评估大型语言模型(LLMs)的安全性。该基准包含11,435个多样化的多选题,涵盖7个不同的安全类别。特别地,SafetyBench同时包含中文和英文数据,便于在两种语言中进行评估。
数据集配置
-
测试集配置 (
test)- 中文测试集 (
test_zh.json) - 英文测试集 (
test_en.json) - 中文子集测试集 (
test_zh_subset.json)
- 中文测试集 (
-
开发集配置 (
dev)- 中文开发集 (
dev_zh.json) - 英文开发集 (
dev_en.json)
- 中文开发集 (
数据集使用
- 测试集的标签不公开,用户需提交结果以自动获取测试准确性。
- 提供了5个示例,每个安全类别各5个,分别在中文和英文开发集中,以支持少样本评估。
数据加载
python from datasets import load_dataset
test_dataset = load_dataset("thu-coai/SafetyBench", "test") dev_dataset = load_dataset("thu-coai/SafetyBench", "dev")
引用信息
@article{zhang2023safetybench, title={SafetyBench: Evaluating the Safety of Large Language Models with Multiple Choice Questions}, author={Zhexin Zhang and Leqi Lei and Lindong Wu and Rui Sun and Yongkang Huang and Chong Long and Xiao Liu and Xuanyu Lei and Jie Tang and Minlie Huang}, journal={arXiv preprint arXiv:2309.07045}, year={2023} }




