Vulnerability of Text-to-Image Models to Prompt Template Stealing: A Differential Evolution Approach

Yurong Wu, Fangwen Mu, Qiuhong Zhang, Jinjing Zhao, Xinrun Xu, Lingrui Mei, Yang Wu, Lin Shi, Junjie Wang, Zhiming Ding, Yiwei Wang

Introduction

In the rapidly expanding AI art ecosystem, the value of a creation often lies not just in the final image, but in the "secret sauce" used to generate it: the prompt template. Platforms like PromptBase have fostered a marketplace where creators sell meticulously crafted templates—complex strings of modifiers for lighting, texture, and style—designed to produce consistent results across various subjects.

Overview of the prompt template stealing process where an attacker reverse-engineers a proprietary template from sample images.

While previous security research focused on "prompt stealing" (reconstructing a prompt for a single image), this paper identifies a more systemic threat: prompt template stealing. This attack aims to extract the underlying stylistic framework, allowing an unauthorized user to replicate a creator's unique aesthetic across any new subject. We present EvoStealer, a framework that automates this theft with high precision and minimal cost.

Methodology: The EvoStealer Framework

EvoStealer is a "plug-and-play" attack framework that leverages Multimodal Large Language Models (MLLMs) and a differential evolution (DE) algorithm. Unlike traditional optimization methods that may overfit to a single image, EvoStealer identifies the shared "DNA" across multiple sample images to reconstruct the generalizable template.

The four-step evolutionary process of EvoStealer, including element extraction, mutation, and crossover operations.

The process consists of three primary stages:

  1. Image Element Extraction: Using MLLMs (e.g., GPT-4o or InternVL2), the system decomposes sample images into three components: the Subject, Modifiers (style, composition), and Supplements (nuanced descriptions like "radiating lines").
  2. Differential Evolution (DE): The core innovation involves iterative mutation and crossover operations. By comparing "parent" prompt sets, the system evolves "offspring" prompts that better capture the collective style of the input samples.
  3. Fitness Evaluation: Candidate templates are validated by generating new images and measuring their consistency against the original samples using a multi-metric approach (DINO, CLIP, and SigLIP).

Experimental Setup and the PRISM Benchmark

To evaluate this threat, we introduced PRISM, the first benchmark specifically designed for prompt template stealing. PRISM contains 50 high-quality templates and 450 generated images, categorized into "Easy" and "Hard" difficulty levels based on modifier complexity. Evaluation is split between "in-domain" (original subjects) and "out-of-domain" (new subjects) to test the stolen template's generalization capabilities.

Key Results and Insights

Our evaluation demonstrates that EvoStealer significantly outperforms existing baselines like CLIP Interrogator and PromptStealer, showing an average performance boost of over 10% on the PRISM benchmark.

  • Generalization: Stolen templates performed nearly as well on entirely new subjects as they did on the original samples, confirming that the attack successfully extracts the stylistic framework rather than just copying specific image details.
  • Cost-Effectiveness: A complex template can be stolen for approximately $1.70 in API fees—significantly less than the typical $3–$9 market price.
  • Model Agnostic: The attack is effective using both proprietary models like GPT-4o and open-source alternatives like InternVL2-26B.
  • The Role of Supplements: The inclusion of a flexible "Supplements" module to capture non-standard stylistic nuances was found to be critical for high-fidelity reconstruction.

Conclusion and Future Work

EvoStealer highlights a critical vulnerability in the AI creator economy. While the system currently faces challenges with extremely niche historical art styles and text rendering, its success suggests that "security through obscurity" is no longer a viable protection for prompt templates. Potential defenses include limiting the number of publicly visible sample images on marketplaces to 2–4, as the evolutionary approach thrives on larger sample sets to identify shared stylistic traits.

Summary updated

BibTeX
@inproceedings{wu2025vulnerability,
  author = {Yurong Wu and Fangwen Mu and Qiuhong Zhang and Jinjing Zhao and Xinrun Xu and Lingrui Mei and Yang Wu and Lin Shi and Junjie Wang and Zhiming Ding and Yiwei Wang},
  title = {{Vulnerability of Text-to-Image Models to Prompt Template Stealing: A Differential Evolution Approach}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure