[论文解读] Toward Adversarial Training on Contextualized Language Representation
本文提出上下文表征-对抗训练(CreAT),一种显式优化对抗攻击以使 BERT 编码器的上下文表征偏离的方法,从而在多种自然语言处理任务中实现更鲁棒且一致的性能提升。CreAT 在 AdvGLUE(61.1)、HellaSWAG(94.9)和 ANLI(69.3)等基准测试中达到最先进水平,通过更有效地欺骗整个模型(包括编码器),优于标准对抗训练。
Beyond the success story of adversarial training (AT) in the recent text domain on top of pre-trained language models (PLMs), our empirical study showcases the inconsistent gains from AT on some tasks, e.g. commonsense reasoning, named entity recognition. This paper investigates AT from the perspective of the contextualized language representation outputted by PLM encoders. We find the current AT attacks lean to generate sub-optimal adversarial examples that can fool the decoder part but have a minor effect on the encoder. However, we find it necessary to effectively deviate the latter one to allow AT to gain. Based on the observation, we propose simple yet effective extit{Contextualized representation-Adversarial Training} (CreAT), in which the attack is explicitly optimized to deviate the contextualized representation of the encoder. It allows a global optimization of adversarial examples that can fool the entire model. We also find CreAT gives rise to a better direction to optimize the adversarial examples, to let them less sensitive to hyperparameters. Compared to AT, CreAT produces consistent performance gains on a wider range of tasks and is proven to be more effective for language pre-training where only the encoder part is kept for downstream tasks. We achieve the new state-of-the-art performances on a series of challenging benchmarks, e.g. AdvGLUE (59.1 $ ightarrow $ 61.1), HellaSWAG (93.0 $ ightarrow $ 94.9), ANLI (68.1 $ ightarrow $ 69.3).
研究动机与目标
- 探究为何对抗训练(AT)在不同自然语言处理任务中表现不一致,尤其是在常识推理和命名实体识别任务中。
- 识别出当前 AT 方法主要欺骗解码器,对编码器的上下文表征影响有限。
- 提出一种新的对抗训练范式,显式优化扰动以偏离编码器的上下文表征,实现全局鲁棒性。
- 提升对抗训练的一致性和鲁棒性,特别是在仅微调编码器的场景中。
- 通过更有效且超参数稳定的攻击方向,在具有挑战性的自然语言处理基准上实现最先进性能。
提出的方法
- CreAT 修改对抗攻击,使其直接优化 BERT 编码器生成的上下文表征的偏离程度,而非仅关注最终预测结果。
- 攻击被设计为最大化对 BERT 中间层(特别是深层层 10–12)隐藏状态和注意力图的影响。
- 该方法使用基于梯度的优化,生成对抗样本,以在 Frobenius 范数约束下最大化上下文表征的差异。
- CreAT 显式针对编码器的表征空间,确保对抗样本影响整个模型,而不仅限于分类头。
- 该方法保持标准微调协议,即从头开始重新训练解码器,同时冻结编码器权重,适用于语言预训练。
- 由于攻击方向更稳定且全局优化,超参数敏感性降低,从而实现更好的收敛性。
实验结果
研究问题
- RQ1为何对抗训练在不同自然语言处理任务中表现不一致,尤其是在常识推理和命名实体识别任务中?
- RQ2当前对抗攻击对 BERT 编码器的上下文表征与解码器头的影响程度如何?
- RQ3是否可通过显式优化对抗攻击以偏离编码器的上下文表征,实现更一致且鲁棒的性能提升?
- RQ4针对编码器表征是否能提升仅微调编码器场景下对抗训练的有效性?
- RQ5CreAT 中的新攻击方向与标准 AT 相比,如何影响超参数敏感性?
主要发现
- CreAT 在 AdvGLUE 上达到 61.1 的新最先进性能,较标准 AT 的 59.1 显著提升。
- 在 HellaSWAG 上,CreAT 达到 94.9 的准确率,较标准 AT 的 93.0 显著提高。
- 在 ANLI 上,CreAT 达到 69.3 的准确率,较标准 AT 的 68.1 提升。
- 可视化结果显示,与标准 AT 相比,CreAT 在深层 BERT 层(10–12)的隐藏状态和注意力图上引起显著更强的偏离。
- CreAT 对超参数(如内层上升步数和步长)的敏感性更低,表明其收敛性和稳定性更优。
- 该方法表明,有效的对抗训练本质上依赖于偏离编码器的上下文表征,而不仅仅是解码器。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。