提出回溯机制,让大模型在生成中发现不安全内容时精准修正,不丢弃整段文本。
Backtracking for Safety
- 引入回溯机制,可在生成中途退回更安全的节点,而非从头重来。
- 实验显示毒性内容显著减少,且对生成效率影响极小。
- 适合需要长文本安全控制的应用场景,如对话系统、内容生成。
大型语言模型在各类任务中表现出色,但确保其安全性和与人类价值观的一致性仍至关重要。当前的安全对齐方法(如监督微调和基于强化学习的方法)易受对抗攻击影响,且往往仅关注生成初始阶段的有害内容,难以应对长文本中逐渐出现的毒性等细微安全问题。现有方法如重置虽可恢复生成,但会丢弃已生成内容,效率低下。本文提出一种新型回溯方法,当生成过程中出现安全违规时,模型可回退至更安全的生成状态,无需回到起点。该方法能精准修正问题片段,保留已有有效内容,显著降低生成过程中的毒性表现,同时对效率影响极小。
原文摘要 · Abstract (English)
Large language models (LLMs) have demonstrated remarkable capabilities across various tasks, but ensuring their safety and alignment with human values remains crucial. Current safety alignment methods, such as supervised fine-tuning and reinforcement learning-based approaches, can exhibit vulnerabilities to adversarial attacks and often result in shallow safety alignment, primarily focusing on preventing harmful content in the initial tokens of the generated output. While methods like resetting can help recover from unsafe generations by discarding previous tokens and restarting the generation process, they are not well-suited for addressing nuanced safety violations like toxicity that may arise within otherwise benign and lengthy generations. In this paper, we propose a novel backtracking method designed to address these limitations. Our method allows the model to revert to a safer generation state, not necessarily at the beginning, when safety violations occur during generation. This approach enables targeted correction of problematic segments without discarding the entire generated text, thereby preserving efficiency. We demonstrate that our method dramatically reduces toxicity appearing through the generation process with minimal impact to efficiency.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。