ICASSP 2023

Targeted Adversarial Attacks Against Neural Machine Translation

Sahar Sadrizadeh · Amirhossein Dabiriaghdam · Ljiljana Dolamic · Pascal Frossard

EPFL · University of Tehran · Armasuisse S+T

Read the paper IEEE Xplore Source code

A small, meaning-preserving change to a source sentence can make a translation model insert a chosen keyword into its output.

Attack setting
White-box, targeted
Translation tasks
English-French and English-German
Benchmark
WMT14 with Marian NMT
Baseline
Seq2Sick

Targeted failures are harder - and potentially more dangerous

Untargeted attacks only need to reduce translation quality. A targeted attack must make the model produce a specific word while keeping the modified source sentence close enough to the original to avoid easy detection.

This work formulates that objective directly: encourage a chosen target keyword in the translation and penalize source-side changes that damage semantic similarity.

Optimize continuously, then return to valid language

The attack combines an adversarial objective with a language-model embedding similarity term, then solves the discrete text problem through iterative gradient projection.

Select a position

At each iteration, find the output position where the target keyword has the smallest logit gap.

Take a gradient step

Optimize target insertion and source similarity jointly in the continuous NMT embedding space.

Project to text

Map the updated representation to the nearest valid token using language-model embeddings.

Evaluated across two WMT14 translation tasks

Experiments attack Marian models using 1,000 randomly selected sentences for each of English-to-French and English-to-German. They include a predefined malicious keyword and multiple nth-most-likely target-token settings.

>75%attack success in every reported target setting
>0.8source similarity in almost all reported settings
4.7×faster than Seq2Sick in the reported French keyword experiment
Predefined “war” keyword
TranslationMethodAttack successSimilarity
English-FrenchProposed99.29%0.83
English-FrenchSeq2Sick86.68%0.73
English-GermanProposed83.84%0.77
English-GermanSeq2Sick27.41%0.74

Similarity constraints and dynamic positioning both matter

The proposed attack outperforms Seq2Sick in success rate and relative BLEU decrease while remaining competitive on semantic similarity. Language-model embeddings help preserve meaning in harder scenarios, and recomputing the easiest target position at every iteration prevents the sharp success-rate drop seen with a fixed position.

Cite this work

@inproceedings{sadrizadeh2023targeted,
  title={Targeted Adversarial Attacks Against Neural Machine Translation},
  author={Sadrizadeh, Sahar and Dabiriaghdam, Amirhossein and Dolamic, Ljiljana and Frossard, Pascal},
  booktitle={2023 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)},
  year={2023},
  organization={IEEE}
}