arXiv:2507.21750cs.CL2025-07中稿 · with an A-decision…被引 2

通过去除实例级主成分提升语言模型抗攻击能力,无需对抗训练。

Adversarial Defence without Adversarial Defence: Enhancing Language Model Robustness via Instance-level Principal Component Removal

  • 在嵌入空间中移除实例级主成分,使分布更接近高斯分布。
  • 在8个数据集上实现更强的抗攻击性,且未攻击时准确率与基线相当。
  • 无需对抗样本或训练时扰动,计算开销低,适合实际部署。

预训练语言模型在自然语言处理中取得显著进展,但对对抗攻击仍敏感,影响其在真实场景中的可靠性。以往方法通过在训练中引入对抗扰动来缓解攻击影响,但常伴随高计算成本。本文提出一种简单有效的附加模块,通过去除实例级主成分来增强语言模型的对抗鲁棒性,无需依赖传统对抗防御或扰动原始训练数据。该方法将嵌入空间转换为近似高斯分布,降低对对抗扰动的敏感性,同时保持语义关系。该变换使嵌入分布更均衡,减小对抗噪声对决策边界的干扰,从而在不使用对抗样本或昂贵训练增强的前提下提升鲁棒性。在8个基准数据集上的评估表明,该方法在保持与基线相当的原始准确率的同时,显著提升了对抗鲁棒性,实现了鲁棒性与泛化能力的平衡。

原文摘要 · Abstract (English)

Pre-trained language models (PLMs) have driven substantial progress in natural language processing but remain vulnerable to adversarial attacks, raising concerns about their robustness in real-world applications. Previous studies have sought to mitigate the impact of adversarial attacks by introducing adversarial perturbations into the training process, either implicitly or explicitly. While both strategies enhance robustness, they often incur high computational costs. In this work, we propose a simple yet effective add-on module that enhances the adversarial robustness of PLMs by removing instance-level principal components, without relying on conventional adversarial defences or perturbing the original training data. Our approach transforms the embedding space to approximate Gaussian properties, thereby reducing its susceptibility to adversarial perturbations while preserving semantic relationships. This transformation aligns embedding distributions in a way that minimises the impact of adversarial noise on decision boundaries, enhancing robustness without requiring adversarial examples or costly training-time augmentation. Evaluations on eight benchmark datasets show that our approach improves adversarial robustness while maintaining comparable before-attack accuracy to baselines, achieving a balanced trade-off between robustness and generalisation.

语言模型对抗防御鲁棒性主成分

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。