English

Less is More: Understanding Word-level Textual Adversarial Attack via n-gram Frequency Descend

Computation and Language 2024-04-16 v4 Artificial Intelligence Cryptography and Security Machine Learning

Abstract

Word-level textual adversarial attacks have demonstrated notable efficacy in misleading Natural Language Processing (NLP) models. Despite their success, the underlying reasons for their effectiveness and the fundamental characteristics of adversarial examples (AEs) remain obscure. This work aims to interpret word-level attacks by examining their nn-gram frequency patterns. Our comprehensive experiments reveal that in approximately 90\% of cases, word-level attacks lead to the generation of examples where the frequency of nn-grams decreases, a tendency we term as the nn-gram Frequency Descend (nn-FD). This finding suggests a straightforward strategy to enhance model robustness: training models using examples with nn-FD. To examine the feasibility of this strategy, we employed the nn-gram frequency information, as an alternative to conventional loss gradients, to generate perturbed examples in adversarial training. The experiment results indicate that the frequency-based approach performs comparably with the gradient-based approach in improving model robustness. Our research offers a novel and more intuitive perspective for understanding word-level textual adversarial attacks and proposes a new direction to improve model robustness.

Keywords

Cite

@article{arxiv.2302.02568,
  title  = {Less is More: Understanding Word-level Textual Adversarial Attack via n-gram Frequency Descend},
  author = {Ning Lu and Shengcai Liu and Zhirui Zhang and Qi Wang and Haifeng Liu and Ke Tang},
  journal= {arXiv preprint arXiv:2302.02568},
  year   = {2024}
}

Comments

To be published in: 2024 IEEE Conference on Artificial Intelligence (CAI 2024)