Abstract
Adversarial attacks reveal vulnerabilities in deep neural networks. Textual attacks are particularly challenging due to the discrete nature of language, where small perturbations can drastically alter meaning. Word-level attacks can be framed as combinatorial optimization problems, but existing models often suffer from unsuitable search space reduction and inefficient optimization. This paper proposes a novel attack model incorporating sememe-based word substitution and Particle Swarm Optimization (PSO). Experiments on BiLSTM and BERT across benchmark datasets show our model achieves higher success rates and produces higher-quality adversarial examples than baselines, while also demonstrating superior transferability and potential for robustness enhancement via adversarial training.
Introduction
Adversarial attacks—intentional, subtle perturbations designed to mislead machine learning models—have been extensively studied in computer vision. In the image domain, these attacks often involve imperceptible changes to pixel values. However, the discrete nature of text makes such attacks significantly more difficult. One cannot simply "nudge" a word; one must replace it entirely.
Existing word-substitution attacks face two major hurdles. First is semantic drift: substituting a word with a neighbor in an embedding space (like GloVe) often changes the sentence's meaning entirely (e.g., swapping "car" for "road"). Second is the combinatorial explosion of the search space. Finding the optimal combination of word swaps to flip a model's prediction is a massive search problem. Most current methods rely on simple "greedy" heuristics that frequently get trapped in local optima or genetic algorithms that require excessive modifications to be effective.
Methodology
The authors propose a two-pronged approach to address these issues by re-framing the attack as a combinatorial optimization problem.
Sememe-based Word Substitution
Instead of relying on word embeddings or simple synonyms from WordNet, the authors utilize sememes—the smallest units of semantic meaning. Using the HowNet knowledge base, they identify substitutes that share the same underlying semantic "DNA."
Unlike embeddings, which might group "hot" and "cold" together because they appear in similar contexts, sememes ensure that the substitute carries the same core meaning. To maintain natural language flow, the authors restrict substitutes to the same Part-of-Speech (POS) tag and ensure they match the original word's morphological form (e.g., maintaining verb tense).
As illustrated in the example above, sememe-based substitutes like "cake" or "rice" (within the context of food) are more semantically stable than embedding-based substitutes like "mutton" or "roast-chicken," which might change the specific subject of the sentence too drastically.
Particle Swarm Optimization (PSO)
To navigate the massive search space of possible sentence versions, the authors adapt PSO—an evolutionary algorithm inspired by the social behavior of bird flocking. In this framework, each "particle" represents a potential adversarial sentence. Particles move through the search space guided by their own best-found position and the global best position found by the entire swarm.
Since text is discrete, the authors implement a version of PSO where "velocity" represents the probability of a word being mutated in each iteration. They also employ a "time-decreasing active factor" ($\omega$); early in the search, particles explore widely, while later stages focus on fine-tuning the most successful adversarial examples found.
Experimental Results
The proposed PSO + Sememe model was evaluated against standard baselines, including Genetic Algorithms (GA), on the Stanford Sentiment Treebank (SST) dataset. The target model was a BiLSTM with max-pooling.
The results demonstrate a clear advantage for the proposed method. The PSO + Sememe model achieved a 94.60% attack success rate, significantly higher than the GA baseline using word embeddings (74.90%). Furthermore, the model proved to be more "stealthy," modifying only 12.75% of the words on average, compared to 20.18% for the GA-embedding baseline. An ablation study confirmed that the sememe-based substitution itself provides a massive boost: even when using the GA search algorithm, switching from embeddings to sememes increased the success rate from 74.9% to 92.6%.
Conclusion
This research highlights that textual adversarial attacks are most effective when treated as complex optimization problems rather than simple heuristic searches. By combining linguistically-grounded sememe substitutions with the global search capabilities of PSO, the authors expose significant vulnerabilities in state-of-the-art NLP models. Future work will focus on reducing the computational overhead of evolutionary search and applying these techniques to improve model robustness through adversarial training.
Summary updated