Input-specific Attention Subnetworks for Adversarial Detection

Emil Biju, Anirudh Sriram, Pratyush Kumar, Mitesh Khapra


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.
Anthology ID:
2022.findings-acl.4
Volume:
Findings of the Association for Computational Linguistics: ACL 2022
Month:
May
Year:
2022
Address:
Dublin, Ireland
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
31–44
Language:
URL:
https://aclanthology.org/2022.findings-acl.4
DOI:
10.18653/v1/2022.findings-acl.4
Bibkey:
Cite (ACL):
Emil Biju, Anirudh Sriram, Pratyush Kumar, and Mitesh Khapra. 2022. Input-specific Attention Subnetworks for Adversarial Detection. In Findings of the Association for Computational Linguistics: ACL 2022, pages 31–44, Dublin, Ireland. Association for Computational Linguistics.
Cite (Informal):
Input-specific Attention Subnetworks for Adversarial Detection (Biju et al., Findings 2022)
Copy Citation:
PDF:
https://aclanthology.org/2022.findings-acl.4.pdf
Software:
 2022.findings-acl.4.software.zip
Data
AG NewsGLUEIMDb Movie ReviewsMRPCMultiNLIQNLISNLISST