[论文解读] Defending Pre-trained Language Models as Few-shot Learners against Backdoor Attacks
本文提出了 MDP,一种轻量级、可插拔的防御,通过结合来自 few-shot 数据的分布锚来测量污染对遮蔽敏感性的影响,从而在提示型、少样本的 PLM 中检测后门污染。
Pre-trained language models (PLMs) have demonstrated remarkable performance as few-shot learners. However, their security risks under such settings are largely unexplored. In this work, we conduct a pilot study showing that PLMs as few-shot learners are highly vulnerable to backdoor attacks while existing defenses are inadequate due to the unique challenges of few-shot scenarios. To address such challenges, we advocate MDP, a novel lightweight, pluggable, and effective defense for PLMs as few-shot learners. Specifically, MDP leverages the gap between the masking-sensitivity of poisoned and clean samples: with reference to the limited few-shot data as distributional anchors, it compares the representations of given samples under varying masking and identifies poisoned samples as ones with significant variations. We show analytically that MDP creates an interesting dilemma for the attacker to choose between attack effectiveness and detection evasiveness. The empirical evaluation using benchmark datasets and representative attacks validates the efficacy of MDP.
研究动机与目标
- 促使在少样本设置中研究提示驱动的 PLM 的后门威胁。
- 提出一种针对少样本提示的防御,不需要重新训练或大型数据集。
- 利用干净样本与被污染样本之间的遮蔽敏感性差异来检测后门。
- 可选增强:通过优化提示以实现遮蔽不变性,以提高检测效果。
- 在多个数据集和多种后门攻击中证明有效性。
提出的方法
- 将 MDP 构建为一个遮蔽敏感性检测器,使用有限的 few-shot 数据作为分布锚。
- 用 PLM 在词汇表上的完整语言建模分布来表示每个锚。
- 计算测试样本相对于锚的 KL 散度坐标,以量化遮蔽敏感性。
- 使用 Kendall 秩相关来衡量样本表征在遮蔽下的变化。
- 可选地通过遮蔽不变性损失来对提示进行优化,从而增强干净样本的稳定性。
- 提供理论论证,表明攻击者在 MDP 下的攻击有效性与检测规避之间存在权衡。

实验结果
研究问题
- RQ1在不重新训练或不使用大型数据集的情况下,是否可以防御文本后门攻击的少样本 PLMs?
- RQ2以少样本数据为锚点的遮蔽敏感性是否能够区分提示驱动学习中的被污染样本与干净样本?
- RQ3用于遮蔽不变性的提示优化如何影响防御性能?
- RQ4在 MDP 下,攻击者规避检测的理论极限是什么?
主要发现
- MDP 在五个数据集和多种攻击下,相较基线具有更低的错误接受率(FAR)与错误拒绝率(FRR)。
- MDP 在 SST-2 与 CR 数据集上对 SOS 攻击在若干情形下表现出近乎完美的防御。
- 即使每类仅用 16 个样本作为锚,仍能获得强检测性能,其 FAR/fPRR 相对于 STRIP、ONION 与 RAP 具有优势。
- 遮蔽不变性优化在不牺牲下游任务性能的前提下提升了干净样本的稳定性。
- 一个解析结果表明,在 MDP 下存在攻击者在后门有效性与检测规避之间的根本权衡。
- 连续提示在 MDP 的有效性方面优于离散提示。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。