Skip to content

Adversarial robustness of discrete image tokenizersOn the Adversarial Robustness of Discrete Image Tokenizers

arXiv· arXiv:2602.18252· Rishika Bhagwatkar, Irina Rish, Nicolas Flammarion, Francesco Croce·Indexed by this site · 2026-10-12· Originally publishedAttacks

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

After unsupervised fine-tuning (training radius 8/255), FuseLIP's average robust accuracy at ε=2/255 goes from 4.0% to 55.2% (Table 1).

Threat modelAn unsupervised attacker perturbs images within an ℓ∞ ball to alter the pre-quantization embeddings and tokens of a discrete image tokenizer; it requires no labels, codebook, or downstream LLM. A supervised attacker has access to the entire downstream system and task labels. Victim systems are classifiers using these tokenizers, FuseLIP, and UniTok-MLLM.

Questions
Discrete image tokenizers turn images into tokens over a finite vocabulary and are used as image encoders by classification, retrieval, VQA, and generation models. The authors state that their adversarial robustness has not been studied; perturbed encodings change tokens and affect all downstream systems that use them.
Methods
The unsupervised attack enlarges the pre-quantization embedding distance within an ℓ∞ ball, without labels or downstream models. The defense only fine-tunes the encoder to bring perturbed embeddings close to the original tokenizer's clean embeddings, freezing the codebook and downstream components. Training data is ImageNet-1k, with radii from 4/255 to 16/255.
Experiments and results
Original robust accuracy is very low: UniTok classification average at ε=4/255 is 0.0% (Table 2). After fine-tuning it rises; FuseLIP (AT 8/255) averages 55.2% at ε=2/255 (Table 1), with clean accuracy decreasing. In qualitative examples, the robust version does not follow targeted description attacks.
Limitations and future work
The conclusion suggests studying the effects of VQ, FSQ, codebook size, and feature dimensionality on robustness. They fine-tuned TiTok-S128, TiTok-BL128, and UniTok with ℓ∞ perturbations. The paper does not report the number of repetitions, nor the sample sizes for ImageNet-1k, VQA, and retrieval.
Experimental setupUniTok、UniTok-MLLM et al. · Imagenette、Caltech101 et al. · clean accuracy、robust accuracy
Evaluated models
UniTokUniTok-MLLMTiTok-BL128TiTok-S128FuseLIP-BFuseLIP-SFlexTok
Benchmarks
ImagenetteCaltech101ImageNet-1kOI-CropOI-PosVQAv2OK-VQAGQACOCOCC3M
Metrics
clean accuracyrobust accuracy
AI summaryThe authors claim to be the first to study the adversarial vulnerability of discrete image tokenizers, propose an attack that can efficiently perturb the features they extract, and provide an unsupervised adversarial training defense. These attacks are computationally efficient and application-agnostic, and are effective on classification, multimodal retrieval, and image captioning tasks. The defense method performs unsupervised adversarial training on popular tokenizers while freezing other components, significantly improving robustness against unsupervised and end-to-end supervised attacks, and generalizing to unseen tasks and data. Unlike supervised adversarial training, this method can leverage unlabeled images.

The authors claim to be the first to study the adversarial vulnerability of discrete image tokenizers, propose an attack that can efficiently perturb the features they extract, and provide an unsupervised adversarial training defense. These attacks are computationally efficient and application-agnostic, and are effective on classification, multimodal retrieval, and image captioning tasks. The defense method performs unsupervised adversarial training on popular tokenizers while freezing other components, significantly improving robustness against unsupervised and end-to-end supervised attacks, and generalizing to unseen tasks and data. Unlike supervised adversarial training, this method can leverage unlabeled images.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    Discrete image tokenizers are easily perturbed to change tokens; the authors evaluate with unsupervised attacks and perform adversarial fine-tuning.

    Adversarial perturbations on discrete image tokenizers change the tokens and propagate to all downstream models that use them.

    • Scenario: The authors say such tokenizers have been used in autoregressive generation, as well as encoder-only, encoder-decoder, and decoder-only multimodal systems, with tasks including classification, retrieval, and VQA. Once a tokenizer is compromised, all models using it are affected.
    • Existing gap: The authors say there is extensive work on the adversarial robustness of encoders such as CLIP, while discrete image tokenizers remain completely unexplored. They rely on deep networks trained together with a de-tokenizer, rather than BPE-style vocabulary segmentation.
    • Assumption: Nearest-neighbor quantization is piecewise constant; when an embedding is near a cell boundary, a small displacement can change the nearest code and index.
    • Approach: The authors first give an unsupervised attack that perturbs only the tokenizer and is agnostic to the downstream task, then use the same attack for unsupervised adversarial fine-tuning. The authors say this is the first systematic test and improvement of the adversarial robustness of such tokenizers.
    • Threat model:
      • Goal: Change the output tokens. On a description task, match the input's tokenization to a target image whose semantics align with the desired description, without directly accessing the LLM.
      • Knowledge: The unsupervised objective uses only the pre-quantization embedding; the paper states that no codebook, labels, or downstream information is needed. End-to-end supervised attacks need task information such as labels and act on the entire system.
      • Capability: Perturbations are added within the ℓ∞ ball used in the experiments, using APGD to widen the embedding distance. The paper does not use terms such as white-box or black-box.
      • Victim systems: Classifiers based on TiTok, FlexTok, and UniTok, FuseLIP, and UniTok-MLLM with LLaMA-2-7B as the language model.
  2. What related research exists?

    Related work includes robustness of discrete tokenizers and multimodal encoders; the authors state the former has not been studied.

    The paper reviews along two lines, image tokenizers and encoder robustness, and states that the robustness of discrete image tokenizers has not yet been studied.

    Image tokenizers

    • VQ-VAE (Van Den Oord et al., 2017) replaces continuous latent variables with discrete codes; Yu et al. (2022; 2024a) and FSQ (Mentzer et al., 2024) improve on this.
    • Early methods output a two-dimensional grid; TiTok (Yu et al., 2024b), One-D-Piece (Miwa et al., 2025), FlexTok (Bachmann et al., 2025), and UniTok (Ma et al., 2025) output one-dimensional token sequences. The paper relays that TiTok can reconstruct with as few as 32 tokens, and that UniTok uses multiple codebooks and adds CLIP supervision.
    • Continuous tokenizers (Fan et al., 2025) encode into a continuous feature space. The paper uses this only as a contrastive definition of continuous encoding.

    Use as downstream encoders

    • Unified-IO (Lu et al., 2022), 4M (Mizrahi et al., 2023), and 4M-21 (Bachmann et al., 2024) use discrete tokenizers to process images and segmentation maps; FuseLIP (Schlarmann et al., 2025) combines them with early fusion and contrastive learning.
    • Decoder-only models such as Chameleon (Chameleon Team, 2024), Xie et al. (2025), Wang et al. (2025), and Ma et al. (2025) use them for vision-language understanding and generation.
    • The introduction states that in autoregressive multimodal models, LLM parameter counts are one to two orders of magnitude higher than image tokenizers, so end-to-end attacks are therefore more computationally expensive.

    Adversarial robustness

    • ℓp-bounded robustness has covered classification, segmentation, and detection (Croce et al., 2020; 2024; Li et al., 2025). Attacks include Carlini and Wagner (2017) and APGD (Croce and Hein, 2020), and adversarial training includes Madry et al. (2018) and Zhang et al. (2019).
    • Image perturbations can control the outputs of models such as LLaVA (Schlarmann and Hein, 2023; Qi et al., 2024). Mao et al. (2023) and Schlarmann et al. (2024) fine-tune CLIP vision encoders with adversarial training variants.
    • The authors state that to their knowledge, the robustness of discrete image tokenizers has not been studied before; this paper extends the framework of Schlarmann et al. (2024) to discrete tokenizers.

    Baselines and data

    • Baseline methods: the original tokenizer; end-to-end supervised attacks (cross-entropy APGD and AutoAttack); end-to-end supervised adversarial fine-tuning, updating the encoder, codebook, and classifier (Table 4).
    • Benchmarks/datasets: Imagenette, Caltech101, ImageNet-1k, OI-Crop, OI-Pos, VQAv2, OK-VQA, GQA; COCO for qualitative caption examples, and CC3M for additional fine-tuning.

    The authors state that this paper's unsupervised attack is task-agnostic and the same attack can be used directly for fine-tuning; compared with task-specific supervised defenses, it can use unlabeled images and requires no re-adaptation when switching back to the original system.

  3. How does the paper address this problem?

    The unsupervised attack enlarges the pre-quantization embedding distance and only fine-tunes the encoder to stay close to the original tokenizer.

    Overall, the unsupervised embedding attack first forces the tokenizer to alter the pre-quantization features, then uses the same objective for unsupervised adversarial fine-tuning, updating only the encoder.

    Discrete tokenizers and attack objectives

    • The encoder maps image x to T d-dimensional vectors h_i; the codebook has K codewords, and each h_i is replaced by the nearest codeword, yielding index q_i. TiTok-S128 and TiTok-BL128 have K=8192, d=64, with 128 tokens per image; UniTok uses 8 codebooks, each with K=4096, d=8. Inputs are all 256×256.
    • Nearest-neighbor quantization is piecewise constant. The authors do not directly optimize the non-differentiable and semantically sparse indices, but attack in the pre-quantization embedding space.
    • The attack solves max|δ|p≤ϵ∑i=1T|hi(x+δ)−hi(x)|22. Meaning: within the ℓp ball, maximize the sum of squared norms of the differences in pre-quantization embeddings across tokens, thereby altering the quantization results. The text also states this is maximizing the ℓ2 distance.
    • The paper states that this objective does not access the codebook or use downstream labels. Experiments use APGD. End-to-end attacks use the straight-through estimator to bypass non-differentiable quantization.

    Observing attacks via reconstruction

    • The same unsupervised perturbation can be reconstructed with the corresponding de-tokenizer. Figure 2 shows 2500-step APGD with ε of 4/255 and 8/255.
    • The authors state that attacks with similar classification effects yield different reconstructions across tokenizers: TiTok is most distorted, while FlexTok's subject remains recognizable. The authors suggest this indicates structural differences may affect robustness.

    Unsupervised adversarial fine-tuning

    • Training solves minθ1/(|D|)∑x∈ Dmax|δ|p≤ϵ∑i=1T|hiθ(x+δ)−hiθorig(x)|22. Meaning: the fine-tuned encoder remains close to the original tokenizer's embeddings on clean images within the ε ball.
    • Only the encoder is updated; the codebook, downstream decoder, LLM, and other components are frozen. The authors state that if embeddings are close enough, they will fall into the same index, so downstream performance may be preserved even without exactly solving the objective.
    • Training runs for 1 epoch, ℓ∞, with online 10-step APGD; radii are 4/255, 8/255, 12/255, 16/255. The main data is ImageNet-1k, with CC3M used in the appendix.
    • The authors' rationale: task-agnostic, can switch back to systems using the original tokenizer; can use unlabeled images; only trains the encoder, with lower cost than end-to-end supervised adversarial fine-tuning.

    Success criteria

    • Classification, retrieval, and VQA report clean accuracy and robust accuracy under ℓ∞ attacks. Classification defense evaluation uses AutoAttack; retrieval uses 100-step APGD cross-entropy; VQA uses the three-component ensemble attack from Appendix A. Evaluation uses a fixed short-answer instruction, given verbatim in the text, not repeated here.
    • Image captioning has no numerical metrics. The unsupervised setting minimizes the embedding distance between the perturbed image and a target image; the supervised setting maximizes the probability of the LLM generating a specified string. Whether the target is followed is shown qualitatively in Figures 3 and 4.
  4. What experiments did the paper conduct?

    Original UniTok classification robust accuracy is 0.0%; FuseLIP AT 8/255 averages 55.2% at ε=2/255.

    Experimental setup

    • Tokenizer: Fine-tuned objects are TiTok-BL128, TiTok-S128 (appendix), and UniTok, updating only the encoder. Figure 1 also includes FlexTok, which is not fine-tuned. TiTok is pretrained on ImageNet-1k with ViT-S or ViT-B backbones; UniTok uses a ViT-L/16 backbone, and the authors state its pretraining uses 1.28 billion image-text pairs from DataComp.
    • Downstream systems: FuseLIP-S/B use TiTok-S128/BL128 respectively; UniTok does zero-shot classification; UniTok-MLLM's language model is LLaMA-2-7B. Figure 1 trains a ViT probe on TiTok quantized features and a linear probe on FlexTok.
    • Data: Classification uses Imagenette, Caltech101, and UniTok additionally ImageNet-1k; retrieval uses OI-Crop, OI-Pos; VQA uses VQAv2, OK-VQA, GQA; qualitative description uses COCO. Appendix A states Imagenette and Caltech101 each have 500 test images.
    • Attacks: Classification defense evaluation uses AutoAttack; retrieval uses 100-step APGD cross-entropy; VQA uses half-precision 100-step APGD-CE plus two targeted attacks (Appendix A, target words not repeated). Unsupervised attacks optimize embedding distance. Perturbations are ℓ∞, with main evaluation radii of 2/255 and 4/255.
    • Training: 1 epoch, 10-step APGD, radii from 4/255 to 16/255, ImageNet-1k; CC3M only for Section 5 comparisons. The paper does not report repetitions and does not use a separate LLM judge model.
    • Metrics: Clean accuracy and robust accuracy (%).

    Main results

    Averages (%) from Tables 1–3. AT8 means training radius 8/255.

    | System | Original clean | Original ε=4/255 | AT8 clean | AT8 ε=4/255 | Source | | FuseLIP four datasets | 77.3 | 0.6 | 72.2 | 38.3 | Table 1 | | UniTok classification three datasets | 84.1 | 0.0 | 77.8 | 50.1 | Table 2 | | UniTok-MLLM VQA | 66.9 | 6.4 | 59.1 | 39.4 | Table 3 |

    • The authors state that training radius controls the clean-robust trade-off: on FuseLIP, as radius goes from 4/255 to 16/255, average robust accuracy at ε=4/255 goes from 27.0% to 40.6%, and clean accuracy from 74.6% to 63.5% (Table 1). The ε=2/255 column is not monotonic: AT 12/255 is 55.3%, AT 16/255 is 52.6%.
    • The authors state that training at 16/255 on UniTok may be too large: average clean accuracy 66.7% and robust accuracy at ε=4/255 49.3%, both lower than AT 12/255's 72.8% and 51.5% (Table 2).
    • The original is not 0.0% everywhere: UniTok classification over three datasets is 0.0% at both ε=2/255 and 4/255 (Table 2). VQA original averages 6.4% at ε=4/255, with OK-VQA at 0.8% and GQA at 10.0% (Table 3). FuseLIP original OI-Crop at ε=2/255 is 7.4% (Table 1).

    Unsupervised vs. end-to-end attacks

    • Figure 1 compares unsupervised attacks with label-based end-to-end attacks on 500 Imagenette images using 100-step APGD, with ε scaled to [0, 255] on the x-axis. The text does not give curve endpoint values.
    • The authors state that in most cases unsupervised attacks are close to end-to-end attacks, worse at small ε; and that these classifiers are vulnerable to adversarial perturbations.
    • Figure 2 shows reconstructions at 2500 steps, ε=4/255 and 8/255. The authors state that TiTok's decoded images are most distorted, while FlexTok's subject remains recognizable.

    Targeted image captioning attacks

    • Victim model is UniTok-MLLM; robust tokenizer fine-tuned on ImageNet with ε=8/255. Unsupervised attack minimizes embedding distance between perturbed image and target image, ε=4/255, 2000 iterations (Figure 3).
    • Supervised attack uses APGD-CE to increase the probability of generating a specified string. Caption states ε=4/255, 2000 iterations (Figure 4). The authors categorize target descriptions as fraud, manipulation, and harassment; specific sentences are not repeated.
    • The authors state that the original generates descriptions of the target image or specified target, while the robust version still describes the original image. One place in the text writes the strength as 4/155, while the caption says 4/255.

    End-to-end fine-tuning and training data

    • Table 4's Imagenette column uses a ViT probe, ε=2/255, with APGD-CE and APGD-T from AutoAttack: original 75.8% / 0.0%; end-to-end AT 90.6% / 79.4%; unsupervised AT (ImageNet) 84.2% / 64.4%; AT (CC3M) 87.6% / 67.0%.
    • The authors state that end-to-end fine-tuning achieves the highest clean and robust accuracy on that training task, but when plugged back into FuseLIP, clean performance on OI-Pos and OI-Crop drops, which they attribute to overfitting to the training task. Table 4's retrieval column does not match Tables 5 and 7, so those retrieval numbers are not cited here.
    • The authors state that with TiTok/FuseLIP-S and 10-step APGD, training only the encoder (25.8M) takes 1.17s per sample, while supervised full-model (68M) takes 2.56s, a 2.2× training time reduction.

    Other ablations and analyses

    • Table 9: FuseLIP-S, 100-step APGD, ε=4/255: Option 1 robust accuracy 37.8%, Option 4 50.2%. The authors state Option 1 is lowest in almost all settings; at ε=2/255, Option 2 is 70.6%, lower than Option 1's 70.7%.
    • Table 10: 500 ImageNet images, 100 steps. Unsuccessful attacks still change on average 125.4 indices for FuseLIP-S and 126.0 for FuseLIP-B (out of 128) at ε=4/255. AT 8/255 and above are 0.0 in all cells of that table. The authors state that changing indices alone is insufficient for an effective attack.
    • Table 5: TiTok-S128 with FuseLIP-S, original average robust accuracy 4.4% at ε=2/255 and 0.4% at ε=4/255; AT 8/255 gives 49.7% and 33.2%, with clean average dropping from 70.2% to 67.3%.
    • Table 8: Unsupervised attack 100 steps, ImageNet-1k original UniTok is 0.0% at ε=2/255 through 16/255; AT 8/255 is 42.9% at ε=8/255 and 3.8% at ε=16/255. In the same setting, ε=2/255 is 61.7%, higher than its clean accuracy of 58.3%, which the paper does not explain.
    • Table 6 caption states that FuseLIP-S fine-tuned on CC3M vs. ImageNet-1k shows negligible differences, so they prefer the 3× smaller ImageNet-1k. Section 5, however, states that in Table 4, CC3M is slightly better than ImageNet.
    • Figure 5 caption: Unsupervised targeted attack (ε=8/255, 100 steps) changes the class of the adversarial image and its reconstruction; supervised attack changes the class of the adversarial image, while the reconstruction remains close to the original input and its class is unchanged. The robust model maintains correct predictions for both.
  5. What are some points that can be further explored?

    The authors suggest future work on the effects of VQ, FSQ, codebook size, and feature dimensionality on robustness.

    Limitations and Future Directions Noted by the Authors

    • The paper does not specifically discuss limitations; there is no separate Limitations section.
    • The Discussion and Conclusion state that future work can study how tokenizer design choices affect robustness based on the results here, and develop specialized improvements; the named choices are VQ and FSQ, codebook size, and feature dimensions (Section 6).

    Experimental Coverage

    • The adversarially fine-tuned tokenizers are TiTok-S128, TiTok-BL128, and UniTok. FlexTok appears in the attack comparison in Figure 1; Section 4 states that fine-tuning experiments use TiTok and UniTok.
    • Quantitative tasks are zero-shot classification, multimodal retrieval, and VQA; COCO description and reconstruction analysis are qualitative (Sections 4–5, Figures 2–5).
    • Perturbation constraint is ℓ∞. Classification defense evaluation uses AutoAttack, retrieval uses 100-step APGD, VQA uses the ensemble attack in Appendix A; description targeted attacks use 2000 iterations.
    • Fine-tuning is 1 epoch, updating only the encoder. Main data is ImageNet-1k, with comparison on CC3M; training radii are 4/255, 8/255, 12/255, 16/255 (Section 4, Appendix A).
    • Appendix A states that Imagenette and Caltech101 each have 500 test images; Table 10 uses 500 ImageNet images. The paper does not report the number of repetitions, nor the sample sizes for ImageNet-1k, VQA, and retrieval evaluations.
  6. Summarize the main content of the paper

    Unsupervised embedding attacks expose weaknesses in discrete tokenizers; fine-tuning only the encoder improves multi-task robust accuracy.

    The authors study the adversarial robustness of discrete image tokenizers, presenting a task-agnostic embedding attack and unsupervised adversarial training that only fine-tunes the encoder.

    • Problem: Tokenizers turn images into tokens over a finite vocabulary, which are then used by classifiers, FuseLIP, and UniTok-MLLM. The authors state that their robustness has not been studied before and that it propagates downstream.
    • Attack: Maximize the pre-quantization embedding distance within an ℓ∞ ball, without needing labels, codebook, or LLM. The same objective is used to generate training perturbations online.
    • Defense: Freeze the codebook and downstream components, fine-tune for 1 epoch on ImageNet-1k, with radii from 4/255 to 16/255. The authors state that the fine-tuned tokenizer can be directly swapped back into the original system.
    • Classification and retrieval: UniTok original has 0.0% accuracy on ImageNet-1k, Imagenette, and Caltech101 under AutoAttack ε=4/255; AT 8/255 has a three-set average robust accuracy of 50.1%, with clean average dropping from 84.1% to 77.8% (Table 2). FuseLIP original has a four-set average robust accuracy of 4.0% at ε=2/255, and AT 8/255 has 55.2% (Table 1).
    • VQA and description: UniTok-MLLM's VQA average robust accuracy at ε=4/255 goes from 6.4% to 39.4% (AT 8/255, Table 3). The authors state that under targeted description attacks, the original follows the target image or specified string, while the robust version still describes the original image (Figure 3, Figure 4).
    • Authors' conclusion: The authors state that this defense improves robust accuracy against both unsupervised and end-to-end supervised attacks, and can be applied to tasks and data not involved in fine-tuning; compared to end-to-end supervised fine-tuning, it can use unlabeled images and has a 2.2× reduction in training time. Future work could study VQ, FSQ, codebook size, and feature dimensions.

Related papers

Show 3 more papers
Read originalarxiv.org