TL;DR
This paper introduces Explain2Attack, a novel black-box adversarial attack method for text classification. It bypasses the costly query process of traditional methods by using an interpretable "substitute" model trained on a similar domain to learn word importance, achieving competitive attack rates with significantly fewer queries.
What Problem Does This Paper Address?
Deep learning models, especially in natural language processing, are notoriously vulnerable to adversarial attacks. These attacks involve making subtle, imperceptible changes to input data (like text) that cause the model to misclassify it. For black-box attacks, where an attacker only has access to the model's outputs (not its internal parameters), crafting these adversarial examples is challenging. Existing state-of-the-art methods often require a large number of queries to the target model to identify which words are most important to perturb. This is computationally expensive and can raise suspicion in real-world scenarios. The paper aims to address this by developing a more efficient black-box attack that reduces query costs while maintaining or improving attack effectiveness.
Methods
The core innovation of Explain2Attack lies in its approach to word importance ranking. Instead of directly querying the target model to understand which words are most influential (a process that requires many queries), Explain2Attack trains an "interpretable substitute model." This substitute model is trained on a dataset similar to the target model's domain but does not require access to the target model's training data.
The substitute model consists of two main components:
- Selector Network (E): This network learns to identify and select the most important features (words) from an input sentence.
- Substitute Classifier (Fb): This classifier uses the selected features to predict the correct label.
The training objective for the substitute model is to maximize the mutual information between the selected features and the true label, effectively learning which words are most indicative of the label. Once trained, the selector network's output (specifically, the logit output before the selection process) provides a vector of "importance scores" for each word in the input sentence. These scores are then used by the attacker to prioritize which words to replace with synonyms. The attack then proceeds by iteratively replacing words based on these scores and checking if the target model's prediction changes.
Datasets
The paper evaluates its method on several standard sentiment classification datasets:
- IMDB: Movie reviews (binary classification).
- MR: Movie reviews (binary classification).
- Amazon MR: Amazon polarity reviews (binary classification).
- Yelp Polarity Reviews: Business reviews (binary classification).
The Yelp Polarity dataset is specifically highlighted as being used as a "substitute dataset" for training the substitute model when attacking other models. The authors mention that the data preprocessing and partitioning for IMDB, MR, and Amazon MR follow the conventions established in [8].
Key Insights and Ideas
- Cross-Domain Interpretability for Attack: The paper demonstrates that interpretability learned from a similar domain (using a substitute model) can be effectively transferred to guide attacks on a target model, even without direct access to the target model's data or parameters.
- Decoupling Word Importance from Target Model Queries: The most significant insight is that the costly process of querying the target model for word importance can be replaced by training a separate, interpretable model. This drastically reduces the number of queries needed.
- Scalability with Sentence Length: The method's reliance on a pre-trained substitute model, rather than iterative querying, makes it inherently more scalable to longer sentences compared to methods that query word-by-word.
- Efficiency Beyond Just Attack Rate: The paper emphasizes that true efficiency isn't just about achieving a high attack rate, but doing so with minimal queries. Their "Query Efficiency" metric highlights this trade-off, showing their method is more efficient even when attack rates are comparable.
Key Results
- Reduced Queries: Explain2Attack consistently achieves significantly lower average query counts compared to the baseline TextFooler across various target models and datasets. For example, on the IMDB dataset with a BERT classifier, TextFooler requires 980.5 queries on average, while Explain2Attack needs only 873.5. The reduction is more pronounced on other datasets.
- Competitive Attack Rates: The proposed method either matches or outperforms the attack rates (measured as the drop in accuracy after attack) of the state-of-the-art baseline (TextFooler).
- Improved Query Efficiency (QE): The Query Efficiency metric, which balances attack rate with query count, shows Explain2Attack to be superior, indicating that its query reduction is not at the expense of attack effectiveness.
- Scalability: The paper shows that the reduction in queries is more significant for datasets with longer average sentence lengths, demonstrating better scalability.
- Qualitative Assessment: Examples of adversarial sentences show that the semantic meaning is preserved, and the perturbed words appear to be important keywords.
Limitations and Future Work
- Substitute Model Choice: The performance of the attack is influenced by the choice of the substitute model's architecture and the similarity of the substitute dataset to the target domain. The paper notes that further study is needed to formalize these transferability conditions.
- Directly Fooling Target Classifier: Currently, the substitute model's selector provides importance scores, but the final attack still involves querying the target model to confirm label flips. Future work aims to train the selector to directly fool the target classifier, potentially further reducing queries.
- Synonym Replacement: The paper suggests that the general approach could benefit from further query reduction in the synonym replacement phase by incorporating pretrained language models (similar to BERT-Attack and BAE-Attack).
- Formalizing Transferability: The authors plan to study and formalize the conditions under which attacks transfer well between substitute and target models, providing guidance for selecting suitable substitute models.
Summary updated