English

Input-specific Attention Subnetworks for Adversarial Detection

Computation and Language 2022-03-24 v1 Cryptography and Security Machine Learning

Abstract

Self-attention heads are characteristic of Transformer models and have been well studied for interpretability and pruning. In this work, we demonstrate an altogether different utility of attention heads, namely for adversarial detection. Specifically, we propose a method to construct input-specific attention subnetworks (IAS) from which we extract three features to discriminate between authentic and adversarial inputs. The resultant detector significantly improves (by over 7.5%) the state-of-the-art adversarial detection accuracy for the BERT encoder on 10 NLU datasets with 11 different adversarial attack types. We also demonstrate that our method (a) is more accurate for larger models which are likely to have more spurious correlations and thus vulnerable to adversarial attack, and (b) performs well even with modest training sets of adversarial examples.

Keywords

Cite

@article{arxiv.2203.12298,
  title  = {Input-specific Attention Subnetworks for Adversarial Detection},
  author = {Emil Biju and Anirudh Sriram and Pratyush Kumar and Mitesh M Khapra},
  journal= {arXiv preprint arXiv:2203.12298},
  year   = {2022}
}

Comments

Accepted at Findings of ACL 2022, 14 pages, 6 Tables and 9 Figures

R2 v1 2026-06-24T10:23:07.170Z