Unveiling Vulnerability of Self-Attention

要約

事前トレーニングされた言語モデル (PLM) は、単語の小さな変更に対して脆弱であることが示されており、これは現実世界のシステムに大きな脅威となります。
これまでの研究は単語入力の操作に直接焦点を当てていましたが、敵対的なサンプルを生成する手段に制限があり、現実世界の多用途な攻撃への一般化が欠けていました。
この論文では、トランスベースの PLM の基本構造であるセルフ アテンション (SA) メカニズムについて研究します。
(1) 私たちは強力な摂動技術 \textit{HackAttend} を提案します。これは、細心の注意を払って作成された注意マスクを介して SA 行列内の注意スコアを摂動します。
私たちは、最先端の PLM が重大な脆弱性に陥り、わずかな注意の混乱 $(1\%)$ が非常に高い攻撃成功率 $(98\%)$ を生み出す可能性があることを示します。
私たちの論文では、単語の摂動による従来のテキスト攻撃を、より一般的な構造の摂動に拡張します。
(2) \textit{S-Attend} という新しい平滑化手法を導入します。これは、構造的摂動を介して SA を効果的に堅牢にするものです。
私たちは、このシンプルかつ効果的な手法が、さまざまなテキスト攻撃者に直面した場合に、敵対的トレーニングと同等の堅牢なパフォーマンスを達成することを経験的に示しています。
コードは \url{github.com/lionkj/HackAttend} で公開されています。

要約(オリジナル)

Pre-trained language models (PLMs) are shown to be vulnerable to minor word changes, which poses a big threat to real-world systems. While previous studies directly focus on manipulating word inputs, they are limited by their means of generating adversarial samples, lacking generalization to versatile real-world attack. This paper studies the basic structure of transformer-based PLMs, the self-attention (SA) mechanism. (1) We propose a powerful perturbation technique \textit{HackAttend}, which perturbs the attention scores within the SA matrices via meticulously crafted attention masks. We show that state-of-the-art PLMs fall into heavy vulnerability that minor attention perturbations $(1\%)$ can produce a very high attack success rate $(98\%)$. Our paper expands the conventional text attack of word perturbations to more general structural perturbations. (2) We introduce \textit{S-Attend}, a novel smoothing technique that effectively makes SA robust via structural perturbations. We empirically demonstrate that this simple yet effective technique achieves robust performance on par with adversarial training when facing various text attackers. Code is publicly available at \url{github.com/liongkj/HackAttend}.

arxiv情報

著者 Khai Jiet Liong,Hongqiu Wu,Hai Zhao
発行日 2024-02-26 10:31:45+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

カテゴリー: cs.CL パーマリンク