%0 Conference Proceedings %T Input-specific Attention Subnetworks for Adversarial Detection %A Biju, Emil %A Sriram, Anirudh %A Kumar, Pratyush %A Khapra, Mitesh %Y Muresan, Smaranda %Y Nakov, Preslav %Y Villavicencio, Aline %S Findings of the Association for Computational Linguistics: ACL 2022 %D 2022 %8 May %I Association for Computational Linguistics %C Dublin, Ireland %F biju-etal-2022-input %X 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. %R 10.18653/v1/2022.findings-acl.4 %U https://aclanthology.org/2022.findings-acl.4 %U https://doi.org/10.18653/v1/2022.findings-acl.4 %P 31-44