arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.01270cs.CLcs.AI
收藏

三思而后生成:通过渐进式自反思实现安全防护

Think Twice, Generate Once: Safeguarding by Progressive Self-Reflection

New York University(纽约大学)

Hoang Phan, Victor Li, Qi Lei

AI总结:

针对大语言模型易生成有害内容的问题,提出推理时渐进式自反思技术PSR,搭配自适应轮次预测器,在不额外训练、保留良性任务性能的前提下大幅降低攻击成功率,实现安全与效率的平衡。

摘要:

大语言模型(LLM)凭借生成连贯且符合上下文文本的能力,彻底变革了自然语言处理领域。然而,其部署引发了人们对生成有害或不当内容潜在风险的重大担忧。本文提出了渐进式自反思(Progressive Self-Reflection, PSR),这是一种全新的推理时技术,能够让大语言模型动态地自我监控并修正输出。实验结果表明,将该方法应用于Llama-3.1-8B-Instruct时,攻击成功率从77.5%降至5.9%;应用于Llama-3.1-8B base时,攻击成功率从89.7%降至5.6%;应用于Qwen2.5-7B-Instruct时,攻击成功率从44.4%降至3.8%,且无需额外训练,同时保持了模型在良性任务上的原有性能。该方法属于测试时扩展方法,通过增加自反思轮次提升安全性,但会带来推理开销。为平衡安全性与计算效率,本文提出了一种轻量级自反思预测器,可根据输入复杂度估算最优反思轮次。这种自适应机制可避免对良性输入进行不必要的自我评估,同时确保在遇到潜在有害内容时进行全面评估。研究结果表明,渐进式自反思是一种可扩展的测试时方法,可根据输入的风险程度动态分配计算资源,从而提升大语言模型的安全性。

英文摘要:

Large language models (LLMs) have revolutionized natural language processing with their ability to generate coherent and contextually relevant text. However, their deployment raises significant concerns about the potential for generating harmful or inappropriate content. In this paper, we introduce Progressive Self-Reflection (PSR), a novel inference-time technique that empowers LLMs to self-monitor and correct their outputs dynamically. Experimental results demonstrate that applying our proposed method to Llama-3.1-8B-Instruct reduces the attack success rate from 77.5\% to 5.9\%, to Llama-3.1-8B base from 89.7\% to 5.6\%, and to Qwen2.5-7B-Instruct from 44.4\% to 3.8\%, without additional training, while maintaining their original performance on benign tasks. Our approach acts as a test-time scaling method, where additional self-reflection rounds enhance safety at the cost of inference overhead. To balance safety with computational efficiency, we introduce a lightweight self-reflection predictor that estimates the optimal number of reflection rounds based on input complexity. This adaptive mechanism prevents unnecessary self-assessment on benign inputs while ensuring thorough evaluation when encountering potentially harmful content. Our findings suggest that Progressive Self-Reflection serves as a scalable test-time approach, enhancing LLM safety by dynamically allocating computational resources in proportion to the input's risk profile.

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

↑