遇见数据集

natolambert/xstest-v2-copy

收藏
Hugging Face2023-12-14 更新2024-03-04 收录
官方服务:

资源简介:

--- license: cc-by-4.0 dataset_info: features: - name: id dtype: string - name: type dtype: string - name: prompt dtype: string - name: completion dtype: string - name: annotation_1 dtype: string - name: annotation_2 dtype: string - name: agreement dtype: bool - name: final_label dtype: string splits: - name: gpt4 num_bytes: 264757 num_examples: 450 - name: llama2new num_bytes: 523074 num_examples: 450 - name: llama2orig num_bytes: 476580 num_examples: 450 - name: mistralguard num_bytes: 309478 num_examples: 450 - name: mistralinstruct num_bytes: 377642 num_examples: 450 - name: prompts num_bytes: 47890 num_examples: 450 download_size: 930253 dataset_size: 1999421 configs: - config_name: default data_files: - split: gpt4 path: data/gpt4-* - split: llama2new path: data/llama2new-* - split: llama2orig path: data/llama2orig-* - split: mistralguard path: data/mistralguard-* - split: mistralinstruct path: data/mistralinstruct-* - split: prompts path: data/prompts-* task_categories: - conversational language: - en size_categories: - 1K<n<10K --- # XSTest Dataset for Testing Exaggerated Safety Note, this is an upload of the data found [here](https://github.com/paul-rottger/exaggerated-safety) for easier research use. All credit to the authors of the [paper](https://arxiv.org/abs/2308.01263) The test prompts are subject to Creative Commons Attribution 4.0 International license. The model completions are subject to the original licenses specified by Meta, Mistral and OpenAI. ### Loading the dataset Use the following: ``` from datasets import load_dataset dataset = load_dataset("natolambert/xstest-v2-copy) prompts = dataset["prompts"] # select the correct subset(s) ``` The dataset is a `DatasetDict` with the following structure: ``` DatasetDict({ gpt4: Dataset({ features: ['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], num_rows: 450 }) llama2new: Dataset({ features: ['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], num_rows: 450 }) llama2orig: Dataset({ features: ['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], num_rows: 450 }) mistralguard: Dataset({ features: ['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], num_rows: 450 }) mistralinstruct: Dataset({ features: ['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], num_rows: 450 }) }) ``` The mapping for prompts is as follows (from the original below) * `id_v1` removed, * `id_v2` -> `id` * empty column completion * focus to annotation_1 and note to annotation_2 * empty `final_label` ``` prompts: Dataset({ features: ['id_v1', 'id_v2', 'type', 'prompt', 'focus', 'note'], num_rows: 450 }) ``` Please cite their work: ``` @misc{röttger2023xstest, title={XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models}, author={Paul Röttger and Hannah Rose Kirk and Bertie Vidgen and Giuseppe Attanasio and Federico Bianchi and Dirk Hovy}, year={2023}, eprint={2308.01263}, archivePrefix={arXiv}, primaryClass={cs.CL} } ```

许可证:CC BY 4.0(知识共享署名4.0国际许可协议) dataset_info: 特征: - 字段名:id,数据类型:字符串 - 字段名:type,数据类型:字符串 - 字段名:prompt(提示词),数据类型:字符串 - 字段名:completion(模型补全结果),数据类型:字符串 - 字段名:annotation_1(标注1),数据类型:字符串 - 字段名:annotation_2(标注2),数据类型:字符串 - 字段名:agreement(标注一致性),数据类型:布尔值 - 字段名:final_label(最终标签),数据类型:字符串 splits: - 划分名:gpt4,字节数:264757,样本数:450 - 划分名:llama2new,字节数:523074,样本数:450 - 划分名:llama2orig,字节数:476580,样本数:450 - 划分名:mistralguard,字节数:309478,样本数:450 - 划分名:mistralinstruct,字节数:377642,样本数:450 - 划分名:prompts,字节数:47890,样本数:450 下载大小:930253,数据集总大小:1999421 configs: - 配置名:default,数据文件: - 划分:gpt4,路径:data/gpt4-* - 划分:llama2new,路径:data/llama2new-* - 划分:llama2orig,路径:data/llama2orig-* - 划分:mistralguard,路径:data/mistralguard-* - 划分:mistralinstruct,路径:data/mistralinstruct-* - 划分:prompts,路径:data/prompts-* task_categories: - 对话式 language: - 英语 size_categories: - 1K < n < 10K # 用于测试过度安全行为的XSTest数据集 请注意,本仓库上传了原仓库[此处](https://github.com/paul-rottger/exaggerated-safety)的数据集,以方便科研使用。所有荣誉归属于该[论文](https://arxiv.org/abs/2308.01263)的作者。 本数据集的测试提示词遵循知识共享署名4.0国际许可协议。模型生成的补全结果则遵循Meta、Mistral与OpenAI指定的原始许可协议。 ### 数据集加载方法 请使用如下代码: from datasets import load_dataset dataset = load_dataset("natolambert/xstest-v2-copy") prompts = dataset["prompts"] # 选择所需的子集 该数据集为`DatasetDict`格式,结构如下: DatasetDict({ gpt4: Dataset({ 特征:['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], 样本数:450 }) llama2new: Dataset({ 特征:['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], 样本数:450 }) llama2orig: Dataset({ 特征:['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], 样本数:450 }) mistralguard: Dataset({ 特征:['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], 样本数:450 }) mistralinstruct: Dataset({ 特征:['id', 'type', 'prompt', 'completion', 'annotation_1', 'annotation_2', 'agreement', 'final_label'], 样本数:450 }) }) `prompts`划分集的字段映射关系如下(源自原始数据集): * 移除`id_v1`字段 * 将`id_v2`映射为`id` * 新增空字段`completion` * 将原`focus`字段对应至`annotation_1`,原`note`字段对应至`annotation_2` * 新增空字段`final_label` prompts: Dataset({ 特征:['id_v1', 'id_v2', 'type', 'prompt', 'focus', 'note'], 样本数:450 }) 请引用该原论文: @misc{röttger2023xstest, title={XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models (大语言模型)}, author={Paul Röttger and Hannah Rose Kirk and Bertie Vidgen and Giuseppe Attanasio and Federico Bianchi and Dirk Hovy}, year={2023}, eprint={2308.01263}, archivePrefix={arXiv}, primaryClass={cs.CL} }

提供机构:
natolambert
原始信息汇总

XSTest Dataset for Testing Exaggerated Safety

数据集信息

特征

  • id: 字符串类型
  • type: 字符串类型
  • prompt: 字符串类型
  • completion: 字符串类型
  • annotation_1: 字符串类型
  • annotation_2: 字符串类型
  • agreement: 布尔类型
  • final_label: 字符串类型

数据分割

  • gpt4: 264757字节,450个样本
  • llama2new: 523074字节,450个样本
  • llama2orig: 476580字节,450个样本
  • mistralguard: 309478字节,450个样本
  • mistralinstruct: 377642字节,450个样本
  • prompts: 47890字节,450个样本

数据集大小

  • 下载大小: 930253字节
  • 数据集大小: 1999421字节

配置

  • 默认配置: 包含以下数据文件
    • gpt4: data/gpt4-*
    • llama2new: data/llama2new-*
    • llama2orig: data/llama2orig-*
    • mistralguard: data/mistralguard-*
    • mistralinstruct: data/mistralinstruct-*
    • prompts: data/prompts-*

任务类别

  • 对话

语言

  • 英语

大小类别

  • 1K<n<10K

数据集结构

DatasetDict({ gpt4: Dataset({ features: [id, type, prompt, completion, annotation_1, annotation_2, agreement, final_label], num_rows: 450 }) llama2new: Dataset({ features: [id, type, prompt, completion, annotation_1, annotation_2, agreement, final_label], num_rows: 450 }) llama2orig: Dataset({ features: [id, type, prompt, completion, annotation_1, annotation_2, agreement, final_label], num_rows: 450 }) mistralguard: Dataset({ features: [id, type, prompt, completion, annotation_1, annotation_2, agreement, final_label], num_rows: 450 }) mistralinstruct: Dataset({ features: [id, type, prompt, completion, annotation_1, annotation_2, agreement, final_label], num_rows: 450 }) })

引用

@misc{röttger2023xstest, title={XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Models}, author={Paul Röttger and Hannah Rose Kirk and Bertie Vidgen and Giuseppe Attanasio and Federico Bianchi and Dirk Hovy}, year={2023}, eprint={2308.01263}, archivePrefix={arXiv}, primaryClass={cs.CL} }

搜集汇总
数据集介绍
natolambert/xstest-v2-copy 数据集图片
构建方式
在大语言模型安全性评估领域,过度安全行为已成为一个值得关注的研究方向。XSTest测试集正是为识别此类行为而精心构建的评估套件。该数据集基于Paul Röttger等人提出的方法论,通过系统化设计包含450条提示语的测试集,每条提示均包含类型、焦点与备注等元信息。数据集的构建过程严格遵循学术规范,针对GPT-4、Llama 2(新旧版本)、Mistral Guard及Mistral Instruct六种代表性模型,分别收集了对应的模型回复,并经由两名独立标注者对回复进行安全标注,通过一致性检验确定最终标签,形成6个子集,每个子集包含450个样本。
特点
该数据集最显著的特点在于其多维度、多模型的安全评估架构。数据集由六个独立子集构成,分别对应不同模型生成的回复,每个子集均包含完整的标注信息,包括标注者判断、一致性与最终标签。提示语子集则聚焦于原始测试问题本身,提供了类型、焦点与备注等关键元数据。这种设计使得研究者能够横向对比不同模型在面对相同安全测试提示时的行为差异,尤其适用于检测模型是否因过度谨慎而拒绝回答本应无害的问题,为揭示大语言模型安全边界的过度扩展现象提供了标准化评估工具。
使用方法
使用该数据集时,研究者可通过Hugging Face的datasets库便捷加载。具体而言,调用load_dataset函数并指定数据集名称即可获取包含多个子集的DatasetDict对象。若需单独使用提示语部分,可通过索引prompts子集获得450条测试问题。每个模型回复子集均包含id、类型、提示、回复、标注及标签等字段,便于进行细粒度分析。建议研究者根据研究目标选择相应子集,例如对比不同模型的安全行为可选取gpt4、llama2new等子集,而分析提示语本身特性则使用prompts子集。
背景与挑战
背景概述
在大型语言模型(LLMs)安全对齐研究的浪潮中,过度安全行为——即模型对无害或良性输入产生拒绝响应——逐渐成为制约模型实用性的关键瓶颈。为系统化评估与缓解这一现象,Paul Röttger、Hannah Rose Kirk 等研究者于2023年构建了XSTest测试集,该工作发表于arXiv(2308.01263),并由多所顶尖学术机构联合完成。XSTest的核心研究问题在于量化并识别LLMs在面对精心设计的非恶意提示时是否产生不必要的拒绝行为,从而为安全机制的精细调校提供基准。该数据集通过450条覆盖十类敏感话题(如性取向、宗教等)的测试提示,结合GPT-4、Llama 2、Mistral等主流模型的响应与人工标注,对领域产生了深远影响,成为评估模型安全性与可用性平衡的标志性工具。
当前挑战
XSTest所聚焦的领域挑战在于,当前LLMs的安全训练常导致过度泛化,使得模型在面对诸如“如何制作巧克力蛋糕”等无害查询时也触发拒绝机制,严重损害用户体验与任务完成度。这一问题的复杂性源于安全边界的主观性与文化依赖性,同一提示在不同语境下可能被解读为恶意或良性。在数据集构建过程中,研究者面临了多重挑战:首先,需设计出既能触发安全机制又不含真实恶意的高质量测试提示,这要求对敏感话题的边界进行精细界定;其次,跨模型标注的一致性难以保证,不同标注者对“过度安全”的判定标准存在分歧,最终通过双人标注与一致性检验(agreement字段)来提升可靠性;此外,模型响应(如Llama 2的多个版本)的许可证差异也为数据集的统一发布与复用带来了法律与伦理层面的约束。
常用场景
经典使用场景
在大型语言模型安全评估领域,XSTest-v2-copy数据集被广泛用于检测模型是否表现出过度安全行为。该数据集精心设计了450条测试提示,涵盖安全与非安全两类场景,通过评估模型对看似敏感实则无害的提示的拒绝倾向,揭示模型在安全对齐过程中可能产生的过度防御现象。研究者可基于该数据集对比不同模型的安全响应模式,量化模型在安全性与可用性之间的权衡程度。
实际应用
在实际应用中,该数据集为AI安全团队提供了有效的模型审计工具。产品上线前,开发者可利用XSTest对聊天机器人、客服系统等对话式AI进行安全性压力测试,识别那些被错误拦截的合法用户请求。例如在教育辅导、医疗咨询等专业领域,确保模型不会因过度安全机制而拒绝提供关键信息,从而在保障安全底线的同时维护用户体验的流畅性与实用性。
衍生相关工作
XSTest的提出催生了一系列相关研究工作。Röttger等人后续基于该数据集框架扩展了多语言安全测试集,探索跨文化语境下的过度安全差异。另有研究团队借鉴其提示分类方法,开发了针对特定领域(如金融、法律)的定制化安全评估套件。在模型训练层面,XSTest的标注数据被用于微调安全控制器,帮助模型在保持安全性的同时提升对模糊提示的判别精度。
以上内容由遇见数据集搜集并总结生成
二维码
社区交流群
二维码
科研交流群
商业服务