On the Adversarial Robustness of Discrete Image Tokenizers
About
Discrete image tokenizers encode visual inputs as sequences of tokens from a finite vocabulary and are gaining popularity in multimodal systems, including encoder-only, encoder-decoder, and decoder-only models. However, unlike CLIP encoders, their vulnerability to adversarial attacks has not been explored. Ours being the first work studying this topic, we first formulate attacks that aim to perturb the features extracted by discrete tokenizers, and thus change the extracted tokens. These attacks are computationally efficient, application-agnostic, and effective across classification, multimodal retrieval, and captioning tasks. Second, to defend against this vulnerability, inspired by recent work on robust CLIP encoders, we fine-tune popular tokenizers with unsupervised adversarial training, keeping all other components frozen. While unsupervised and task-agnostic, our approach significantly improves robustness to both unsupervised and end-to-end supervised attacks and generalizes well to unseen tasks and data. Unlike supervised adversarial training, our approach can leverage unlabeled images, making it more versatile. Overall, our work highlights the critical role of tokenizer robustness in downstream tasks and presents an important step in the development of safe multimodal foundation models.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Classification | Average across datasets | Clean Accuracy70.2 | 15 | |
| Zero-shot Classification | Caltech101 | Top-1 Clean Acc81.2 | 15 | |
| Classification | Caltech101 | Clean Accuracy69 | 15 | |
| Image Classification | Caltech101 | Clean Accuracy74.4 | 15 | |
| Classification | Imagenette | Clean Accuracy86.2 | 5 | |
| Classification | OI-CROP | Accuracy (Clean)65.2 | 5 | |
| Classification | OI-POS | Clean Accuracy60.6 | 5 | |
| Image Classification | Imagenette | Clean Accuracy93.6 | 5 | |
| Image Classification and Multimodal Retrieval | Average | Clean Accuracy77.3 | 5 | |
| Multimodal Retrieval | OI-CROP | Clean Accuracy71.8 | 5 |