Improving the Robustness of Transformer-based Large Language Models with Dynamic Attention

要約

BERT や GPT などのトランスフォーマー ベースのモデルは、その優れたパフォーマンスにより、自然言語処理 (NLP) で広く採用されています。
ただし、最近の研究では、テキスト入力を意図的に操作することによってモデルの出力が誤解される可能性がある、テキストによる敵対的攻撃に対して脆弱であることが示されています。
モデルの堅牢性を強化し、この脆弱性を軽減するためにさまざまな方法が提案されているにもかかわらず、その多くは大量のリソースを必要とするか (敵対的トレーニングなど)、または限られた保護しか提供しません (防御ドロップアウトなど)。
この論文では、さまざまな敵対的な攻撃に対するモデル自体の固有の堅牢性を強化するために、トランスフォーマー アーキテクチャに合わせて調整された、ダイナミック アテンションと呼ばれる新しい方法を提案します。
私たちの方法では、下流のタスクの知識は必要なく、追加のコストもかかりません。
提案された動的アテンションは、(I) 選択されたトークンのアテンション値をマスクまたは弱めるアテンション修正、および (ii) 候補トークンのセットを動的に構築する動的モデリングの 2 つのモジュールで構成されます。
広範な実験により、動的な注意により敵対的攻撃の影響が大幅に軽減され、広く使用されている敵対的攻撃に対して以前の方法よりもパフォーマンスが最大 33\% 向上することが実証されました。
動的注意のモデルレベルの設計により、他の防御方法 (敵対的トレーニングなど) と簡単に組み合わせて、モデルの堅牢性をさらに高めることができます。
さらに、動的アテンションが他の動的モデリング手法と比較して、元のモデルの最先端のロバスト性空間を保存することを実証します。

要約(オリジナル)

Transformer-based models, such as BERT and GPT, have been widely adopted in natural language processing (NLP) due to their exceptional performance. However, recent studies show their vulnerability to textual adversarial attacks where the model’s output can be misled by intentionally manipulating the text inputs. Despite various methods that have been proposed to enhance the model’s robustness and mitigate this vulnerability, many require heavy consumption resources (e.g., adversarial training) or only provide limited protection (e.g., defensive dropout). In this paper, we propose a novel method called dynamic attention, tailored for the transformer architecture, to enhance the inherent robustness of the model itself against various adversarial attacks. Our method requires no downstream task knowledge and does not incur additional costs. The proposed dynamic attention consists of two modules: (I) attention rectification, which masks or weakens the attention value of the chosen tokens, and (ii) dynamic modeling, which dynamically builds the set of candidate tokens. Extensive experiments demonstrate that dynamic attention significantly mitigates the impact of adversarial attacks, improving up to 33\% better performance than previous methods against widely-used adversarial attacks. The model-level design of dynamic attention enables it to be easily combined with other defense methods (e.g., adversarial training) to further enhance the model’s robustness. Furthermore, we demonstrate that dynamic attention preserves the state-of-the-art robustness space of the original model compared to other dynamic modeling methods.

arxiv情報

著者 Lujia Shen,Yuwen Pu,Shouling Ji,Changjiang Li,Xuhong Zhang,Chunpeng Ge,Ting Wang
発行日 2023-11-30 02:08:24+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, Google

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