Unreal Thinking: 通过两阶段后门实现链式思维劫持
Unreal Thinking: Chain-of-Thought Hijacking via Two-stage Backdoor
AI总结:
本文提出MRTS和TSBH方法,解决LLM链式思维劫持中的数据稀缺和稳定性问题,通过生成对齐的CoT实现可控的恶意行为诱导,并提供安全推理数据集和缓解方法。
摘要:
大型语言模型(LLM)越来越多地被部署在用户解释链式思维(CoT)的场景中,这带来了新的安全风险:攻击者可能操纵模型的可观察CoT以产生恶意行为。在开源生态系统中,此类操纵可通过轻量级适配器嵌入并易于分发和附加到基础模型。实践中,持久化的CoT劫持面临三个主要挑战:在保持稳定下游输出的同时直接劫持单个连续长CoT输出序列中的CoT令牌的难度,恶意CoT数据的稀缺性,以及朴素后门注入方法的不稳定性。为了解决数据稀缺问题,我们提出了多级树搜索(MRTS),一种逆向合成过程,通过提示-输出对构建对齐的CoT,而无需直接从对齐模型中提取恶意CoT。基于MRTS,我们引入了两阶段后门劫持(TSBH),首先诱导中间CoT与恶意输出之间的触发条件不匹配,然后在MRTS生成的CoT上微调模型,这些CoT与恶意输出的嵌入距离较低,从而确保更强的语义相似性。在多个开源模型上的实验表明,我们的方法成功诱导了触发激活的CoT劫持,同时在我们的评估框架下保持劫持状态与基线状态之间的可量化区别。我们进一步探索了一种基于推理的缓解方法,并发布了安全推理数据集以支持未来安全意识和可靠推理的研究。我们的代码可在https://github.com/ChangWenhan/TSBH_official获取。
英文摘要:
Large Language Models (LLMs) are increasingly deployed in settings where Chain-of-Thought (CoT) is interpreted by users. This creates a new safety risk: attackers may manipulate the model's observable CoT to make malicious behaviors. In open-weight ecosystems, such manipulation can be embedded in lightweight adapters that are easy to distribute and attach to base models. In practice, persistent CoT hijacking faces three main challenges: the difficulty of directly hijacking CoT tokens within one continuous long CoT-output sequence while maintaining stable downstream outputs, the scarcity of malicious CoT data, and the instability of naive backdoor injection methods. To address the data scarcity issue, we propose Multiple Reverse Tree Search (MRTS), a reverse synthesis procedure that constructs output-aligned CoTs from prompt-output pairs without directly eliciting malicious CoTs from aligned models. Building on MRTS, we introduce Two-stage Backdoor Hijacking (TSBH), which first induces a trigger-conditioned mismatch between intermediate CoT and malicious outputs, and then fine-tunes the model on MRTS-generated CoTs that have lower embedding distance to the malicious outputs, thereby ensuring stronger semantic similarity. Experiments across multiple open-weight models demonstrate that our method successfully induces trigger-activated CoT hijacking while maintaining a quantifiable distinction between hijacked and baseline states under our evaluation framework. We further explore a reasoning-based mitigation approach and release a safety-reasoning dataset to support future research on safety-aware and reliable reasoning. Our code is available at https://github.com/ChangWenhan/TSBH_official.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。