arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2212.01810cs.CL
收藏

通过可控逆向生成构建高诱导性对话安全语境

Constructing Highly Inductive Contexts for Dialogue Safety through Controllable Reverse Generation

Tsinghua University(清华大学);Huawei Noah’s Ark Lab(华为诺亚方舟实验室)

Zhexin Zhang, Jiale Cheng, Hao Sun, Jiawen Deng, Fei Mi, Yasheng Wang, Lifeng Shang, Minlie Huang

摘要:

大型预训练语言模型很容易产生有毒或有偏见的内容,这对于实际使用来说是禁止的。为了检测这样的有毒世代,现有的方法依赖于模板、真实世界的数据提取、众包工作者或自动生成来构建可能诱导有毒世代的对抗性背景。然而,什么类型的背景下更有可能诱发不安全的反应仍然是探索不足。在本文中,我们确定了上下文毒性和上下文类别(例如,\textit{profanity}、\textit{insult}、\textit{drugs}等)是导致响应生成中的安全问题的两个重要因素。因此,我们提出了一种称为\emph{reverse generation}的方法来构建以给定响应为条件的对抗性上下文,具有控制类别,毒性水平和诱导性的灵活性。通过逆向生成,我们增加了现有的BAD数据集,并构建了一个新的数据集BAD+,其中包含12个类别中超过12万个不同的和高度归纳的上下文。我们测试了三种流行的预训练对话模型(Blender,DialoGPT和Plato2),发现BAD+可以在很大程度上暴露它们的安全问题。此外,我们表明,BAD+可以大大提高发电的安全性,并揭示了安全改善的关键因素。我们的代码和数据集可在\url{https://github.com/thu-coai/Reverse_Generation}上获得。

英文摘要:

Large pretrained language models can easily produce toxic or biased content, which is prohibitive for practical use. In order to detect such toxic generations, existing methods rely on templates, real-world data extraction, crowdsourcing workers, or automatic generation to construct adversarial contexts that are likely to induce toxic generations. However, what type of context is more likely to induce unsafe responses is still under-explored. In this paper, we identify that context toxicity and context category (e.g., \textit{profanity}, \textit{insult}, \textit{drugs}, etc.) are two important factors to cause safety issues in response generation. Hence, we propose a method called \emph{reverse generation} to construct adversarial contexts conditioned on a given response, with the flexibility to control category, toxicity level, and inductivity of the generated contexts. Via reverse generation, we augment the existing BAD dataset and construct a new dataset BAD+ which contains more than 120K diverse and highly inductive contexts in 12 categories. We test three popular pretrained dialogue models (Blender, DialoGPT, and Plato2) and find that BAD+ can largely expose their safety problems. Furthermore, we show that BAD+ can greatly enhance the safety of generation and reveal the key factors of safety improvement. Our code and dataset is available at \url{https://github.com/thu-coai/Reverse_Generation}.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑