Skip to content

When scene text hijacks the image: Revealing, exploiting, and mitigating semantic leakage of rendered text in image generation modelsWhen Scene Text Hijacks the Scene: Uncovering, Exploiting, and Mitigating Rendered-Text Semantic Leakage in Image Generation Models

arXiv· arXiv:2610.11286· Feifei Li, Runjie Wang, Xiaohan Zhang, Zhenxing Qian, Mi Wen, Mi ZhangFudan University; Shanghai University of Electric PowerIndexed by this site · 25 days ago· Originally publishedAttacks

Quick read

Attacks

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

The authors state that image generation models leak the semantics of text to be rendered into non-text regions, and on this basis propose rendered text injection (RTI); after GPT-5.4 rewriting, the unsafe rate of RTI prompts is still 87.5%.

Threat modelThe attacker has ordinary user-level access to an image generation model that supports open-domain text rendering, and can specify the main visual prompt ym, rendering constraints yc, and rendered text yr, but cannot modify model parameters, training data, safety modules, prompt enhancement modules, or the inference pipeline; the goal is to make the target semantics in yr appear in non-text regions Rt̄(x) while keeping ym benign and compliant.

Questions
Modern image generation models support specifying in the prompt text to be rendered into the image; the authors state that the semantics of this text leak into non-text regions, becoming a hidden control channel that can carry violating semantics, while existing safety evaluations mainly focus on direct harmful prompts.
Methods
The authors decompose a text rendering request into a main prompt, rendering constraints, and rendered text, measure leakage using OCR masking plus two types of metrics, NSL and GSL, then use closed-loop agent search for rendered-text injection (RTI), and perform embedding ablation and selective semantic masking mitigation on FLUX-2-dev.
Experiments and results
All six models had positive NSL on TSL-60, with Max-GSL 0.689–0.962; GPT-5.4 rewriting reduced PUR for directly harmful prompts by an average of 57.3 percentage points, but reduced RTI by only 10.8 percentage points, and the image-level UR after rewriting was still 52.5%; the white-box mask reduced the RTI leakage rate of FLUX-2-dev from 97.5% to 65.0%.
Limitations and future work
The authors state that closed-loop agent evaluation is computationally expensive and that evaluating alternative agent backbones is left for future work; the mitigation is only a preliminary proof of concept, with a residual leakage rate of 65.0%, and was evaluated only on FLUX-2-dev. Among commercial models, only GPT-Image-2 and Nano-Banana-2 were tested, and RTI allows at most two agent attempts per target.
Experimental setupFLUX-2-dev、Qwen-Image et al. · TSL-60、RTI-Safety et al. · WR、NSL et al.
Evaluated models
FLUX-2-devQwen-ImageZ-Image-TurboLongCatGPT-Image-2Nano-Banana-2SDXLSD3FLUX-1-devBagelJanus-Pro-7B
Benchmarks
TSL-60RTI-SafetyCVTG-2K (CVTG100)TextInVision (TIV100)NSFW-INSFW-EUL-4chanI2P-SI2P-D
Metrics
WRNSLAvg-GSLMax-GSLPURURLRCLIPScore
AI summaryResearchers reveal a phenomenon of semantic leakage of rendered text in image generation models: scene text that should be reproduced verbatim also carries linguistic semantics, which may be treated by the model as part of the input instructions, becoming a hidden semantic control channel. Against the backdrop of image generation models such as Nano Banana and GPT-Image that support complex instructions and scene text rendering, the team decouples the main visual prompt from the rendered text, quantifies the degree of semantic leakage and rendering fidelity, and analyzes the causes of leakage using intermediate evidence from the models. The study shows that harmful semantics embedded in scene text can penetrate LLM-based prompt enhancement pipelines while the main visual prompt remains harmless, guiding the generation of non-text regions of the image. Based on this, the authors propose a preliminary mitigation method that reduces the transfer of unsafe semantics from rendered text to non-text regions on FLUX-2-dev while preserving the intended text rendering behavior, and point out that rendered text is a dual carrier of visible data and latent semantics, constituting a text-centric cross-modal attack surface.

Researchers reveal a phenomenon of semantic leakage of rendered text in image generation models: scene text that should be reproduced verbatim also carries linguistic semantics, which may be treated by the model as part of the input instructions, becoming a hidden semantic control channel. Against the backdrop of image generation models such as Nano Banana and GPT-Image that support complex instructions and scene text rendering, the team decouples the main visual prompt from the rendered text, quantifies the degree of semantic leakage and rendering fidelity, and analyzes the causes of leakage using intermediate evidence from the models. The study shows that harmful semantics embedded in scene text can penetrate LLM-based prompt enhancement pipelines while the main visual prompt remains harmless, guiding the generation of non-text regions of the image. Based on this, the authors propose a preliminary mitigation method that reduces the transfer of unsafe semantics from rendered text to non-text regions on FLUX-2-dev while preserving the intended text rendering behavior, and point out that rendered text is a dual carrier of visible data and latent semantics, constituting a text-centric cross-modal attack surface.

Related events and news

0 events · 1 news mentions

News that mentions this paper

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors state that the semantics of the text to be rendered leak into non-text regions, constituting an overlooked cross-modal attack surface.

    Core problem: In image generation models, the semantics of text specified to be "rendered into the image" leak outside the text region and affect the entire scene, and the safety implications of this phenomenon have not been systematically studied.

    • Problem setting: A new generation of IGMs (such as Nano Banana, GPT-Image) writes rendered text directly in the natural language prompt (enclosed in quotation marks), and the model may parse its linguistic meaning while planning the image; the authors call this rendered-text semantic leakage.
    • Why it matters: Existing safety research mainly focuses on the risk of directly requesting harmful content; the authors state that rendered text can serve as a hidden semantic carrier, allowing violating semantics to bypass defenses targeting direct prompts.
    • Gaps in existing research: The authors state that text rendering research mainly asks whether models can accurately reproduce text, and few study whether the semantics of the text can manipulate non-text regions; existing safety benchmarks also rarely evaluate text rendering scenarios.
    • Core observation: To satisfy the rendering instruction, the system preserves the rendered text verbatim, yet the model still interprets its semantics—Figure 1 shows that prompt enhancement cleanses violating semantics from direct requests but preserves the same semantics in rendered text.
    • Contributions of the paper: The authors propose a leakage measurement framework (NSL/GSL), an evaluation of the rendered-text injection (RTI) attack, mechanistic analysis, and a preliminary white-box mitigation on FLUX-2-dev.
    • Threat model (Sec. 3.2):
      • Attacker goal: Embed the target semantics in yr while keeping ym benign, and induce these semantics to appear in non-text regions Rt̄(x).
      • Knowledge: Ordinary user-level access to IGMs that support open-domain text rendering.
      • Capabilities: Can specify ym, yc, yr; cannot modify model parameters, training data, safety modules, prompt enhancement modules, or the inference pipeline.
      • Victim system: Image generation models that support open-domain text rendering; the defender is considered in two settings: black-box (the platform, which can only intervene on the input side) and white-box (the model owner, who can intervene in internal representations and denoising dynamics).
  2. What related research exists?

    Related work covers text rendering, semantic binding, and T2I attacks and defenses; the authors state that rendered text as a semantic control channel has not yet been studied.

    Text rendering in image generation

    • Early specialized pipelines: TextDiffuser (2023), AnyText (2024), etc. improve rendering fidelity by treating text as a dedicated local generation target through character-level masks, glyph/position conditions, or LLM-predicted layouts.
    • Native rendering capability: Recent general-purpose IGMs (FLUX-2, Qwen-Image, etc.), with stronger backbones, language encoders, and alignment techniques, have made text rendering a native capability; the authors point out that this paper studies the safety implications of rendered-text semantic leakage under this setting.

    Semantic binding in text-to-image generation

    • Compositional generation failure: GenEval (2023), T2I-CompBench (2023), etc. discuss semantic binding failure, i.e., the model generates concepts but cannot bind them to the correct attributes, relations, or spatial roles.
    • Mechanistic studies: DAAM (2023) uses cross-attention to analyze token-region correspondence in U-Net diffusion models; subsequent work extends this perspective to MM-DiT.
    • Closest work: [47] (ICLR 2025) shows that text generation can be attributed to and controlled by a small set of attention layer parameters; the authors point out that prior text rendering work mainly studies position-level binding of strings and carriers, whereas this paper studies natively rendered text as an additional semantic control channel.

    Attacks and defenses in image generation

    • Multi-layer defenses: input-side detection/rewriting (e.g., Latent Guard 2024, ChatGPT Images system card), model-level concept erasure or fine-tuning (Safe Latent Diffusion 2023, MACE 2024, etc.), output-side safety checkers and VLM moderation (LlavaGuard 2024, UnsafeBench 2024).
    • Red-team attacks: prompt-level substitution/decomposition of sensitive concepts (SneakyPrompt 2024, MMA-Diffusion 2024, SurrogatePrompt 2024, etc.); white-box/gray-box attacks that optimize embeddings or recover erased concepts (Ring-a-Bell 2024, etc.); and newer attack surfaces such as multi-turn interaction jailbreaks (2025), attribute misbinding in identity-preserving generation (2026), and adversarial image attacks (AdvI2I 2025).

    Baselines and benchmarks: RTI is compared against five directly harmful prompt benchmarks—NSFW-I, NSFW-E (both derived from NSFW-56K), UL-4chan (Unsafe Lexica-4chan), I2P-S, and I2P-D (I2P subsets)—each sampled at 120 prompts and compared through the same GPT-5.4 rewriting process.

    Positioning: The authors state that text rendering introduces a unique attack condition—rendered text is explicitly required to be reproduced verbatim—and existing safety benchmarks rarely evaluate its risk; according to the authors, this paper is the first systematic study of rendered-text semantic leakage in modern IGMs.

  3. How does the paper address this problem?

    Decompose the prompt, measure leakage with OCR masking plus two metrics, search RTI with an agent closed loop, then perform mechanistic analysis and white-box masking mitigation.

    Overall approach: decompose the text rendering request into three parts, use OCR masks to isolate non-text regions, measure leakage with a counterfactual normalized metric (NSL) and a goal-driven metric (GSL), then use an agent closed loop to adaptively search for rendered text injection (RTI), and finally apply selective semantic masking for mitigation based on mechanistic findings.

    Problem Formulation

    • The text rendering prompt is decomposed into the main visual prompt ym, rendering constraints yc, and rendered text yr (Figure 2); the generated image is divided into the rendered text region Rt(x) and the non-text region Rt̄(x).
    • The ideal behavior is that yr only guides text rendering within Rt(x); leakage is the semantic influence of yr on Rt̄(x).

    Benchmark Construction (TSL-60)

    • Main prompt dataset: from CVTG-2K scene-carrier templates (2,375 pairs after deduplication), TextInVision real templates (1,418 single-text entries), and 6 synthetic templates; 72 templates were finally selected (45 scene-carrier, 21 real, 6 synthetic).
    • Target pool: 60 verifiable manipulation targets, 30 local (entity presence, attribute binding, counting, spatial relations, object interaction) + 30 global (scene setting, visual style, global appearance, camera framing), i.e., D1–D9 (Table 3).
    • Wording and compatibility: Each target is verbalized in three forms (visual description, image-level statement, imperative instruction); high/low compatibility contexts are sampled by CLIP similarity from the top and bottom thirds of candidate main prompts. 6 requests per target (3 wordings × 2 compatibility levels), 360 requests/model in total.

    Leakage Measurement

    • OCR masking: PP-OCRv5 detects text regions; Gaussian blur is applied first, and if still readable, mean-color block replacement is used; all measurements are performed on Rt̄(x).
    • NSL: NSL(yrk) = DTSL(yrk|yk) − 1/(|Bk|)∑j ∈ Bk sim(yrk, Rt̄(xj)), i.e., the direct CLIP similarity minus a counterfactual baseline sharing the same ym and yc (including pseudowords and neutral text, |B^k|=2), removing the benign alignment of the scene itself.
    • GSL: GSL(x, yr|g) = 1/M∑m s(qm, Rt̄(x)), the average of soft yes/no scores given by a VQA judge (Qwen3-VL-32B) for two verification questions; GSL > 0.5 is judged as successful leakage. This threshold was manually verified: precision 97.41%, recall 82.06% (Appendix A.2.1).
    • For each target, Avg-GSL (average over 6 variants) and Max-GSL (best-of-6, measuring hijacking potential) are reported.

    RTI Automated Search (Figure 7)

    • The agent (backbone Qwen3-30B) executes construction, verification, generation, evaluation, and reflection in a closed loop; the action space is limited to request construction (modifying ym/yc/yr) and cannot modify the generator or evaluator.
    • Pre-generation verification: The main prompt is verified with the rendered text slot left empty; any request that explicitly mentions the target, target attributes, or semantic proxies is rejected, ensuring that the target semantics enter only through yr.
    • Post-generation reflection: Centered on three diagnostic modes—over-interpretation (text rendering succeeds but the semantics are also materialized), misbinding (the target word is not rendered but appears in the image), mutual interference (text rendering corruption coexists with semantic transfer); attempts that remain readable after rendering are judged invalid.
    • In RTI-Safety, each target allows at most two agent attempts (bounded adaptive search).

    Mechanistic Analysis and Mitigation

    • Analyze the prompt encoder of FLUX-2-dev (three intermediate layers each contribute 5120 dimensions, 15360 dimensions in total) and the denoising trajectory.
    • Selective semantic masking: Locate key rendered-text embedding dimensions through embedding ablation, mask them during the first 20 denoising steps (basis: DTSL peaks at step 20 and WR stabilizes only around step 30, Figure 19), then restore them to preserve glyph rendering.
    • Also discuss a black-box direction: leakage-aware prompt rewriting (QR-SL variant).
  4. What experiments did the paper conduct?

    All six models exhibited leakage; after RTI rewriting, PUR was 87.5% and UR 52.5%, and the white-box mask reduced the leakage rate to 65.0%.

    Experimental Setup

    • Models tested: open-source FLUX-2-dev, Qwen-Image, Z-Image-Turbo, LongCat (selected from 9 candidates by OCR word recall in a 200-sample pilot, Figure 4); commercial GPT-Image-2, Nano-Banana-2.
    • Benchmarks: TSL-60 (60 targets × 6 requests = 360 requests/model); RTI-Safety (120 injected prompts, at most 2 agent attempts per target); controls are 5 direct harmful prompt benchmarks with 120 each.
    • Metrics: WR (OCR word recall), NSL, Avg/Max-GSL; safety experiments use PUR (prompt-level unsafe rate) and UR (image-level unsafe rate).
    • Evaluation method: GSL is scored by Qwen3-VL-32B with threshold 0.5; PUR is counted if either LlamaGuard or zero-shot Qwen3-8B judges it unsafe; UR is counted if either LlavaGuard or NudeNet flags it.
    • Human agreement: at GSL threshold 0.5, precision 97.41%, recall 82.06% (2,880 human ratings); agreement between the image safety evaluator and two annotators is 81.6%/79.1%, inter-annotator agreement 78.6% (560 images).
    • Generation settings: 1024×1024 resolution, default inference parameters for each backend; the paper does not report the number of repetitions.

    Main Results

    Table 4: benign rendered text leakage on TSL-60 (WR/NSL/Avg-GSL/Max-GSL).

    Swipe horizontally to read the table

    ModelWR ↑NSL ↑Avg-GSL ↑Max-GSL ↑
    FLUX-2-dev0.5560.0780.6440.918
    Qwen-Image0.5730.0690.5350.893
    Z-Image-Turbo0.7370.0610.3790.755
    LongCat0.7400.0550.3820.689
    GPT-Image-20.9210.0600.7270.962
    Nano-Banana-20.9430.0520.6690.955
    • The authors state that NSL is positive for all models (0.052–0.078), indicating the leakage is not an artifact caused by background or templates; four models exceed the 0.5 threshold on Avg-GSL.
    • Target-level leakage rate (best-of-6, Table 5): FLUX-2-dev 95.0%, Qwen-Image 91.7%, GPT-Image-2 and Nano-Banana-2 both 98.3%, six-model average 88.9%; the base control (Figure 9) shows Base-GSL does not exceed 0.5 for any.
    • The authors state the leakage cannot be attributed to rendering failure: in strong-leakage cases of commercial systems, the average normal rendering rate of target words is 0.92, showing an over-interpretation pattern.

    RTI and LLM Rewriting (RQ3)

    • What was tested: comparison of the sanitization effect of GPT-5.4 rewriting on direct harmful prompts versus RTI prompts (Table 7, Table 8).
    • Results: on direct harmful benchmarks, PUR drops on average from 100.0% to 42.7% (a drop of 57.3 percentage points); RTI only drops from 98.3% to 87.5% (a drop of 10.8 percentage points). Image-level UR: conventional benchmarks average 28.8%–39.0% (overall mean 34.5%), RTI reaches 52.5%, and is higher on each of the four open-source models.
    • Authors' interpretation: rewriting is effective against direct instructions but very weak at semantic sanitization of embedded rendered text; the authors state this reflects the utility–safety tension of preserving visible strings.

    Mechanism and Mitigation

    • Embedding ablation (Table 13, FLUX-2-dev): keeping only the third embedding block gives ∆WR=-0.093, better than keeping only the first block (-0.569) or the second block (-0.320); zeroing out the third block gives ∆WR=-0.190, on which basis the authors state that rendered text semantics are mainly concentrated in the final prompt representation.
    • Denoising trajectory: the authors state that scene-level semantic content appears before glyphs become discernible, and the semantic transfer occurs in the early scene-formation stage.
    • Selective semantic masking (Table 9, first 20 steps of FLUX-2-dev): on RTI-120, LR drops from 97.5% to 65.0%, Avg.GSL drops from 0.950 to 0.656, WR 0.764→0.771; on TIV100/CVTG100, CLIPScore is almost unchanged (0.371→0.372, 0.348→0.340), WR drops to 0.950/0.867.

    Other Ablations and Analyses

    • Target dimensions (Table 5): entity presence, attribute binding, object interaction, scene setting, and global appearance have high leakage rates; counting, spatial relations, and camera framing are lower or vary by model; the direct-prompt control success rate is 96.9% (Table 6), on which basis the authors state the targets themselves are within model capability.
    • Wording and compatibility (Figure 15): leakage exceeds the threshold under all three wordings, and prompt-like wording has the highest average among open-source models; high-compatibility context consistently amplifies best-attempt leakage.
    • Search ablation (Table 12, mean UR): removing iterative search drops from 52.5% to 37.9% (GR vs NS-GR); removing GPT-5.4 rewriting raises it to 74.2%; Qwen3-30B rewriting (QR) 80.4%, and the leakage-aware variant QR-SL is still 72.5%.
    • Lexical leakage analysis: QR-SL's lexical leakage rate is 47.5%, 30.0 percentage points lower than QR's 77.5%, but the authors state that unsafe generations still exist in large numbers.
    • Runtime overhead (Table 11): one full generation+evaluation averages 90.0 seconds, of which generation is 62.4 seconds; across backends it ranges from 45.6 seconds for Z-Image-Turbo to 152.1 seconds for FLUX-2-dev.
  5. What are some points that can be further explored?

    The authors state that evaluation is costly and the mitigation is only preliminary and single-model; the experiments cover six models and a self-built benchmark.

    Limitations and future directions noted by the authors

    • Computational cost (Sec. 7): The authors state that closed-loop agent exploration is far more expensive than single-pass text-to-image generation; Appendix A.3.1 analyzes the overhead of different generation backends and agent backbones.
    • Agent backbone (Sec. 7): A systematic evaluation of alternative agent backbones and their cost-effectiveness trade-offs is left for future work.
    • Mitigation is only preliminary (Sec. 7): Selective semantic masking reduces the RTI leakage rate of FLUX-2-dev from 97.5% to 65.0%, leaving substantial residual leakage; the single-model evaluation is only a proof of concept for partial mitigation.
    • Directions for improving mitigation (Sec. 7): Future work could explore attention-guided interventions that limit semantic transfer while avoiding grid-like artifacts and glyph distortion.
    • Broader directions (Sec. 7): The authors hope to promote leakage-aware evaluation, semantic attribution, and safety mechanisms that preserve text rendering capability while preventing unintended semantic transfer.

    Experimental coverage

    • The models tested were 4 open-source (FLUX-2-dev, Qwen-Image, Z-Image-Turbo, LongCat) + 2 commercial systems (GPT-Image-2, Nano-Banana-2), 6 in total; another 5 open-source models participated only in the pilot screening of rendering capability.
    • Leakage was measured on TSL-60 (60 targets, 360 requests per model); RTI-Safety allows at most 2 agent attempts per target.
    • White-box mechanistic analysis and mitigation were done only on one model, FLUX-2-dev; the benign utility check of the mitigation used TIV100 and CVTG100.
    • The rewriting experiment tested only two rewriters, GPT-5.4 and Qwen3-30B; image safety judgment used a combined rule of LlavaGuard and NudeNet.
    • The paper does not report the number of repeated generations per condition; images were all generated with each backend's default inference settings.
  6. Summarize the main content of the paper

    The authors state that rendered text is a hidden control channel that can carry violating semantics, that all six models leak, and that rewriting defenses have limited effect on it.

    An empirical study of a novel attack surface in image generation models: the authors state that the semantics of text specified to be "rendered into the image" cross the text region and affect the entire scene (rendered-text semantic leakage), and can be exploited as rendered-text injection (RTI).

    • Problem: Modern IGMs write rendered text in natural language prompts; to preserve fidelity, the system keeps it verbatim, yet the model still interprets its semantics; the authors state that this makes rendered text a dual-use carrier of visible data and latent semantics.
    • Method: Decompose the request into a main prompt, rendering constraints, and rendered text; after OCR-masking non-text regions, measure with counterfactually normalized NSL and VQA-target-driven GSL; a closed-loop agent (Qwen3-30B) adaptively searches for RTI under attribution constraints; and perform embedding ablation and selective semantic masking over the first 20 steps on FLUX-2-dev.
    • Main results:
      • All six models had positive NSL on TSL-60 (0.052–0.078), Max-GSL 0.689–0.962, and target-level leakage rates up to 98.3% (GPT-Image-2, Nano-Banana-2, Table 4, 5).
      • GPT-5.4 rewriting reduced PUR for directly harmful prompts by an average of 57.3 percentage points, but reduced RTI by only 10.8 percentage points (residual 87.5%); after rewriting, RTI image-level UR was 52.5%, 18.0 percentage points higher than the average of the regular benchmarks (Table 7, 8).
      • In strong-leakage cases of commercial systems, the normal rendering rate of the target words averaged 0.92, which the authors call an over-interpretation pattern.
      • The white-box mask reduced the RTI leakage rate of FLUX-2-dev from 97.5% to 65.0%, with CLIPScore almost unchanged on benign benchmarks (Table 9).
    • Authors' conclusion: As text rendering becomes a native capability of general-purpose image generators, evaluating only direct prompt semantics is insufficient to understand model behavior and safety; the authors state that the mitigation is still a preliminary proof of concept with substantial residual leakage, and they reported the RTI behavior to OpenAI and Google (no substantive reply as of 2026-09-15).
Read originalarxiv.org