用少量人工标注自动优化正负样本,提升大模型安全对齐效果。
Refining Positive and Toxic Samples for Dual Safety Self-Alignment of LLMs with Minimal Human Interventions
- 仅需少于50次人工标注,用LLM自动生成并精炼正负样本。
- 结合MLE与细粒度去似然训练,同时强化无害生成与抑制有害词。
- 适用于需要高安全性且减少人工干预的开源大模型优化场景。
当前AI代理如ChatGPT和LLaMA主要依赖指令微调和强化学习来对齐大语言模型输出与人类意图,确保内容无害且有用。现有方法高度依赖高质量正样本的人工标注,面临标签噪声及偏好/非偏好响应差异小等问题。而大量具有明确安全区别的有毒样本常被过滤,损失了宝贵的负面参考信号。为此,我们提出PT-ALIGN,一种最小化人工干预的安全自对齐方法,通过自动精炼正样本与有毒样本,并进行细粒度双指令微调。正样本为无害响应,有毒样本则刻意包含极端有害内容,作为新监督信号。具体地,仅需探索少于50次人工标注,利用LLM迭代生成与精炼训练实例。随后采用最大似然估计(MLE)与细粒度去似然训练(UT)联合学习,提升模型安全性。MLE使模型基于正样本最大化无害内容生成;而细粒度UT在词元级别引导模型最小化有害词汇输出,从而实现安全与有效性解耦,更精准地对齐安全目标,提升生成内容的可靠性和帮助性。在9个主流开源大模型上的实验表明,PT-ALIGN在保障相近有用性水平的同时,显著提升安全对齐效果。
原文摘要 · Abstract (English)
Recent AI agents, such as ChatGPT and LLaMA, primarily rely on instruction tuning and reinforcement learning to calibrate the output of large language models (LLMs) with human intentions, ensuring the outputs are harmless and helpful. Existing methods heavily depend on the manual annotation of high-quality positive samples, while contending with issues such as noisy labels and minimal distinctions between preferred and dispreferred response data. However, readily available toxic samples with clear safety distinctions are often filtered out, removing valuable negative references that could aid LLMs in safety alignment. In response, we propose PT-ALIGN, a novel safety self-alignment approach that minimizes human supervision by automatically refining positive and toxic samples and performing fine-grained dual instruction tuning. Positive samples are harmless responses, while toxic samples deliberately contain extremely harmful content, serving as a new supervisory signals. Specifically, we utilize LLM itself to iteratively generate and refine training instances by only exploring fewer than 50 human annotations. We then employ two losses, i.e., maximum likelihood estimation (MLE) and fine-grained unlikelihood training (UT), to jointly learn to enhance the LLM's safety. The MLE loss encourages an LLM to maximize the generation of harmless content based on positive samples. Conversely, the fine-grained UT loss guides the LLM to minimize the output of harmful words based on negative samples at the token-level, thereby guiding the model to decouple safety from effectiveness, directing it toward safer fine-tuning objectives, and increasing the likelihood of generating helpful and reliable content. Experiments on 9 popular open-source LLMs demonstrate the effectiveness of our PT-ALIGN for safety alignment, while maintaining comparable levels of helpfulness and usefulness.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。