Considerable effort has been dedicated to mitigating toxicity, but existing methods often require drastic modifications to model parameters or the use of computationally intensive auxiliary models. Furthermore, previous approaches have often neglected the crucial factor of language's evolving nature over time. In this work, we present a comprehensive perspective on toxicity mitigation that takes into account its changing nature. We introduce Goodtriever, a flexible methodology that matches the current state-of-the-art toxicity mitigation while achieving 43% relative latency reduction during inference and being more computationally efficient. By incorporating a retrieval-based approach at decoding time, Goodtriever enables toxicity-controlled text generation. Our research advocates for an increased focus on adaptable mitigation techniques, which better reflect the data drift models face when deployed in the wild. Code and data are available at https://github.com/for-ai/goodtriever.
翻译:大量工作致力于缓解文本生成中的毒性问题,但现有方法通常需要对模型参数进行剧烈修改或使用计算密集型辅助模型。此外,以往方法往往忽视了语言随时间动态演变这一关键因素。本文提出了一种考虑语言变化特性的毒性缓解综合视角。我们引入Goodtriever这一灵活方法,在实现与当前最先进毒性缓解技术相当性能的同时,推理速度相对延迟降低43%且计算效率更高。通过在解码阶段融入检索式方法,Goodtriever实现了可控毒性的文本生成。本研究倡导加强对自适应缓解技术的关注——这类技术能更真实地反映模型在现实部署中面临的数据漂移问题。相关代码与数据已开源至https://github.com/for-ai/goodtriever。