[论文解读] Differentiable Language Model Adversarial Attacks on Categorical Sequence Classifiers
本文提出 DILMA,一种基于微调的掩码语言模型的可微分对抗攻击框架,用于离散类别序列分类器。通过将替代分类器得分与可微分的 Levenshtein 距离结合,构建可微分损失函数,DILMA 生成在语义上连贯且对对抗训练和检测具有鲁棒性的对抗样本,在 NLP、医疗保健和金融数据集上均优于现有方法。
An adversarial attack paradigm explores various scenarios for the vulnerability of deep learning models: minor changes of the input can force a model failure. Most of the state of the art frameworks focus on adversarial attacks for images and other structured model inputs, but not for categorical sequences models. Successful attacks on classifiers of categorical sequences are challenging because the model input is tokens from finite sets, so a classifier score is non-differentiable with respect to inputs, and gradient-based attacks are not applicable. Common approaches deal with this problem working at a token level, while the discrete optimization problem at hand requires a lot of resources to solve. We instead use a fine-tuning of a language model for adversarial attacks as a generator of adversarial examples. To optimize the model, we define a differentiable loss function that depends on a surrogate classifier score and on a deep learning model that evaluates approximate edit distance. So, we control both the adversability of a generated sequence and its similarity to the initial sequence. As a result, we obtain semantically better samples. Moreover, they are resistant to adversarial training and adversarial detectors. Our model works for diverse datasets on bank transactions, electronic health records, and NLP datasets.
研究动机与目标
- 解决为离散类别序列分类器生成有效对抗样本的挑战,因为标准梯度攻击因不可微分而失效。
- 克服基于标记的离散优化方法计算成本高且常次优的局限性。
- 开发一种利用预训练语言模型实现高效、高质量对抗样本生成的方法,同时保持语义连贯性。
- 确保对对抗防御机制(如对抗训练和检测模型)的鲁棒性。
- 在自然语言处理、电子健康记录和银行交易数据等多样化领域验证该方法。
提出的方法
- 微调基于 Transformer 的掩码语言模型(MLM),通过优化可微分损失函数来生成对抗序列。
- 将可微分损失定义为原始序列与对抗序列之间分类器得分差异和近似编辑距离的加权和。
- 使用 Levenshtein 距离的可微分版本,以梯度兼容的方式度量序列相似性。
- 应用 Gumbel-Softmax 技巧,实现通过序列生成过程中离散标记生成的梯度反向传播。
- 支持两种攻击模式:随机采样用于基线生成,目标优化用于提升攻击成功率。
- 利用强大的预训练语言模型,减少对特定任务训练和超参数调优的需求。
实验结果
研究问题
- RQ1能否设计一种可微分损失函数,以支持对离散序列分类器的梯度基于优化对抗攻击?
- RQ2如何在离散类别序列的对抗样本中保持语义连贯性和最小扰动?
- RQ3微调的语言模型在多大程度上能生成可规避对抗训练和检测机制的对抗样本?
- RQ4在多种数据集上,该方法与现有最先进攻击方法相比,在攻击成功率和扰动质量方面表现如何?
- RQ5哪些超参数设置能在无需大量调优的情况下,实现多个领域的稳定性能?
主要发现
- 在 Tr.Gender 数据集上,DILMA 的词错误率(WER)为 0.52,优于 HotFlip(0.61)和 FGSM(0.34),真实类别概率差值为 0.25,表明其具备强大的误分类能力。
- 在 SST-2 数据集上,DILMA 的 WER 为 0.60,概率差值为 0.46,展现出高攻击成功率的同时保持了语义合理性。
- 采用采样策略的 DILMA(DILMA w/ sampling)在 TREC 数据集上 WER 为 0.56,概率差值为 0.41,表明其在多样化 NLP 数据集上表现强劲。
- 在对抗训练后,该方法依然有效,Tr.Gender 上的平均概率差值为 0.25,Tr.Age 上为 0.27,表明其对标准防御机制具有抗性。
- 超参数消融实验表明,性能在不同数据集上保持稳定,减少了对大规模调优的需求。
- 在 WER 和概率下降指标上,该方法均优于 FGSM、DeepFool 和 HotFlip,尤其在对抗训练后的评估中表现更优。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。