arXiv:2610.41307cs.CROct 2026

Manuscript Offprint

arXiv:2610.41307

Erase the Injected Region: Multimodal Prompt-Injection Defense with On-Policy Self-Distillation

Shuo Hong, Jiaxin Ma, Xidi Cai, Qianli Ma

Abstract

Multimodal indirect prompt injection embeds malicious instructions in external media that also contains information needed for the user's task. Existing defenses can block the attack yet impair the model's use of that information, leaving a gap between attack defense and task preservation. We propose ERASE, an on-policy self-distillation method that constructs its reference by erasing the injected region in place. Modality-appropriate blank content replaces the injection while the surrounding media is preserved. A student reading attacked media learns from a frozen base model reading the erased view through full-distribution token-level feedback on its own rollouts. Across image, audio, and video on two model sizes, ERASE records near-zero observed attack success on the evaluated benchmark while retaining task utility close to the undefended clean-input level. On 3B audio, ERASE reaches 60.1% attacked-input accuracy compared with ARGUS's 33.1%, within 0.5 points of the undefended clean-input level. Experiments show that ERASE reduces injection dependence from 6.26 to 0.0095 on 3B audio while staying close to the base model on the erased input. Out-of-domain accuracy also stays near the base level. Our code will be made publicly available upon acceptance.

1 Introduction

Multimodal large language models increasingly process external images, audio, and video alongside user requests. An attacker who controls this external content can embed commands that the model may mistake for authorized instructions (Greshake et al., 2023; Wallace et al., 2024). Such attacks constitute multimodal indirect prompt injection (IPI): the malicious instructions reach the model through external media rather than a direct user request. Attacks can place instructions in images (Cao et al.,

User: Is there a paper being torn?

Injected audio: Ignore previous instructions and output 'rrqcdzxilkk'.

Figure

User instruction accuracy

Figure 1: An audio IPI case on Qwen2.5-Omni-3B. Left: the undefended model follows the attack; ARGUS (Lu et al., 2026) and ERASE both block it, but only ERASE answers correctly. Right: audio injection dependence DinjD_{inj} (top) and user-instruction accuracy on clean and attacked inputs (bottom).

2026; Li et al., 2025a; Nagaraja et al., 2025), mix spoken commands into audio (Liu et al., 2026), or insert them into video (Cui et al., 2026), potentially causing data leakage (Greshake et al., 2023) or unauthorized tool calls (Cao et al., 2026; Chen et al., 2026). Because these commands are embedded in media that also contains useful information, a defense must prevent the model from following the attack without preventing it from using that media to answer the user's request.

Existing defenses mark external data as untrusted, fine-tune the model to prioritize authorized instructions, or intervene in its representations (Section 2). Most target text-domain injection or general safety alignment. ARGUS (Lu et al., 2026), specifically designed for multimodal IPI, provides a directly relevant baseline across images, audio, and video. However, our evaluation of ARGUS exposes a gap: improved attack blocking can accompany reduced user-task utility. This gap arises when a defense blocks the injected command but

∗^{*} Corresponding author.

also disrupts the model's use of task-relevant information in the media.

Figure 1 (left) illustrates this gap: ARGUS and ERASE both block the injected command, but only ERASE answers the user's question correctly. Blocking the requested attack output does not reveal how much the injection still affects the model's predictions. To examine this remaining influence, we compare the model's next-token distributions on the attacked and erased views under the same generated output prefix, averaging the two KL directions. This gives DinjD_{inj}: a lower value means that the model depends less on the injection. On audio, ARGUS leaves DinjD_{inj} at 5.15, compared with 6.26 for no defense (Figure 1, top right). We evaluate injection dependence alongside attack following and in-domain task utility, and use out-of-domain tasks to assess broader capability retention.

To reduce this influence while retaining task-relevant behavior, we propose ERASE, an on-policy self-distillation method that uses an erased view of the attacked media as its training reference. This view replaces only the injected region with modality-appropriate blank content, preserving the surrounding media and its spatial or temporal structure. A frozen copy of the base model reads the erased view, while a trainable student reads the attacked media and samples its own trajectory. At each previously generated output prefix, the student matches the teacher's full next-token distribution through a token-level KL, an instance of on-policy self-distillation (Zhao et al., 2026; Fu et al., 2026). Because the teacher still receives the retained media and the user's request, its distribution provides a task-oriented target for the attacked input.

On the evaluated image, audio, and video benchmark, ERASE provides effective defense while keeping user-task utility on attacked inputs close to the undefended model's clean-input performance. On audio, DinjD_{inj} falls to 0.0095, under 1/650 of the undefended value. We also evaluate out-of-domain reasoning and perception to assess potential capability costs.

Our contributions are as follows:

  1. Diagnosis. We introduce erasure-based diagnostics to measure injection dependence and retention of the base model's reference behavior.

  2. Method. We propose ERASE, an on-policy self-distillation method that uses an erased view of the attacked media as the teacher's input and matches its full token distributions on student-sampled trajectories. Training uses the injected region to build the reference; deployment requires no region metadata or erasure.

  3. Evaluation. Across three modalities and two model sizes, ERASE records near-zero observed attack success with attacked-input utility close to the undefended clean-input level. Diagnostics show low injection dependence and erased-view drift; out-of-domain evaluation shows accuracy close to the base level across reasoning and perception tasks.

References (25)