Skip to main content
QUICK REVIEW

[论文解读] ParaFuzz: An Interpretability-Driven Technique for Detecting Poisoned Samples in NLP

Yan Lü, Zhuo Zhang|arXiv (Cornell University)|Aug 4, 2023
Software Engineering Research被引用 7
一句话总结

ParaFuzz 是一种测试时检测框架,通过利用模型可解释性及基于 ChatGPT 的提示工程化改写,检测 NLP 样本中的投毒样本。该方法在改写过程中对触发词进行变异,从而识别投毒样本。它使用模糊测试优化提示,实现了 90.1% 的平均 F1 分数,显著优于 STRIP、RAP 和 ONION,尤其在隐蔽攻击(如 Hidden Killer)中表现突出。

ABSTRACT

Backdoor attacks have emerged as a prominent threat to natural language processing (NLP) models, where the presence of specific triggers in the input can lead poisoned models to misclassify these inputs to predetermined target classes. Current detection mechanisms are limited by their inability to address more covert backdoor strategies, such as style-based attacks. In this work, we propose an innovative test-time poisoned sample detection framework that hinges on the interpretability of model predictions, grounded in the semantic meaning of inputs. We contend that triggers (e.g., infrequent words) are not supposed to fundamentally alter the underlying semantic meanings of poisoned samples as they want to stay stealthy. Based on this observation, we hypothesize that while the model's predictions for paraphrased clean samples should remain stable, predictions for poisoned samples should revert to their true labels upon the mutations applied to triggers during the paraphrasing process. We employ ChatGPT, a state-of-the-art large language model, as our paraphraser and formulate the trigger-removal task as a prompt engineering problem. We adopt fuzzing, a technique commonly used for unearthing software vulnerabilities, to discover optimal paraphrase prompts that can effectively eliminate triggers while concurrently maintaining input semantics. Experiments on 4 types of backdoor attacks, including the subtle style backdoors, and 4 distinct datasets demonstrate that our approach surpasses baseline methods, including STRIP, RAP, and ONION, in precision and recall.

研究动机与目标

  • 为解决现有检测方法难以识别 NLP 模型中隐蔽后门攻击(尤其是基于风格和语义的触发词)的问题。
  • 开发一种无需事先了解触发词及其插入机制的测试时检测框架。
  • 通过利用干净样本的语义稳定性与投毒样本在触发词变异下的标签回退行为,提升检测的精确率与召回率。
  • 将触发词移除问题建模为提示工程问题,利用类似 ChatGPT 的大语言模型求解。

提出的方法

  • ParaFuzz 基于假设:当通过改写移除触发词时,投毒样本应恢复到其真实标签,而干净样本的预测结果应保持一致。
  • 它使用 ChatGPT 作为改写器,生成语义保持不变的输入样本变体,同时在过程中对触发词进行变异或移除。
  • 该方法将最优改写提示建模为搜索问题,利用模糊测试探索并演化提示,以最大化检测性能。
  • 模糊测试通过模型在干净和投毒验证集上的预测反馈进行引导,终止条件基于 F1 分数或变异体数量。
  • 该框架假设可访问干净验证集和模型查询能力,但不依赖触发词知识或训练数据。
  • 它通过跨多种随机种子的归一化处理,展示了提示优化过程中种子无关的有效性。

实验结果

研究问题

  • RQ1能否利用模型可解释性在不事先知晓触发词及其插入机制的情况下检测投毒样本?
  • RQ2使用大语言模型进行提示工程化改写,在揭示后门攻击模型中隐藏触发词方面有多有效?
  • RQ3模糊测试能否有效应用于优化改写提示,以提升投毒样本的检测性能?
  • RQ4该方法在高级隐蔽后门攻击(如基于风格和 Hidden Killer 攻击)中的表现如何?
  • RQ5提示优化过程对不同初始种子提示的性能是否具有鲁棒性?

主要发现

  • ParaFuzz 在 4 个数据集和 4 种攻击类型上实现了 90.1% 的平均 F1 分数,显著优于基线方法 STRIP(36.3%)、RAP(80.3%)和 ONION(11.9%)。
  • 在所有基线方法均无法检测的 Hidden Killer 攻击中,ParaFuzz 达到 77.6% 的 F1 分数,证明其对最隐蔽后门策略的有效性。
  • 在基于风格的攻击中,ParaFuzz 在 SST-2 上达到 89.6% 的 F1 分数,在 IMDB 上达到 93.4%,优于 ONION(57.7% 和 94.2%)和 STRIP(13.7% 和 60.8%)。
  • 该方法在多种模型上保持高性能,包括模型 #46 和模型 #36,使用优化提示时 F1 分数始终高于 90%。
  • 消融实验表明,模糊测试过程具有种子无关性,三个随机选择的种子提示均收敛至超过 90% 的 F1 分数。
  • 该框架能成功检测长语句触发词和单字符触发词,而 ONION 在此类情况下失败,表明其对触发词复杂度具有鲁棒性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。