Code-Mixing on Sesame Street: Dawn of the Adversarial Polyglots

Samson Tan, Shafiq Joty
3/17/2021
cs.CLcs.AIcs.CY

Official code: salesforce/adversarial-polyglots (10 stars, Python, Apache-2.0, last commit 2025-05-01).

Abstract

Multilingual models have demonstrated impressive cross-lingual transfer performance. However, test sets like XNLI are monolingual at the example level.

Show full abstract

In multilingual communities, it is common for polyglots to code-mix when conversing with each other. Inspired by this phenomenon, we present two strong black-box adversarial attacks (one word-level, one phrase-level) for multilingual models that push their ability to handle code-mixed sentences to the limit. The former uses bilingual dictionaries to propose perturbations and translations of the clean example for sense disambiguation. The latter directly aligns the clean example with its translations before extracting phrases as perturbations. Our phrase-level attack has a success rate of 89.75% against XLM-R-large, bringing its average accuracy of 79.85 down to 8.18 on XNLI. Finally, we propose an efficient adversarial training scheme that trains in the same number of steps as the original model and show that it improves model accuracy.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Code for the paper "Code-Mixing on Sesame Street: Dawn of the Adversarial Polyglots" (NAACL-HLT 2021)

106PythonApr 7, 20211 years agoApache-2.0
adversarial-attacksadversarial-examplesadversarial-trainingcode-mixingmultilingual+2 more

Similar Papers

Cite this paper

@article{tan2021codemixing,
  title  = {Code-Mixing on Sesame Street: Dawn of the Adversarial Polyglots},
  author = {Samson Tan and Shafiq Joty},
  year   = {2021},
  eprint = {2103.09593},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.09593}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2103.09593.svg)](https://codeofpaper.com/paper/2103.09593)

Discussion