Abstract
This paper describes our submission to the sentiment analysis sub-task of "Build It, Break It: The Language Edition (BIBI)", on both the builder and breaker sides. As a builder, we use convolutional neural nets, trained on both phrase and sentence data. As a breaker, we use Q-learning to learn minimal change pairs, and apply a token substitution method automatically. We analyse the results to gauge the robustness of NLP systems.
Introduction
While deep learning has revolutionized natural language processing (NLP), these models remain notoriously "brittle." In computer vision, adversarial examples—images with tiny, invisible perturbations—can force models into making confident, incorrect predictions. Applying this concept to NLP is challenging because language is discrete; one cannot simply shift a pixel, but must change a word. Previous attempts often resulted in nonsensical sentences. This work explores the "cat-and-mouse" game of building robust models and systematically finding their vulnerabilities through automatic, minimally-changed adversarial pairs that remain readable to humans.
Methods
The Builder (Defense)
We implemented a Convolutional Neural Network (CNN) for sentence-level binary sentiment classification based on the architecture by Kim (2014). The model uses word embeddings followed by 1D convolutional layers with multiple filter widths (3, 4, and 5 words) to capture local context. We compared two versions: one trained on full sentences and another trained on phrase-level data from the Stanford Sentiment Treebank (SST).
The Breaker (Attack)
The "breaker" system utilizes a two-step automated pipeline:
- Reinforcement Learning (Q-learning): An RL agent identifies "important" tokens by learning a policy to either
keeporremovetokens to flip a model's prediction while minimizing changes. - Token Substitution: Once identified, tokens are replaced using WordNet to find synonyms (to maintain sentiment but confuse the model) or antonyms (to flip sentiment and test if the model notices).
Results and Analysis
The phrase-based CNN demonstrated superior robustness compared to the sentence-based version. As shown in Figure 1, the phrase-based CNN achieved a competitive $F_1$ score of 0.518, outperforming standard RNNs and Bag-of-n-grams baselines.
The automated RL-based breaker (Breaker 2) was particularly effective against the sentence-based CNN, "breaking" it 39.28% of the time. Figure 2 details the performance of our breaker method alongside others in the BIBI challenge.
Key Insights
- Phrase-level training: Sentence-level models often overfit to specific "strong" features (e.g., proper nouns) rather than underlying sentiment. Phrase-level training encourages better generalization.
- The "Logic" Gap: CNNs struggle with linguistic logic, such as distinguishing between "more than" and "less than."
- Non-compositionality: Models fail when meaning isn't additive, such as in the phrase "love to waste your time," where "love" is negated by the subsequent context.
- Contextual Ambiguity: Idiomatic shifts (e.g., "on the rocks") frequently fool models that rely on local n-gram features.
Conclusion
Our findings highlight a significant gap in current NLP reliability, with approximately one-third of adversarial examples successfully fooling builder systems. While our automated breaker is currently limited in scale—submitting only 42 high-confidence pairs out of 521 generated—it demonstrates the potential for systematic vulnerability discovery. Future work will focus on more sophisticated generative models to handle complex grammatical structures and irony.
Summary updated