Watermarking Autoregressive Image Generation

Nikola Jovanović, Ismail Labiad, Tomáš Souček, Martin Vechev, Pierre Fernandez

TL;DR

This paper introduces the first token-level watermarking method for autoregressive image generation models by adapting large language model (LLM) watermarking techniques. To overcome the fact that re-tokenizing an image alters its token sequence (which typically destroys the watermark), the authors propose a lightweight tokenizer finetuning method alongside a post-hoc synchronization layer. The resulting framework provides robust, quality-preserving watermark detection with mathematically grounded p-values across images, text, and audio.

What Problem Does This Paper Address?

Watermarking generative AI outputs is crucial for tracking content provenance and mitigating risks like deepfakes or intellectual property violations. While generation-time watermarking is well-established for LLMs (by biasing token selection) and diffusion models, it has remained an open challenge for autoregressive image models (e.g., VQGAN-based transformers like Chameleon or RAR).

The core obstacle is the lack of Reverse Cycle-Consistency (RCC). Image tokenizers (like VQ-VAEs) are trained for forward cycle-consistency: turning pixels into tokens and back to pixels preserves image quality. However, the reverse does not hold. If you take model-generated tokens, decode them to pixels, and then re-tokenize those pixels back into tokens, the sequence changes drastically—on average, one-third of the tokens change even without any image modifications. This token drift instantly wipes out standard token-level watermarks during detection.

Overview of the watermarking pipeline for autoregressive image generation models.

Methods

The authors tackle the RCC problem with a two-pronged approach:

  1. Finetuning for RCC: To avoid the massive computational cost of retraining the autoregressive model itself, the authors keep the model's codebook and original encoder fixed. Instead, they introduce a lightweight finetuning procedure for the decoder ($D$) and a new encoder replica ($E'$) used strictly during watermark detection. They optimize these components using an RCC loss under various data augmentations (blur, noise, JPEG compression) while regularizing against the original weights to preserve visual quality.
The finetuning procedure designed to improve reverse cycle-consistency (RCC).
  1. Post-hoc Watermark Synchronization: Geometric transformations (like horizontal flips, crops, or rotations) completely scramble spatial token layouts, breaking the watermark. To fix this, the authors embed a fixed, localized 32-bit watermark pattern into the four quadrants of the generated image. During detection, a fast grid-search algorithm identifies this pattern to estimate, invert, and undo the geometric transformation before passing the image to the token-level detector.

Datasets

  • Images: The method was evaluated using ImageNet (for the Taming/VQGAN transformer and RAR-XL models) and MS-COCO validation prompts (for the multimodal Chameleon model). Tokenizer finetuning data consisted of tokens derived from 50,000 ImageNet training samples.
  • Audio: To demonstrate modality transferability, the authors extended their approach to speech generation using the VoxPopuli dataset to finetune and evaluate Moshi, a speech-text foundation model.

Key Insights and Ideas

  • The Asymmetry of Tokenization: Forward cycle-consistency does not guarantee reverse cycle-consistency. Decoded tokens often land slightly off-manifold, causing the standard encoder to map them to entirely different discrete indices upon re-tokenization.
  • Entropy is an Asset: Token entropy analysis reveals that image tokens generally exhibit higher uncertainty (broader spread and higher mean entropy) than text tokens. This inherent variance makes images uniquely well-suited for reliable token-level watermarking.
  • Periodic Spatial Entropy: Interestingly, token entropy in autoregressive image models spikes periodically—exactly at the start of each new image row (every ~32 tokens). This is caused by local context resets during raster-scan generation.
  • Cross-Modal Synergy: In multimodal models like Chameleon, text and images can be watermarked jointly. If an adversary heavily alters the text (e.g., via paraphrasing), the intact image tokens can "rescue" the detection, combining forces to yield a mathematically rigorous, low p-value.

Key Results

  • RCC Boost: Finetuning successfully increased the average Token Match (TM) from a fragile 0.66 to over 0.80 on unmodified images.
  • High Detection Power: All finetuned variants achieved a True Positive Rate (TPR) of $\approx 1$ at a 1% False Positive Rate (FPR), maintaining strong detection capabilities even under strict, low-FPR constraints.
  • Robustness to Attacks: The synchronization layer unlocked high robustness against geometric edits. For example, on horizontal flips where the baseline model's detection rate dropped to 0.01, the synchronized model maintained a TPR of 0.82. The framework also proved resilient against neural compression (e.g., Stable Diffusion and FLUX VAEs) and diffusion purification attacks.
  • Quality Preservation: The watermark is virtually imperceptible. The Fréchet Inception Distance (FID) remained stable (e.g., 16.33 for the finetuned watermarked model vs 16.70 for the unwatermarked base model).
Watermark detection performance (TPR vs. FPR) and token match improvements.

Limitations and Future Work

  • VQ-Tokenizer Dependency: The method specifically targets models that tokenize images via Vector Quantization (VQ). It is not directly applicable to autoregressive models utilizing continuous representations or hybrid diffusion-autoregressive architectures.
  • Suboptimal Synchronization Layer: The current synchronization mechanism relies on an off-the-shelf localized watermark layout (quadrants), which fails on arbitrary crops that do not preserve at least one image corner. The authors suggest integrating a custom, learned synchronization layer directly into the RCC finetuning process as a next step.
  • Combined Attacks: While robust to individual transformations, the method remains vulnerable to coordinated, combined attacks (e.g., applying a heavy removal attack to disrupt the synchronization signal followed immediately by a geometric transformation).

Summary updated

BibTeX
@inproceedings{jovanovic2025watermarking,
  author = {Nikola Jovanović and Ismail Labiad and Tomáš Souček and Martin Vechev and Pierre Fernandez},
  title = {{Watermarking Autoregressive Image Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=hVdD72iom4},
}
Figure