arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2511.12752cs.CRcs.AI
收藏

《这究竟是谁的叙事?一种KV缓存操纵攻击》

Whose Narrative is it Anyway? A KV Cache Manipulation Attack

Mukkesh Ganesh, Kaushik Iyer, Arun Baalaaji Sankar Ananthan

AI总结:

本文针对大语言模型KV缓存的安全风险,提出History Swapping块级攻击方法,通过预计算缓存覆盖实现无提示词修改的生成内容劫持,在Qwen3上验证了攻击效果并揭示了KV缓存的结构编码特性。

摘要:

键值(KV)缓存是自回归大语言模型(LLM)实现高效推理的重要组件,但它作为模型内部状态表征的属性使其成为完整性攻击的潜在目标。本文提出了一种名为“History Swapping(历史替换)”的新型块级攻击方法,该方法通过操纵KV缓存引导模型生成内容,且不会修改面向用户的提示词。该攻击的实现方式是使用来自不同主题的预计算缓存覆盖活跃生成过程中缓存的连续片段。我们在Qwen 3模型家族的324种配置上对该方法进行了实证评估,分析了缓存覆盖的时机、覆盖幅度和层深度带来的影响。研究结果表明,只有全层覆盖才能成功劫持对话主题,进而引发三种不同的行为:即时且持续的主题偏移、部分恢复,或是延迟劫持。此外我们观察到,高层结构计划在生成过程早期就被编码,而局部话语结构由模型的最后几层维持。本研究证明KV缓存是安全分析的重要攻击向量,因为它不仅编码上下文信息,还编码主题轨迹和结构规划,使其成为操纵模型行为的强力接口。

英文摘要:

The Key Value(KV) cache is an important component for efficient inference in autoregressive Large Language Models (LLMs), but its role as a representation of the model's internal state makes it a potential target for integrity attacks. This paper introduces "History Swapping," a novel block-level attack that manipulates the KV cache to steer model generation without altering the user-facing prompt. The attack involves overwriting a contiguous segment of the active generation's cache with a precomputed cache from a different topic. We empirically evaluate this method across 324 configurations on the Qwen 3 family of models, analyzing the impact of timing, magnitude, and layer depth of the cache overwrite. Our findings reveal that only full-layer overwrites can successfully hijack the conversation's topic, leading to three distinct behaviors: immediate and persistent topic shift, partial recovery, or a delayed hijack. Furthermore, we observe that high-level structural plans are encoded early in the generation process and local discourse structure is maintained by the final layers of the model. This work demonstrates that the KV cache is a significant vector for security analysis, as it encodes not just context but also topic trajectory and structural planning, making it a powerful interface for manipulating model behavior.

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

↑