用特殊标记词让大模型自动识别有害内容并自我纠正。
A Generative Approach to LLM Harmfulness Mitigation with Red Flag Tokens
- 在模型词表中加入红标令牌,触发时主动标记有害内容
- 仅轻微改变语言分布,对正常任务影响小,支持跨语言泛化
- 可结合上下文学习实现自我反思,无需人工判断是否安全
许多大语言模型的安全后训练方法旨在将模型从生成不安全回答转变为拒绝回应。然而,这种分布变化往往脆弱,且损害有益任务性能。为此,我们提出在模型词表中引入特殊红标令牌,并训练模型在生成或即将生成有害内容时插入该令牌。该方法使模型在表示中显式学习有害性概念,由于自然语言生成分布的微小变化,对实用性影响极小。此外,由于该令牌嵌入模型词表,可自然利用大模型的泛化能力,如上下文学习(ICL)和对未正式支持语言(如Llama3对日语)的分布外泛化。特别地,我们证明仅通过ICL,模型在生成红标令牌时可启动反思推理,引导响应远离有害延续,或在误触发时实现自我修正。该方法与现有安全技术(如安全分类器或标准安全训练)正交互补,且相比自然语言拒绝更易评估,无需人类或自动化裁判判断答案是否安全。
原文摘要 · Abstract (English)
Many safety post-training methods for large language models (LLMs) are designed to modify the model's behaviour from producing unsafe answers to issuing refusals. However, such distribution shifts are often brittle and degrade performance on desirable tasks. To address these pitfalls, we propose augmenting the model's vocabulary with a special red flag token, and training the model to insert this token whenever harmful content is generated or imminent. This approach enables the model to explicitly learn the concept of harmfulness in its representations, with minimal impact on utility due to the marginal change in the generated distribution of natural language. Moreover, because the token is embedded in the model's vocabulary, we can naturally leverage the LLMs' generalization capabilities, such as in-context learning (ICL) and out-of-distribution generalization to languages that are not formally supported (e.g., Japanese for Llama3). In particular, we demonstrate that through ICL alone, the model can learn to initiate reflective reasoning upon generating the red flag token at inference, which steers the response away from harmful continuations or enables self-correction when the flag is raised falsely. This approach is orthogonal and complementary to existing safety technique (such as safety classifiers or standard safety training) and easier to evaluate in comparison to natural language refusals, as it does not require a human or automated judge to assess the harmlessness of the answers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。