arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.04802cs.IRcs.CL
收藏

复现 HotFlip 用于稠密检索中的语料投毒攻击

Reproducing HotFlip for Corpus Poisoning Attacks in Dense Retrieval

University of Amsterdam(阿姆斯特丹大学)

Yongkang Li, Panagiotis Eustratiadis, Evangelos Kanoulas

AI总结:

本文复现并显著加速了 HotFlip 语料投毒攻击,将生成时间从每文档4小时降至15分钟,并进一步分析了其在黑盒迁移和查询无关场景下的攻击效果。

摘要:

HotFlip 是一种基于梯度的主题性词替换方法,用于攻击语言模型。近期,该方法被进一步应用于攻击检索系统,通过生成恶意段落并将其注入语料库,即语料投毒。然而,HotFlip 已知计算效率较低,大部分时间花费在对抗性词元生成阶段对每个查询-段落对进行梯度累积,导致无法在合理时间内生成足够数量的对抗性段落。此外,该攻击方法本身假设能够访问一组用户查询,这一强假设并不符合现实世界对抗性攻击通常的执行方式。在本文中,我们首先显著提升了 HotFlip 的效率,在相同硬件条件下,将对抗性生成过程从每篇文档 4 小时缩短至仅 15 分钟。我们进一步在两个额外任务上贡献了实验与分析:(1)基于迁移的黑盒攻击,以及(2)查询无关攻击。在可能的情况下,我们提供了原始方法与改进版本之间的对比。我们的实验表明,HotFlip 能够有效攻击多种稠密检索器,并观察到其攻击性能对更先进和更新的方法有所下降的趋势。有趣的是,我们观察到虽然 HotFlip 在黑盒设置下表现不佳,表明其泛化能力有限,但在查询无关场景中,其性能与注入的对抗性段落数量相关。

英文摘要:

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.

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

↑