Skip to content

Vision-language models can aggregate scattered training image patchesVLMs Can Aggregate Scattered Training Patches

arXiv· arXiv:2506.03614· NeurIPS 2025· Zhanhui Zhou, Lingjie Chen, Chao Yang, Chaochao LuShanghai Artificial Intelligence LaboratoryIndexed by this site · 25 days ago· Originally publishedSelected AttacksSelectedAttention39

Quick read

Attacks

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

The authors propose the visual stitching capability: after fine-tuning on image fragments sharing text, VLMs can aggregate information, and the authors state this can bypass data moderation to inject harmful knowledge.

Threat modelThe attacker cuts harmful images into seemingly harmless patches, pairs them with arbitrarily chosen text (e.g., safe/unsafe), and scatters them into fine-tuning data, bypassing sample-level moderation such as the OpenAI Moderation API; the victim system is an open-source VLM, which at inference time, given the full image or a text reference, outputs the attacker-specified description.

Questions
Removing harmful samples from training data is a common practice for reducing VLM risk, but the authors claim that cutting harmful images into seemingly harmless small patches, pairing them with arbitrary text, and scattering them into the training set can bypass sample-level data moderation and let the VLM reconstruct harmful associations at inference time.
Methods
The authors define visual stitching as the ability of a VLM to aggregate visual information across multiple training samples that share the same text description; using 3 datasets of 20 images each, paired with unique synthetic IDs and cut into (patch, ID) at different granularities for fine-tuning, they measure image-based and reference-based two-level stitching by the mean rank of the correct text, then use 20 harmful images paired with safe/unsafe text to simulate poisoning.
Experiments and results
The authors report: for most open-source VLMs, image-based stitching is close to zero rank, while reference-based stitching is non-trivial but unreliable; with 8x8 splitting, only 9% of harmful image patches are flagged by the OpenAI Moderation API; Qwen2-VL-7B, after fine-tuning on the filtered patches, can still describe harmful images or their text references as the attacker-specified safe/unsafe at a level above random (Figure 7).
Limitations and future work
The authors note: only open-source VLMs were evaluated; the attack demonstration is a proof of concept rather than a complete attack framework; stitching behavior is sensitive to random seeds and learning rate and fluctuates greatly during training. Experimentally, each dataset has only 20 images, there are only 20 harmful images, and the paper does not report attack success rates at the sampling level.
Experimental setupQwen2-VL-2B、Qwen2-VL-7B et al. · food(20 张,来自 Food101)、animal(20 张,来自 ImageNet) et al. · mean rank(正确文本在候选中的平均排名,越低越好)、patch evasion rate
Evaluated models
Qwen2-VL-2BQwen2-VL-7BQwen2-VL-72BQwen2.5-VL-3B-InstructQwen2.5-VL-7B-InstructQwen2.5-VL-72B-Instructgemma-3-4b-ptgemma-3-12b-ptgemma-3-27b-ptLlama-3.2-11B-VisionLlama-3.2-90B-Visionllava-1.5-7b-hfllava-1.5-13b-hfllava-v1.6-vicuna-7b-hfllava-v1.6-vicuna-13b-hfInternVL3-1BInternVL3-8BInternVL3-14B
Benchmarks
food(20 张,来自 Food101)animal(20 张,来自 ImageNet)landmark(20 张,来自 Pexels)20 张危险图像(10 张 sex 相关来自 MultiTrust,10 张 violence 相关来自恐怖电影)
Metrics
mean rank(正确文本在候选中的平均排名,越低越好)patch evasion rate
AI summaryand selection rationaleResearchers propose the concept of visual stitching, referring to a VLM's ability to aggregate visual information scattered across multiple training samples that share the same text description. The authors used three datasets—food, animal, and landmark—each containing 20 images and synthetic IDs, split into 4, 16, and 64 patches, and fine-tuned open-source models including Qwen2-VL, InternVL3, LLaVA, Gemma-3, and Llama-3.2-Vision. Most models performed strongly on stitching under image conditions, but were markedly less stable under text-referential conditions; medium-scale models of about 10B parameters performed best overall, and with 8-way splitting most models were close to random on food and animal. The authors then split 20 hazardous images into patches and paired them with safe or unsafe text for a poisoning demonstration; under 8x8 splitting, only 9% of patches were flagged by the OpenAI Moderation API, and after fine-tuning on the remaining patches, the models would describe the original image or related referents according to the adversarial text.

Researchers propose the concept of visual stitching, referring to a VLM's ability to aggregate visual information scattered across multiple training samples that share the same text description. The authors used three datasets—food, animal, and landmark—each containing 20 images and synthetic IDs, split into 4, 16, and 64 patches, and fine-tuned open-source models including Qwen2-VL, InternVL3, LLaVA, Gemma-3, and Llama-3.2-Vision. Most models performed strongly on stitching under image conditions, but were markedly less stable under text-referential conditions; medium-scale models of about 10B parameters performed best overall, and with 8-way splitting most models were close to random on food and animal. The authors then split 20 hazardous images into patches and paired them with safe or unsafe text for a poisoning demonstration; under 8x8 splitting, only 9% of patches were flagged by the OpenAI Moderation API, and after fine-tuning on the remaining patches, the models would describe the original image or related referents according to the adversarial text.

Why it was selectedThe paper locates the failure point of multimodal data moderation at the level of individual image patches and provides a reproducible poisoning pipeline on open-source VLMs, suitable as a reference for teams evaluating training data filtering.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The authors claim that VLMs can stitch together image fragments that share a text description, allowing harmful data cut into patches to bypass sample-level moderation.

    Core problem: data moderation that removes harmful (image, text) samples from training data can be bypassed by the simple method of cutting harmful images into seemingly harmless small patches and scattering them into the training set, and the VLM may stitch these fragments back together on its own during training.

    • Problem setting and importance: VLMs are trained on large-scale web data, which may contain harmful content; the authors say one mitigation is to remove harmful samples, but patch-level fragments are often not flagged by moderation tools, and the model may still internalize harmful facts (Section 1).
    • Shortcomings of existing methods: the authors say even state-of-the-art moderation models cannot reliably identify samples that are harmless individually but together imply a harmful fact (Section 2); prior OCR-related work only discussed a hypothetical threat model and did not give a practical attack.
    • Core observation: the authors define the capability underlying this attack as visual stitching—the VLM aggregating visual information scattered across multiple training samples that share the same text description; it both aids generalization and makes the knowledge the model acquires hard to monitor.
    • Paper contributions: define visual stitching; build three benchmark datasets, food, animal, and landmark; evaluate two-level stitching capability on multiple open-source VLMs; use 20 harmful images to simulate poisoning and demonstrate the risk of bypassing moderation (Section 1 contribution list).
    • Threat model (Section 1, 2, 5):
      • Goal: make the VLM acquire and generate harmful associations, e.g., describing a bloody scene as safe.
      • Knowledge: the paper does not explicitly use terms such as white-box/black-box; the setting is that the attacker can inject samples into the fine-tuning data.
      • Capability: cut harmful images into patches and arbitrarily choose the paired text description (e.g., safe/unsafe).
      • Victim system: the fine-tuned VLM; the defender is sample-level moderation tools such as the OpenAI Moderation API and ShieldGemma-2.
  2. What related research exists?

    Related work falls into three groups: out-of-context reasoning, VLM adversarial attacks and data poisoning, and data moderation; the authors claim this is the first work to give a practical threat model.

    Out-of-context reasoning (OCR)

    • Berglund et al. (2024)'s reversal curse, Allen-Zhu & Li (2023)'s knowledge manipulation, etc.—studying language models applying knowledge learned in training to tasks not explicitly given in the training set or context, such as answering "John Doe speaks Japanese" from "John Doe is from Tokyo".
    • Treutlein et al. (2024)'s inductive OCR (connecting the dots)—language models inferring latent information from textual evidence scattered across training samples and using it for downstream tasks, for example stating that an unknown city is Paris after being fine-tuned only on its distances to other cities. The authors state that the visual stitching in this paper can be regarded as a visual version of inductive OCR, where the latent information is the (image, text) association, inferred by aggregating (patch, text) pairs.
    • The authors note: prior work [12, 9, 13, 14, 15] only discussed hypothetical threat models in which OCR makes model knowledge hard to monitor; the authors state that this paper is, to their knowledge, the first work to give an actual threat model showing how OCR can support hard-to-audit data poisoning attacks (Section 2).

    VLM adversarial attacks and data poisoning

    • The paper cites MM-PoisonRAG, shuffle inconsistency jailbreak, composite backdoor, cipher characters jailbreak, Sugar-coated poison, Concept-ROT, etc. as related work on data poisoning attacks (Section 2, [20]–[25]), only for categorization, without comparing them one by one.
    • The authors state that this paper's threat model exploits the limitations of moderation tools: moderation tools may flag a complete image as unsafe, yet often fail to detect its constituent patches—including patches containing key visual features.

    Data moderation

    • OpenAI Moderation API [1], ShieldGemma-2 [18], Llama Guard 3 Vision [19]—data moderation tools for the training and fine-tuning stages; the authors state that even state-of-the-art moderation models cannot reliably detect samples that are "individually harmless, collectively harmful". This paper uses the first two to measure patch evasion rates.

    Baselines and benchmarks: the baseline for capability evaluation is the random mean rank under 20 candidates (9.5, Figure 2); the datasets are the authors' own food (from Food101), animal (from ImageNet), and landmark (from Pexels), 20 images each, plus 20 harmful images (10 sex-related from MultiTrust, 10 violence-related from horror movies, Appendix B.1).

    The authors position this paper as follows: the main goal is to demonstrate the existence of visual stitching as a general VLM capability; the poisoning attack is only a minimal example instantiating this threat model, and deeper exploration is left to future work (Section 2).

  3. How does the paper address this problem?

    Cut images into patches according to a split factor, pair them with the same text to fine-tune the VLM, measure two-level visual stitching by the mean rank of the correct text, then replace with harmful images and safe/unsafe text to simulate poisoning.

    Overall approach: first formalize the visual stitching task and give a metric, then evaluate the two-level stitching capability of open-source VLMs on synthetic ID datasets, and finally adapt the same pipeline to an adversarial setting to verify the safety risk.

    Task definition and metric

    • Task setting: given a source dataset I = {(image, text)}, cut each image into patches according to a split factor f (cut f times along each dimension) to obtain a target dataset Pf = {(patch, text)}, where each patch retains the text description of the original image (Section 3).
    • Expected behavior: after fine-tuning on Pf, the VLM, given the full image or a text reference to that image, can generate the original text.
    • Metric: following [9], all texts in I are used as candidates, the probability of each candidate under the image or text reference condition is computed, and the 0-indexed position of the correct text in descending order of probability is its rank; the mean rank on I is reported, lower is better. Conditioning on the image measures image-based visual stitching, and conditioning on the reference measures reference-based visual stitching.

    Data and fine-tuning for capability evaluation

    • Datasets: three source datasets, food, animal, and landmark, each with 20 images, each paired with a unique synthetic ID (e.g., ar957); animal comes from ImageNet, food from Food101, and landmark from Pexels (Section 4.1). The authors say landmark features are fine-grained and easier to recognize from a single patch, while food and animal usually require aggregating multiple patches.
    • Splitting and fine-tuning: split factor f ∈ {1, 2, 4, 8}; during fine-tuning the ID is embedded in a fixed template, the patch serves as a visual input placeholder, and the loss is computed only on the target ID.
    • Evaluation templates: image-based uses the full image plus the same association sentence pattern; reference-based replaces the placeholder with a specific reference word such as pizza, cat, or Eiffel Tower (Section 4.1).
    • Prior knowledge check: before fine-tuning, verify that each VLM can recognize the original full images (mean rank of the correct reference is close to 0, Table 1), to rule out the confounder of "not recognizing the original image" (Appendix A.1).

    Training setup

    • Models: seven open-source families, Qwen2-VL, Qwen2.5-VL, Gemma-3, Llama-3.2-Vision, InternVL3, LLaVA-1.5, and LLaVA-1.6; pretrained/base versions are used where possible, and only the three instruction versions (Qwen2.5-VL, LLaVA-1.5, LLaVA-1.6) use their chat templates with the question left empty (Section 4.1).
    • Hyperparameters: batch size 8, learning rate 1e-5, bf16; fine-tune for 15 epochs when f = 1 and 5 epochs otherwise (Table 2); each model and each split factor uses 5 random seeds, and the figures report mean and standard deviation (Appendix A.3).

    Adversarial setting (Section 5)

    • Data modification: 20 harmful images (10 sex-related, 10 violence-related), constructing three source datasets: violence (safe), sex (unsafe); sex (safe), violence (unsafe); sex & violence (safe), animal (unsafe) (20 unrelated animal icons labeled unsafe). The authors say balancing safe/unsafe is to avoid the trivial result of the model always outputting the same label, and to simulate injecting incorrect associations.
    • Simulated moderation: after splitting by f ∈ {2, 4, 8}, discard patches flagged as dangerous by the OpenAI Moderation API (omni-moderation-latest), fine-tune on the remaining patches, with a template associating the image with the statement "safe/unsafe for children", and the loss computed only on the target text.
    • Success criterion: also using mean rank—the lower the rank of the correct text (the attacker-specified safe/unsafe), the more successfully moderation was evaded and the effect of fine-tuning directly on the source (image, text) data was simulated.
  4. What experiments did the paper conduct?

    7 open-source VLM families are evaluated on 3 synthetic datasets for two-level stitching, then 20 harmful images are used to test moderation evasion and poisoning effects; most numbers are in the figures.

    Experimental Setup

    • Models evaluated: Qwen2-VL (2B/7B/72B), Qwen2.5-VL (3B/7B/32B/72B-Instruct), gemma-3 (4b/12b/27b-pt), Llama-3.2-Vision (11B/90B), llava-1.5 (7b/13b-hf), llava-v1.6-vicuna (7b/13b/34b-hf), InternVL3 (1B/8B/14B), 20 in total (Table 3).
    • Datasets: food, animal, and landmark, 20 images each paired with a unique synthetic ID; 20 harmful images (10 sex + 10 violence), forming three safe/unsafe datasets (Section 4.1, 5.1).
    • Baselines: the random baseline is the mean rank of 9.5 under 20 candidates (Figure 2); the random baseline for the adversarial experiments is 0.5 (y-axis scale in Figure 7).
    • Metrics: mean rank of the correct text (lower is better); evasion rate of patches against moderation tools.
    • Moderation tools: OpenAI Moderation API (omni-moderation-latest) and ShieldGemma-2; downstream evaluation uniformly uses the former, which the authors state is more effective on complete images (Section 5.2).
    • Number of repetitions: 5 random seeds per model per split factor, reporting mean and standard deviation (Appendix A.3).

    Main Results

    The main results are presented mainly as figures; the verifiable numbers given in the text are as follows (Figure 2, 6, Section 4.2, 5.2):

    ResultNumberSource
    Random baseline mean rank (20 candidates)9.5Figure 2
    Worst image-based case (gemma-3-12b-pt, food, f=8)rank below 3Section 4.2
    Patches flagged by OpenAI Moderation API under 8x8 splitting9%Figure 6, Section 1
    Complete harmful images flagged by OpenAI Moderation API20/20Figure 6
    Complete harmful images flagged by ShieldGemma-219/20Figure 6
    • The authors state that all models perform well on image-based stitching, with most approaching rank 0 at f = 2, 4; landmark is strongest and food weakest, which the authors explain is related to the locality of image features.
    • The authors state that reference-based stitching is non-trivial but unreliable: the probability of the correct ID rises with training, but a non-zero rank means it is difficult to directly sample the correct ID.
    • The authors report that models at f = 2 consistently outperform f = 1 on reference-based stitching, and the authors believe larger patch splitting may act as visual data augmentation; at f = 8, most models drop to near random on food and animal, except for the Qwen2-VL and Qwen2.5-VL families.

    Additional Evidence on the Stitching Mechanism (Section 4.3)

    • Blurred patch localization: using a fixed template to have the model state the image reference from a single blurred patch, the mean rank of correct references steadily decreases from a high value with training (Figure 4); the authors state this is only possible if the model links the blurred patch with other patches sharing the same ID, with Qwen2-VL-7B and Llama-3.2-11B-Vision showing the largest rank decreases.
    • Fine-tuning with blurred patches only: after discarding, by threshold-x, clear patches for which "a single patch alone ranks the correct reference in the top-x" and then fine-tuning, the model still remains above random level (Figure 5); the authors state this shows stitching is not merely memorizing discriminative features.

    Adversarial Experiments (Section 5.2)

    • Evasion rate: Figure 6 (Left) gives the evasion rate of patches against the two moderation tools under different split factors; the authors state that even frontier moderation tools struggle to detect harmful content in small patches, and many unflagged patches still contain features that collectively constitute harmful content.
    • Poisoning effect: after Qwen2-VL-7B is fine-tuned on filtered patches, the mean rank for both image-based and reference-based remains above random level (Figure 7; other models in Figure 14); the authors state that filtering increases difficulty but does not eliminate the effect, and the split factor has limited influence—large patches help stitching but are more easily filtered, and the two offset each other.
    • Dataset differences: models perform better on the sex & violence (safe) and animal (unsafe) datasets; the authors explain that this setting only requires flipping labels, whereas drawing the safe/unsafe boundary within a violation category is more difficult.

    Other Ablations and Analyses

    • Model scale: within the same family, medium scale (about 10B) is generally best; Qwen2-VL-2B and InternVL-1B consistently fail on reference-based stitching; Qwen2-VL saturates at 7B, and InternVL-3 performs similarly to larger variants (Figure 3, 9).
    • Learning rate: at 1e-6 and 5e-6, models completely fail on reference-based stitching (even at f = 1), so 1e-5 is used throughout (Figure 12, Appendix A.4).
    • Position information: adding the row and column position of patches to the fine-tuning template consistently harms performance, more noticeably at f = 2, 4, and negligibly at f = 8 (Figure 10, Appendix A.4).
    • Training dynamics: Qwen2-VL-7B typically converges within 5 epochs, consistent across 5 seeds, but evaluation results fluctuate noticeably during training (Figure 11, Section 6).
    • Architectural factors: the authors speculate that the advantage of the Qwen2 family may come from M-RoPE and dynamic resolution training, and encourage future work to verify this (Section 4.2).
  5. What are some points that can be further explored?

    The authors list limitations such as testing only open-source models and the attack being only a proof of concept, and propose three directions: evaluating closed-source models, improving the attack framework, and mechanistic research.

    Limitations and future directions noted by the authors

    • Only open-source VLMs were evaluated: the authors call this a key experimental limitation; closed-source models are often stronger, and results on them would be valuable (Section 6).
    • The attack demonstration is a proof of concept rather than a complete attack framework (Section 6); the authors say future work is worth doing to build a stricter and more comprehensive stitching attack framework to evaluate its actual impact under standard moderation tools (Section 7).
    • Stitching is unstable and unreliable: both image-based and reference-based stitching are unstable, especially on small patches; evaluation results fluctuate noticeably during training (Figure 11), and stitching behavior appears only at specific learning rates (Figure 12); any non-zero rank means stitching cannot be directly observed through sampling (Section 6).
    • Future directions: evaluate visual stitching on closed-source VLMs; study the dynamics of stitching mechanistically, e.g., its emergence during training (Section 7).
    • Deeper exploration of the threat model: the authors say the main goal of this paper is to demonstrate that the capability exists, and extensive exploration of the relevant threat model is left to future work (Section 2).

    Scope of experiments

    • The models tested are 20 models from 7 open-source families, the largest being about 90B (Llama-3.2-90B-Vision) and 72B (Qwen2-VL-72B, Qwen2.5-VL-72B-Instruct) (Table 3).
    • The capability evaluation datasets are 20 images each for food, animal, and landmark; the adversarial experiments use 20 harmful images plus 20 animal images (Section 4.1, 5.1).
    • The moderation tool evaluation includes the OpenAI Moderation API and ShieldGemma-2; the downstream poisoning experiment uses only the former (Section 5.2).
    • Each model and each split factor uses 5 random seeds, reporting mean and standard deviation (Appendix A.3).
    • The paper does not report attack success rates under sampling or greedy decoding; all results are given as mean rank; the paper does not report human evaluation.
  6. Summarize the main content of the paper

    The authors define and validate the visual stitching capability of VLMs, and state that it can be used to cut harmful images into patches to bypass data moderation.

    A paper on VLM capabilities and safety: the authors propose visual stitching—the ability of VLMs to aggregate visual information scattered across multiple training samples that share the same text description—and state that it makes "shredding harmful images" a poisoning method that can bypass data moderation.

    • Problem to solve: moderation that removes harmful (image, text) samples can be bypassed—by cutting a harmful image into seemingly harmless patches, pairing them with arbitrary text, and scattering them into the training set, the VLM may reassemble the harmful association on its own during training.
    • Method highlights: 20 images paired with unique synthetic IDs are cut according to f ∈ {1, 2, 4, 8} into (patch, ID) pairs to fine-tune the VLM, and the mean rank of the correct text among 20 candidates measures image-based and reference-based two-level stitching; the adversarial version replaces IDs with safe/unsafe and images with 20 harmful images, and first filters patches with the OpenAI Moderation API.
    • Main results:
      • Image-based stitching of most open-source VLMs approaches zero rank, and even the worst case (gemma-3-12b-pt, food, f=8) is below 3, with a random baseline of 9.5 (Figure 2).
      • Reference-based stitching is non-trivial but unreliable; f = 2 consistently outperforms f = 1, and the authors believe larger patch splitting may be similar to data augmentation.
      • Under 8x8 splitting, only 9% of harmful image patches are flagged by the OpenAI Moderation API (Figure 6).
      • After fine-tuning on filtered patches, Qwen2-VL-7B still outputs the attacker-specified safe/unsafe at above-random level (Figure 7).
      • Medium-scale (about 10B) models are generally best; when the learning rate is too low (1e-6, 5e-6), reference-based stitching completely fails.
    • Authors' conclusion: the authors state that visual stitching is both a generalization advantage and a safety risk, highlighting the need for moderation techniques beyond sample-level moderation; future directions include evaluating closed-source VLMs, building a more complete attack framework, and mechanistic research.
Read originalNeurIPS 2025