arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.15721cs.LGcs.CRcs.SE
收藏

缓存还是不缓存:理解和缓解跨模型KV缓存复用中的安全不兼容性

To Cache or Not to Cache: Understanding and Mitigating Safety Incompatibility in Cross-Model KV Cache Reuse

National University of Singapore(新加坡国立大学);Ant Group(蚂蚁集团)

Zhiwei Lin, Jiahao Liu, Yan Liu, Chengpeng Wang

AI总结:

本研究针对跨模型KV缓存复用的安全不兼容性问题,提出VReparo技术,可降低HarmBench攻击成功率与StrongREJECT分数,同时保留首令牌时间的优化效果。

摘要:

跨模型KV缓存共享允许接收模型复用相关发送模型生成的前缀KV状态,从而减少预填充计算。现有方法针对延迟和生成质量优化这种复用,但其安全影响仍不明确。本研究在不同的发送-接收模型对和复用配置下系统评估该问题,将其偏离接收模型原生安全行为的情况称为安全不兼容性。研究表明,安全不兼容性的方向和幅度均取决于模型对和复用配置,在所有评估的模型对中,值复用导致的偏差远大于键复用。此外,我们提出VReparo技术,该技术离线学习每层和每个KV头的仿射映射,在解码前将复用的发送模型值张量与接收模型原生对应项对齐。在两个模型对的全KV复用和最先进的选择性复用设置下,VReparo在我们的基准测试中将平均HarmBench攻击成功率(ASR)从57.28%降至39.21%,平均StrongREJECT分数从0.4215降至0.2163,同时保持平均首令牌时间(TTFT)降低85.62%。

英文摘要:

Cross-model KV cache sharing reduces prefill computation by allowing a receiver model to reuse prefix KV states generated by a related sender model. Existing methods optimize such reuse for latency and generation quality, but its safety implications remain unclear. In this work, we systematically evaluate this issue across diverse sender-receiver pairs and reuse configurations. We refer to deviations from the receiver's native safety behavior as safety incompatibility. Our study shows that both the direction and magnitude of safety incompatibility depend on the model pair and reuse configuration, with value reuse causing substantially larger deviations than key reuse across all evaluated pairs. Furthermore, we propose VReparo, a technique that learns per-layer and per-KV-head affine maps offline to align reused sender value tensors with their receiver-native counterparts before decoding. Across two model pairs under full KV reuse and the state-of-the-art selective reuse setting, VReparo reduces the average HarmBench attack success rate (ASR) from 57.28% to 39.21% and the average StrongREJECT score from 0.4215 to 0.2163 upon our benchmarks, while retaining an average Time to First Token (TTFT) reduction of 85.62%.

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

↑