Manuscript Offprint

arXiv:2609.15799

RAPID: A Real-Time Defense Against Unauthorized Model Distillation for Text-to-Image Services

Zihan Wang, Boheng Li, Rui Zhang, Wenshu Fan, Qingchuan Zhao, Tianwei Zhang, Hongwei Li, Guowen Xu

Zihan Wang 1^{1}, Boheng Li 2^{2}, Rui Zhang 1^{1}, Wenshu Fan 1^{1}, Qingchuan Zhao 3^{3}, Tianwei Zhang 2^{2}, Hongwei Li 1^{1}, and Guowen Xu 1,∗^{1,*}

1^{1} University of Electronic Science and Technology of China, Chengdu, China

2^{2} Nanyang Technological University, Singapore

3^{3} City University of Hong Kong, Hong Kong SAR, China

zihanwang@std.uestc.edu.cn, guowen.xu@uestc.edu.cn

Abstract—Diffusion-based text-to-image (T2I) models are increasingly used for visual content creation, making their proprietary generation capability a valuable intellectual property asset. However, this capability is vulnerable to black-box output-based distillation, where an adversary queries the service, collects prompt-image pairs, and trains an unauthorized substitute model that mimics its generation behavior. Existing perturbation-based defenses mainly protect generated images by applying sample-wise optimization, making the perturbed images disruptive to unauthorized training. Although effective, such sample-wise optimization introduces substantial computation and latency, significantly reducing the usability of online T2I services. A natural solution is to integrate the defensive perturbation into the generation process itself, such as the VAE decoder, allowing the protected model to generate defended images directly without sample-wise online optimization. However, existing sample-wise optimization designs struggle to transfer to the shared decoder setting. We empirically find that the defensive shared decoder induces a substantially smaller latent shift than sample-wise optimization, suggesting that objective reachability matters more than destructiveness in the shared decoder setting. To overcome this limitation, we propose RAPID, a self-referenced latent maximization framework that removes external dependencies and directly encourages the same model update to induce consistently disruptive effects across all training samples, thereby improving reachability. We further introduce a reconstruction-guided color regularization that blocks the latent shortcut and reinforces the visual disruption. Extensive experiments on four T2I models and four datasets, with comparisons against five representative baselines, show that RAPID consistently degrades the generation quality of the substitute model while preserving service visual fidelity. Our work establishes a paradigm for real-time protection against unauthorized distillation in deployed T2I systems.

1. Introduction

Diffusion-based text-to-image (T2I) generation has become a foundation of commercial image-generation services, with systems such as Stable Diffusion, DALL-E, Imagen,

Figure

Figure 1. Application scenario and overview of RAPID. A provider adopting RAPID can substantially degrade the generation quality of the distilled model, whereas an unprotected provider cannot.

Midjourney, and Adobe Firefly [1], [2], [3], [4], [5] achieving high-quality, controllable synthesis through large-scale diffusion modeling [6], [7], [8]. Building such systems demands substantial resources: curating and cleaning billion-scale image-text datasets [9], designing complex training pipelines, and sustaining large-scale distributed computing over extended periods. These investments make their outstanding generative capabilities valuable intellectual property.

However, there is a shortcut that avoids such substantial overhead. Existing studies on black-box model stealing and distillation show that model behavior can often be approximated through query access alone [10], [11], [12], [13]. By repeatedly querying the target service and collecting prompt-image pairs, a malicious user can train an unauthorized substitute diffusion model to imitate the victim service's prompt alignment, visual style, output distribution, subject and style handling, and specialized generation behaviors [12], [14], [15], [16]. Recent provider-facing reports also identify API-based distillation as an operational risk [17], [18]. This threat is difficult to prevent because it can be mounted through black-box access to publicly returned outputs, and the behavior of a distiller is indistinguishable from that of a normal user. Unless large-scale industrial-level distillation is performed, it is difficult to distinguish such behavior [10], [12], [17].

Recognizing this risk, major generative-AI service providers, including OpenAI, Google Gemini, Midjourney, and Stability AI, explicitly prohibit the use of generated outputs or API services for reverse engineering, developing competing services, or training competing models [19], [20], [4], [21]. However, policy restrictions alone do not technically prevent model distillation. A technical defense must reduce the training utility of the output stream collected by attackers while preserving the visual quality received by benign users.

Existing defenses against unauthorized T2I training can be broadly divided into post-verification, anomaly query detection, and preventive image perturbation. Post-verification methods, including watermarking and fingerprinting, embed detectable signals into model parameters or generated outputs so that a provider can later test whether a suspicious model or output derives from protected assets [22], [23], [24], [25], [26], [27], [28], [29]. These methods support attribution and accountability, but the defender must first observe the suspicious model or its outputs before verification becomes possible. Anomaly query detection distinguishes benign user queries from suspicious distillation-oriented queries. For example, in Anthropic's distillation-detection setting for Fable 5, queries identified as distillation attempts may be routed to a weaker model Opus 4.8 [30]. However, false positives may incorrectly flag benign queries and thereby significantly degrade the user experience [31], [32]. Although perturbation-based defenses offer direct protection for copyrighted content, they are primarily designed for offline settings involving fixed images, subjects, styles, or editing scenarios, in which each image is carefully optimized before release. Consequently, these methods typically require a separate perturbation to be learned for each image, incurring substantial computational overhead and resource consumption [33], [34], [35], [36], [37]. Such a sample-wise paradigm leads to a deployment mismatch for online services, which must protect all public outputs while preserving low latency, high throughput, and feasible GPU capacity [38], as verified in Section 4.1.

Motivated by previous work [25], a natural and effective solution is to internalize protection into the VAE decoder; this forward-pass design shifts protection from sample-wise post-processing to the deployed generation path, eliminating the online protection overhead. Nevertheless, existing sample-wise optimization designs show limited effectiveness in disrupting query-based service distillation, even though they exhibit strong disruptive capability in sample-wise offline settings, as empirically verified in our experiments. To investigate the underlying cause of this failure, we conduct a motivation study and obtain two key observations. First, under shared decoder optimization, the optimization bottleneck shifts from destructiveness to ensuring the reachability of the objective. Second, a large latent shift does not necessarily induce stronger visual disruption.

Motivated by these observations, we propose RAPID, a forward-pass protection mechanism against T2I distillation. As illustrated in Figure 1, this forward-pass design relocates the protection mechanism from sample-wise post-processing to the generative pathway of the deployed decoder. To understand why sample-wise optimization objectives exhibit poor effectiveness when adapted to a shared decoder, we examine the fundamental differences between sample-wise perturbation optimization and shared decoder finetuning. Specifically, we identify two key constraints governing the optimization process: the parameter-sharing restriction and the visual-preservation restriction. Based on these constraints, we formulate the Reachable Set as a central requirement for reachability, which comprises visually feasible shared decoder updates capable of satisfying the objective up to a prescribed threshold τ\tau. Guided by this, we further analyze two failure modes of existing methods: target dependence and stochasticity dependence. To address these limitations, we design a self-referenced objective that eliminates external dependence and better matches the shared decoder structure. Moreover, we introduce a reconstruction-guided color regularization term to avoid the latent shortcut and enhance disruption effectiveness against model distillation. Together, these designs produce perturbations that are more reachable for the shared decoder and more effective at disrupting downstream distillation.

Extensive experiments on four T2I models and four datasets, together with comparisons against five representative baselines, show that RAPID consistently degrades substitute model generation quality while preserving benign service visual fidelity. Our work establishes a new service-level paradigm for real-time protection against unauthorized distillation in deployed T2I systems. Our contributions are summarized as follows:

  • We introduce forward-pass protection for T2I distillation defense, which embeds defensive perturbations into the deployed generation pipeline through decoder finetuning, thereby eliminating the online overhead of sample-wise protection.

  • We provide a reachability analysis for shared decoder optimization by characterizing the reachable set of feasible decoder updates. This analysis motivates our self-referenced latent maximization objective. We further introduce reconstruction-guided color regularization to mitigate latent shortcuts and composite visual constraints to preserve visual quality.

  • We conduct a comprehensive evaluation on four T2I models and four datasets, together with comparisons against five representative baselines. The results show that RAPID achieves the strongest disruption across most evaluated configurations while preserving benign service visual fidelity.

References (88)