Lost In Translation: Generating Adversarial Examples Robust to Round-Trip Translation

Neel Bhandari, Pin-Yu Chen · DOI

TL;DR

This paper investigates the vulnerability of current text-based adversarial attacks to round-trip translation, finding that most attacks lose their effectiveness. To address this, they introduce "NMT-Text-Attack," an intervention that integrates machine translation into the adversarial generation process, creating examples that are robust to round-trip translation and highlighting a new avenue for testing model robustness across languages.

What Problem Does This Paper Address?

Modern language models (LMs) are incredibly powerful but can be fooled by adversarial examples – inputs that are subtly modified to mislead the model while remaining understandable to humans. While much research has focused on adversarial attacks in a single language, the increasing use of LMs in multilingual contexts, particularly for translation, raises a critical question: how do adversarial attacks fare when the text is translated back and forth between languages? This "round-trip translation" is a common process in various applications, from grammar correction to quality assurance in critical domains. The authors identify a gap in understanding how existing adversarial attacks perform under this translation process and whether this process itself can serve as a defense mechanism. They aim to explore this vulnerability and propose a method to generate adversarial examples that are resilient to such translations.

Methods

The core of the paper's contribution lies in their proposed "NMT-Text-Attack" algorithm. This method is designed to be "attack-agnostic," meaning it can be integrated with various existing adversarial attack frameworks. The process involves two main phases:

  1. Word Importance Ranking: This phase is standard in many adversarial attacks. It involves identifying the most crucial words in a sentence that, if modified, are most likely to change the model's prediction. This is done using techniques specific to the underlying attack (e.g., input deletion for TextFooler).
  2. Word Replacement and Constraint Evaluation (with NMT Intervention): This is where the novelty lies. After identifying important words, the algorithm generates potential replacements. Crucially, before these replacements are finalized as adversarial examples, they are subjected to a round-trip translation process using a Neural Machine Translation (NMT) model. The generated adversarial examples are then filtered to ensure they maintain the desired adversarial sentiment after being translated to another language and back. This intervention acts as a strict constraint, ensuring that only examples robust to translation are selected. The algorithm also incorporates original attack-specific constraints (like semantic similarity or part-of-speech preservation) to maintain the quality of the adversarial examples.

Datasets

The experiments were conducted on two standard sentiment analysis datasets:

  • Rotten Tomatoes Movie Reviews
  • Yelp Polarity

The authors sampled 1000 random examples from the test set of each dataset for their experiments.

Key Insights and Ideas

  • Round-trip translation is a surprisingly effective defense: The paper demonstrates that simply translating text to another language and back can render a significant portion of existing adversarial examples ineffective. This suggests that current adversarial attacks are not inherently robust to multilingual processing.
  • NMT intervention creates truly robust adversarial examples: By integrating machine translation directly into the adversarial generation process, the authors can create examples that survive round-trip translation. This highlights that robustness to translation is a distinct and important property for adversarial attacks.
  • Identifying translation-robust adversarial examples reveals deeper model weaknesses: The ability to generate adversarial examples that are robust to translation suggests that the underlying vulnerabilities in LMs might be common across languages, pointing to more fundamental issues in how models process meaning.
  • Attack-agnostic approach is key: The NMT-Text-Attack method's ability to integrate with various existing attacks makes it a versatile tool for evaluating and improving robustness across different adversarial strategies.

Key Results

  • Existing attacks are vulnerable: On average, 66% of adversarial examples generated by 6 state-of-the-art text-based attacks lost their adversarial effectiveness after round-trip translation (using at least one language).
  • NMT-Text-Attack achieves 100% robustness: The proposed intervention guarantees 100% robustness to round-trip translation for the selected language(s) while still maintaining attack success.
  • Trade-off in attack success rate: While achieving 100% robustness, NMT-Text-Attack resulted in a lower overall success rate for generating adversarial examples (around 30% less on average) compared to the original attacks. However, the authors argue this is justified by the guaranteed robustness.
  • Quality of adversarial examples is maintained: Similarity metrics (USE, Jaccard) and meaning preservation metrics (BERT Score) showed minimal variation between adversarial examples generated by original attacks and those enhanced by NMT-Text-Attack, indicating that robustness doesn't come at the cost of quality.
  • Performance on unseen languages: The NMT-Text-Attack demonstrated significant performance increases even when facing "unseen" languages (languages not explicitly used during the intervention phase), suggesting good generalization capabilities.

Limitations and Future Work

  • Computational Cost: While round-trip translation is presented as a "cheap" defense, the process of generating and evaluating adversarial examples with NMT intervention naturally increases computational overhead compared to single-language attacks.
  • Language Selection: The effectiveness of the round-trip translation defense can vary depending on the language pair used. The paper focuses on a few common languages (Spanish, German, French).
  • Future Work: The authors suggest further research into multilingual adversarial attacks, exploring more complex translation scenarios, and investigating how these translation-robust adversarial examples can be used to develop more robust and reliable multilingual language models. They also highlight the potential for scaling up the number of replacements to generate even more robust adversarial examples.

Summary updated

BibTeX
@inproceedings{bhandari2023lost,
  author = {Neel Bhandari and Pin-Yu Chen},
  title = {{Lost In Translation: Generating Adversarial Examples Robust to Round-Trip Translation}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2023},
  doi = {10.1109/icassp49357.2023.10094630},
}
Figure