RecurGuard: 推理令牌消耗攻击的运行时监控
RecurGuard: Runtime Monitoring for Reasoning-Token Consumption Attacks
AI总结:
RecurGuard通过监控推理轨迹的重复率、体积增长和查询进展三个信号,实时检测并阻止推理令牌消耗攻击,在DS-R1-Qwen-7B上对OverThink和ExtendAttack的检测率分别达99%和92%,且误报率接近零。
摘要:
具有推理能力的大型语言模型可能被诱导将其生成预算花在注入的诱饵任务上,而不是回答用户的问题,导致在没有产生最终答案时发生拒绝服务,以及在输出令牌计费时造成钱包耗尽。输入侧的安全分类器通常会漏掉这些攻击,因为注入的提示可能在语法上看起来是良性的。我们构建了RecurGuard,这是一个运行时监控器,用于在模型暴露推理轨迹时检测推理链消耗攻击。RecurGuard在推理轨迹生成时对其进行分析,并跟踪三个信号:重复率、体积增长以及向用户查询的进展。如果所有三个信号在连续三个块中保持异常,RecurGuard会提前终止生成。我们在开源推理模型上评估了RecurGuard对抗OverThink和ExtendAttack的效果,并在DS-R1-Qwen-7B上进行了自适应压力测试。在该模型上,RecurGuard检测到99%的OverThink攻击和92%的ExtendAttack实例,同时在问答、代码生成、数学和摘要任务上保持接近零的误报率。自适应评估揭示了该防御的局限性:主题攻击仍保持11.9倍的放大效果,联合漏检率约为50%,而完全语义规避将放大倍数从22.8倍降至2.2倍。当推理轨迹不可用时,QDM提供基于最终输出的事后回退监控器。
英文摘要:
Reasoning-capable large language models can be induced to spend their generation budget on injected decoy tasks rather than answering the user's question, causing denial of service when no final answer is produced and denial of wallet when excess output tokens are billed. Input-side safety classifiers often miss these attacks because the injected prompts can appear syntactically benign. We build RecurGuard, a runtime monitor for detecting reasoning-chain consumption attacks when reasoning traces are exposed by the model. RecurGuard analyzes reasoning traces as they are generated and tracks three signals: recurrence rate, volume growth, and progress toward the user's query. If all three signals remain anomalous over three consecutive chunks, RecurGuard terminates generation early. We evaluate RecurGuard against OverThink and ExtendAttack across open-weight reasoning models and conduct adaptive stress tests on DS-R1-Qwen-7B. On this model, RecurGuard detects 99% of OverThink attacks and 92% of ExtendAttack instances while maintaining near-zero false positive rates on question answering, code generation, mathematics, and summarization. Adaptive evaluation reveals the limit of the defense: topical attacks retain 11.9x amplification with an approximately 50% joint miss rate, whereas full semantic evasion reduces amplification from 22.8x to 2.2x. When reasoning traces are unavailable, QDM provides a post-hoc fallback monitor based on the final output.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。