[Paper Review] Natural Language Adversarial Attacks and Defenses in Word Level
This paper proposes Synonyms Encoding Method (SEM), a defense against word-level adversarial attacks that substitute words with synonyms while preserving semantics and grammar. SEM uses a neural encoder before the input layer to learn robust representations, reducing adversarial perturbations with minimal accuracy drop on clean examples, and introduces Improved Genetic Algorithm (IGA) as a strong attack baseline for evaluation.
Up until recent two years, inspired by the big amount of research about adversarial example in the field of computer vision, there has been a growing interest in adversarial attacks for Natural Language Processing (NLP). What followed was a very few works of adversarial defense for NLP. However, there exists no defense method against the successful synonyms substitution based attacks that aim to satisfy all the lexical, grammatical, semantic constraints and thus are hard to perceived by humans. To fill this gap, we postulate the generalization of the model leads to the existence of adversarial examples, and propose an adversarial defense method called Synonyms Encoding Method (SEM), which inserts an encoder before the input layer of the model and then trains the model to eliminate adversarial perturbations. Extensive experiments demonstrate that SEM can efficiently defend current best synonym substitution based adversarial attacks with almost no decay on the accuracy for benign examples. Besides, to better evaluate SEM, we also propose a strong attack method called Improved Genetic Algorithm (IGA) that adopts the genetic metaheuristic against synonyms substitution based attacks. Compared with existing genetic based adversarial attack, the proposed IGA can achieve higher attack success rate at the same time maintain the transferability of adversarial examples.
Motivation & Objective
- Address the lack of effective defenses against synonym substitution-based adversarial attacks in NLP that preserve linguistic constraints.
- Identify model generalization as a root cause of adversarial vulnerability in word-level attacks.
- Develop a defense mechanism that maintains high accuracy on benign inputs while effectively neutralizing adversarial perturbations.
- Propose a strong attack method to better evaluate the robustness of proposed defenses.
- Establish a benchmark for evaluating adversarial robustness in NLP using transferable, human-undetectable adversarial examples.
Proposed method
- Introduce Synonyms Encoding Method (SEM), which inserts a neural encoder before the input layer of an NLP model to learn invariant representations.
- Train the model end-to-end with adversarial examples to reduce sensitivity to synonym substitutions.
- Use a sequence-to-sequence autoencoder-like structure in SEM to encode input sentences into a latent space that suppresses adversarial noise.
- Design Improved Genetic Algorithm (IGA) as a metaheuristic attack that evolves synonym substitutions to maximize attack success rate.
- Incorporate fitness functions in IGA that balance attack success, semantic similarity, and grammatical correctness.
- Ensure IGA maintains transferability of adversarial examples across models by optimizing for generalization in the search space.
Experimental results
Research questions
- RQ1Can model generalization be leveraged as a root cause for word-level adversarial examples?
- RQ2Can a neural encoder-based defense effectively neutralize synonym substitution-based adversarial attacks without degrading clean accuracy?
- RQ3How effective is the proposed Improved Genetic Algorithm (IGA) in generating high-success-rate, transferable adversarial examples?
- RQ4To what extent does SEM preserve model performance on benign inputs under adversarial training?
- RQ5Can the combination of IGA and SEM establish a robust benchmark for evaluating NLP adversarial robustness?
Key findings
- SEM achieves strong defense performance against state-of-the-art synonym substitution-based attacks with almost no drop in accuracy on clean examples.
- The proposed Improved Genetic Algorithm (IGA) achieves a higher attack success rate than existing genetic-based methods while maintaining transferability.
- Adversarial examples generated by IGA are highly transferable across different models, indicating their robustness and generalization capability.
- The defense mechanism SEM effectively reduces the impact of adversarial perturbations by learning robust sentence representations in the latent space.
- Extensive experiments confirm that SEM maintains high performance on benign inputs, demonstrating its practicality for real-world NLP applications.
- The combination of IGA and SEM provides a strong benchmark for evaluating adversarial robustness in NLP, especially for word-level attacks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.