提升热翻转攻击效率,实现快速生成恶意语料并验证其在检索系统中的破坏力。
Reproducing HotFlip for Corpus Poisoning Attacks in Dense Retrieval
- 优化梯度累积策略,将每篇文档生成时间从4小时缩短至15分钟。
- 在多种密集检索模型上验证攻击效果,越先进的模型抗性越强。
- 支持无查询和黑盒攻击场景,揭示攻击效果与注入数量正相关。
HotFlip是一种基于主题梯度的词汇替换方法,用于攻击语言模型。近期该方法被应用于攻击检索系统,通过生成恶意段落注入语料库实现语料污染。然而,HotFlip计算效率低下,大部分时间消耗在查询-段落对的梯度累积上,导致难以在合理时间内生成足够多的对抗样本。此外,原方法假设可获取用户查询,这一强假设与现实攻击场景不符。本文首次显著提升HotFlip效率,使单文档对抗生成时间由4小时降至15分钟(同硬件条件下)。进一步开展两项新实验:(1) 基于迁移的黑盒攻击;(2) 无查询攻击。在可能情况下对比原始方法与改进版本。实验表明,HotFlip能有效攻击多种密集检索器,且攻击性能随先进模型增强而下降。有趣的是,尽管在黑盒设置下表现不佳,显示泛化能力有限,但在无查询场景中,攻击效果与注入的对抗段落数量呈正相关。
原文摘要 · Abstract (English)
HotFlip is a topical gradient-based word substitution method for attacking language models. Recently, this method has been further applied to attack retrieval systems by generating malicious passages that are injected into a corpus, i.e., corpus poisoning. However, HotFlip is known to be computationally inefficient, with the majority of time being spent on gradient accumulation for each query-passage pair during the adversarial token generation phase, making it impossible to generate an adequate number of adversarial passages in a reasonable amount of time. Moreover, the attack method itself assumes access to a set of user queries, a strong assumption that does not correspond to how real-world adversarial attacks are usually performed. In this paper, we first significantly boost the efficiency of HotFlip, reducing the adversarial generation process from 4 hours per document to only 15 minutes, using the same hardware. We further contribute experiments and analysis on two additional tasks: (1) transfer-based black-box attacks, and (2) query-agnostic attacks. Whenever possible, we provide comparisons between the original method and our improved version. Our experiments demonstrate that HotFlip can effectively attack a variety of dense retrievers, with an observed trend that its attack performance diminishes against more advanced and recent methods. Interestingly, we observe that while HotFlip performs poorly in a black-box setting, indicating limited capacity for generalization, in query-agnostic scenarios its performance is correlated to the volume of injected adversarial passages.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。