# RealToxicityPrompts

RealToxicityPrompts 是一个基准数据集，包含约 10 万条自然出现的英语句级提示词，由华盛顿大学和[艾伦人工智能研究所](https://www.edgepedia.org/zh/allen-institute-for-ai)的研究人员于 2020 年构建，用于衡量语言模型在被要求续写文本时会产生多少毒性内容。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> 每条提示词都配有一个来自 [Perspective API](https://www.edgepedia.org/zh/perspective-api) 分类器的毒性评分，模型在该基准上的得分由其所生成续文的毒性推导而来。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup>

| 事实 | 值 |
| --- | --- |
| 创建者 | Gehman、Gururangan、Sap、Choi 和 Smith；华盛顿大学与艾伦人工智能研究所<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> |
| 发布时间 | EMNLP 2020 Findings（arXiv 2020 年 9 月）<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> |
| 分发版本大小 | 99,442 条提示词（Hugging Face 上 67.7 MB）<sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup> |
| 提示词来源 | OpenWebText 语料库（来自 Reddit 外链 URL 的英语网页文本）<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup><sup> • </sup><sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup> |
| 毒性判定器 | Perspective API TOXICITY：一个 AUC 为 0.97 的卷积神经网络，校准为概率值<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> |
| 核心指标 | 25 次生成上的期望最大毒性与毒性概率<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> |
| 2020 年主要结果 | GPT-2 和 GPT-3 在毒性提示词上达到 0.75 的期望最大毒性；所有五个受测模型即使面对非毒性提示词，毒性概率也接近或高于 0.5<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> |
| 2026 年状态 | 仍被托管，且仍用于 2026 年的毒性缓解论文和 NVIDIA 的 garak 红队测试扫描器<sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup><sup> • </sup><sup>[3](https://arxiv.org/pdf/2602.06623v1.pdf)</sup><sup> • </sup><sup>[4](https://github.com/NVIDIA/garak/blob/e2e3ca1b/garak/probes/realtoxicityprompts.py)</sup> |

## RealToxicityPrompts 是什么

该数据集由取自 OpenWebText 语料库的句子开头组成，该语料库是从 Reddit 上发布的外链 URL 抓取的大量英语网页文本。每个句子先用 Perspective API 评分，然后被一分为二，得到一条提示词（前半句）和一条留出的续文（后半句）。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup><sup> • </sup><sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup> 提示词平均长度为 11.7 ± 4.2 个词元；其中 21,744 条为毒性（TOXICITY ≥ 0.5），其余为非毒性，提示词平均毒性为 0.29，续文平均毒性为 0.38。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup>

分层是使该基准有用的设计选择：作者从四个等宽毒性区间（从 [0, .25) 到 [.75, 1]）中各采样 25,000 个句子，因此该集合刻意包含了大量自身文本已有毒性的提示词。较高区间内的提示词是“挑战性”子集，在分发数据中被如此标记，因为很容易诱使模型复述或加剧上下文中的毒性。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup><sup> • </sup><sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup> 100,000 这一名义数字是论文中的数字；分发文件包含 99,442 行。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup><sup> • </sup><sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup>

## 工作原理

受测模型会收到每条提示词并生成 25 条续文。每条续文由 Perspective API 的 TOXICITY 模型评分，该模型的评分由一个卷积神经网络输出，该网络使用来自[维基百科](https://www.edgepedia.org/zh/wikipedia)、《纽约时报》及其他新闻网站的专有评论语料训练而成，AUC 为 0.97；等渗回归对原始输出进行校准，使评分可读作文本有毒的概率。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup><sup> • </sup><sup>[5](https://huggingface.co/papers/2009.11462)</sup>

论文定义了 k = 25 次生成上的两个聚合指标：期望最大毒性，即各生成集中最高毒性评分在提示词上的平均值；以及毒性概率，即 25 次生成中至少有一次评分达到或超过 0.5 的经验概率。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup><sup> • </sup><sup>[5](https://huggingface.co/papers/2009.11462)</sup> 数据集卡片还记录了每条提示词的 Perspective 子项评分，包括 severe_toxicity、identity_attack、insult、threat、profanity、sexually_explicit 和 flirtation，以及挑战性标记。<sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup>

## 谁在何时构建了它

RealToxicityPrompts 由华盛顿大学和艾伦人工智能研究所的 Samuel Gehman、Suchin Gururangan、Maarten Sap、Yejin Choi 和 [Noah A. Smith](https://www.edgepedia.org/zh/noah-a-smith) 创建，并随其 EMNLP 2020 Findings 论文（2020 年 9 月发布于 arXiv）一同发布。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> 据官方仓库，原始实验使用 Perspective API 对文本评分，并通过 [OpenAI API](https://www.edgepedia.org/zh/openai-api) 生成 GPT-3 文本。<sup>[6](https://github.com/allenai/real-toxicity-prompts?tab=readme-ov-file)</sup>

## 已知结果

原始论文的核心发现常被概括为“毒性滋生毒性”。在毒性提示词上，GPT-2 在 25 次生成上的期望最大毒性达到 0.75 ± 0.19，GPT-3 达到 0.75 ± 0.20，毒性概率分别为 0.88 和 0.87；在非毒性提示词上，相同模型的期望最大毒性分别为 0.51 和 0.52。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> 所有五个受评估的模型家族（GPT-1、GPT-2、CTRL、GPT-3 及引导变体）即使面对非毒性提示词，毒性概率也接近或高于 0.5，这意味着仅无害上下文本身就能诱发出毒性输出。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup>

论文还发现，提示词毒性与续文毒性呈轻微负相关（r = -0.08，p ≤ 0.001），因此测得的毒性通常局限于句子的某一半，而非贯穿全句。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup> 在缓解方面，没有一种受测的去毒方法万无一失；数据和计算密集型方法（如在非毒性数据上进行自适应预训练）比禁用“坏”词之类的简单修补效果更好。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup>

## 2020 年以来的使用情况及 2025–2026 年状态

RealToxicityPrompts 已成为评估毒性退化的实际标准，并在当前研究中保持这一角色。2026 年 2 月一篇关于子空间干预毒性缓解的 arXiv 论文仍将其视为标准挑战集，使用 Detoxify 库在 20 个生成词元上测量毒性，并通过 WikiText 困惑度检查流畅性，遵循 2025 年先前工作（Uppaal 等）建立的评估协议。<sup>[3](https://arxiv.org/pdf/2602.06623v1.pdf)</sup> NVIDIA 的 garak 大语言模型漏洞扫描器附带一个 RealToxicityPrompts 探针；由于完整数据集非常大，该探针使用各毒性类别中最成功提示词的子集，而非完整数据。<sup>[4](https://github.com/NVIDIA/garak/blob/e2e3ca1b/garak/probes/realtoxicityprompts.py)</sup> 该数据集仍由 allenai 在 [Hugging Face](https://www.edgepedia.org/zh/hugging-face) 上托管并可下载，且被收录于 TensorFlow Datasets（训练集 99,442 个样本，版本 1.0.0）。<sup>[2](https://huggingface.co/datasets/allenai/real-toxicity-prompts)</sup><sup> • </sup><sup>[7](https://www.tensorflow.org/datasets/catalog/real_toxicity_prompts)</sup> 一份于 2026 年 4 月核实的二手参考资料将其描述为大语言模型的标准开源毒性基准，结构未变。<sup>[8](https://theneuralbase.com/llm-benchmarks/learn/advanced/realtoxicityprompts/)</sup> 此处可获得的证据并未指明 2025–2026 年哪些具体实验室在当前模型卡或安全报告中引用了它。

## 批评与局限

**分类器偏差。** 原始作者本人就指出 Perspective API 并不完美且有偏差：系统会高估包含少数群体身份提及的文本（例如“我是一个男同性恋”）或非裔美国人英语文本的毒性，使评分偏向词汇线索，遗漏更微妙的伤害，并错误标记非毒性内容。他们声明，关于去毒的结论受检测器偏差的限制。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup>

**分类器分歧。** 不同毒性分类器的评分存在显著分歧；Perspective API 与 Detoxify 的评分相关性约为 0.65，因此在该基准上发表的安全性主张需要说明使用了哪个判定器。<sup>[8](https://theneuralbase.com/llm-benchmarks/learn/advanced/realtoxicityprompts/)</sup> 这在实践中很重要，因为上文引用的 2026 年协议使用 Detoxify 评分，而非数据集构建时所用的 Perspective API。<sup>[3](https://arxiv.org/pdf/2602.06623v1.pdf)</sup>

**覆盖范围与时效性。** 该基准仅覆盖英语毒性，其评级反映的是 2020 年前后的人类判断；2026 年的评分者可能对相同文本给出不同标签。<sup>[8](https://theneuralbase.com/llm-benchmarks/learn/advanced/realtoxicityprompts/)</sup> 作者还使用分类器而非人类标注者对至少 80 GB 的预训练网页文本进行了评分，因为规模不允许人工标注，因此其语料库毒性估计是下界。<sup>[1](https://aclanthology.org/2020.findings-emnlp.301/)</sup><sup> • </sup><sup>[5](https://huggingface.co/papers/2009.11462)</sup>

**低分可以被钻空子。** RealToxicityPrompts 的低分本身并不能表明模型是安全的：平淡、过度拒绝或退化的输出可以压制测得的毒性，而不改善真实行为。因此当前 2025–2026 年的协议在 RealToxicityPrompts 上评估毒性，并在单独数据集（WikiText 困惑度）上评估流畅性，以免安全收益与退化或分布漂移的输出混为一谈。<sup>[3](https://arxiv.org/pdf/2602.06623v1.pdf)</sup> 此处证据未记录该基准上通过拒绝来钻空子的具体案例，也未记录模型训练数据中提示词污染的具体案例。

## 与其他基准的比较

当前指导是将 RealToxicityPrompts 与领域特定的安全基准配对使用，例如用于偏差的 BBQ 和专门用于生成内容毒性的 ToxiGen，而不是将其作为单独的安全性衡量指标。<sup>[8](https://theneuralbase.com/llm-benchmarks/learn/advanced/realtoxicityprompts/)</sup>

## References

1. [RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language Models (Findings of EMNLP 2020)](https://aclanthology.org/2020.findings-emnlp.301/)
2. [allenai/real-toxicity-prompts dataset card (Hugging Face)](https://huggingface.co/datasets/allenai/real-toxicity-prompts)
3. [Do Prompts Guarantee Safety? Mitigating Toxicity from LLM Generations through Subspace Intervention (arXiv, February 2026)](https://arxiv.org/pdf/2602.06623v1.pdf)
4. [garak/probes/realtoxicityprompts.py (NVIDIA garak)](https://github.com/NVIDIA/garak/blob/e2e3ca1b/garak/probes/realtoxicityprompts.py)
5. [RealToxicityPrompts paper page (arXiv 2009.11462 mirror on Hugging Face)](https://huggingface.co/papers/2009.11462)
6. [allenai/real-toxicity-prompts GitHub repository](https://github.com/allenai/real-toxicity-prompts?tab=readme-ov-file)
7. [real_toxicity_prompts | TensorFlow Datasets](https://www.tensorflow.org/datasets/catalog/real_toxicity_prompts)
8. [RealToxicityPrompts | LLM Benchmarks Advanced Course (The Neural Base)](https://theneuralbase.com/llm-benchmarks/learn/advanced/realtoxicityprompts/)

---
*Initially written Sep 17, 2026 · Reviewed: Sep 19, 2026 · Edited: Sep 19, 2026; Oct 11, 2026; Oct 25, 2026 · Last review: Sep 19, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › Foundation-model methods and training › Safety methods, interpretability, and red-teaming

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/realtoxicityprompts

English original: https://www.edgepedia.org/realtoxicityprompts
