Safe-VAR: Safe Visual Autoregressive Model for Text-to-Image Generative Watermarking

Ziyi Wang, Songbai Tan, Gang Xu, Xuerui Qiu, Hongbin Xu, Xin Meng, Ming Li, Fei Richard YuarXiv 2025 · DOI

Abstract

Safe-VAR is the first watermarking framework specifically designed for Visual Autoregressive (VAR) models. By employing an adaptive scale selection strategy and a mixture-of-experts fusion mechanism, it embeds invisible watermarks that are significantly more robust and higher quality than existing methods designed for diffusion models.

1. Introduction

As text-to-image generation shifts from parallel diffusion-based architectures toward sequential autoregressive (AR) models—similar to Large Language Models (LLMs)—new security challenges emerge. Existing invisible watermarking techniques, optimized for the parallel nature of diffusion, struggle with the multi-scale, sequential generation process of VAR models.

A primary challenge is the "Goldilocks" problem of scale selection. In autoregressive generation, the 'scale' is essentially 'time'; injecting watermarks at the wrong 'time' leads to either degraded image quality or fragile watermarks. Since image and watermark complexities vary, a static injection strategy is insufficient. Safe-VAR addresses this by dynamically selecting optimal scales for watermark embedding, ensuring a balance between invisibility and robustness.

2. Methodology

Safe-VAR introduces three core components to handle scale selection and feature fusion:

  • Adaptive Scale Interaction Module (ASIM): ASIM dynamically analyzes the complexity of the cover image and the watermark to select the top-$k$ optimal resolution scales (typically 4 out of 14) for embedding.
  • Cross-Scale Fusion Module (CSFM): This module utilizes Mixture-of-Heads (MoH) and Mixture-of-Experts (MoE) to merge watermark and image features. MoH captures both shared and scale-specific features, while MoE uses specialized sub-networks to ensure efficient information flow.
  • Fusion Attention Enhancement Module (FAEM): A final refinement stage using spatial and channel attention to emphasize critical information before decoding the final watermarked image.
The Safe-VAR architecture, featuring the Adaptive Scale Interaction Module (ASIM), Cross-Scale Fusion Module (CSFM), and Fusion-Attention Enhancement Module (FAEM).

The system undergoes a two-stage training process: initial training at 256x256 resolution, followed by fine-tuning at higher resolutions (up to 1024x1024) to maintain effectiveness across scales.

3. Experiments and Results

The model was trained on 200,000 images from the LAION-Aesthetic dataset and evaluated using LAION-Aesthetic, LSUN-Church, and ImageNet. Graphical logos from Logo-2K served as watermarks. To test generalization, the authors also evaluated the framework on QR Codes, which require high precision to remain scannable.

Safe-VAR establishes a new state-of-the-art (SOTA) across several key dimensions:

  • Visual Quality: At 1024x1024 resolution, Safe-VAR achieved a PSNR of 32.526, significantly higher than Safe-SD (24.586) and Stable Signature (25.326).
  • Watermark Fidelity: Recovered watermarks show high structural similarity (SSIM of 0.980), outperforming previous methods (~0.90).
  • Robustness: The watermarks remain recoverable even under severe attacks, such as 30% cropping, 40-degree rotation, or heavy JPEG compression (quality=50).
  • Generalization: Safe-VAR successfully watermarks complex structures like QR codes without compromising their functionality.
Qualitative comparison of Safe-VAR against existing methods (HiDDeN, Baluja et al., and Safe-SD), showing superior image quality and watermark recovery.

The success of Safe-VAR stems from its "structural binding" approach. By embedding watermarks into the multi-scale residual maps of the VAR model's VQVAE, the watermark becomes intrinsically linked to the image structure, making it much harder to remove via simple image processing.

4. Conclusion

Safe-VAR demonstrates that adaptive, multi-scale injection is critical for watermarking autoregressive generative models. While the current implementation is specific to the VAR architecture and introduces some computational overhead due to the MoE and attention modules, it provides a robust foundation for securing the next generation of sequential image generators. Future work may extend these principles to video autoregressive models, where temporal consistency adds further complexity.

Summary updated

BibTeX
@misc{wang2025safe,
  author = {Ziyi Wang and Songbai Tan and Gang Xu and Xuerui Qiu and Hongbin Xu and Xin Meng and Ming Li and Fei Richard Yu},
  title = {{Safe-VAR: Safe Visual Autoregressive Model for Text-to-Image Generative Watermarking}},
  year = {2025},
  eprint = {2503.11324},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.11324},
}
Figure