acceptodds
Under review as a conference paper at ICLR 2027

Understanding In-Context Multimodal Jailbreaks via Posterior Reweighting

Abstract

In-context learning (ICL) jailbreaks reveal a critical vulnerability in multimodal large language models (MLLMs): harmful demonstrations in the prompt can induce unsafe outputs without modifying model parameters. Despite extensive empirical evidence, existing work lacks a principled understanding of why such jailbreaks reliably succeed or how their effectiveness scales with context composition. We propose a posterior reweighting framework that models a safety-aligned MLLM as implicitly operating over competing behavioral modes, and interprets in-context demonstrations as inference-time evidence that dynamically shifts the model’s posterior preference between safe and harmful behaviors. This view formalizes jailbreak as a process of evidence accumulation, yielding predictive scaling laws with respect to demonstration count, harmful ratio, adversarial strength, and semantic diversity. Guided by this framework, we introduce a posterior-aware inference-time defense that adaptively injects benign counter-evidence based on estimated risk, effectively suppressing harmful posterior drift while preserving model utility. Compared to existing in-context defenses, our method achieves a significantly improved robustness-utility trade-off under a fixed intervention budget. Together, our results establish posterior reweighting as a unifying and predictive framework for understanding and mitigating ICL jailbreak in MLLMs.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
Multimodal Large Language Models, In-Context Learning, Jailbreak Attacks, AI Safety, Inference-Time Defense

Reviews

Among:
Shape:
1234this paper, Bottom 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.25 over 4 reviews, above 49% of the others.
Reviewer_DCP1OpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper proposes a posterior reweighting framework to explain in-context learning (ICL) jailbreaks in multimodal large language models (MLLMs). It models safe and harmful generation as two latent behavioral modes and interprets in-context demonstrations as evidence that shifts the posterior preference between these modes. Based on this formulation, the authors derive scaling predictions with respect to the number, ratio, adversarial strength, and semantic diversity of harmful demonstrations. They also propose a risk-gated inference-time defense that selectively injects benign demonstrations for inputs in an intermediate-risk regime while bypassing benign inputs and directly refusing highly harmful ones.

The authors evaluate the proposed framework across multiple MLLMs, attack modalities, and datasets. On Qwen3-VL-8B, the proposed defense reduces the attack success rate (ASR) on MM-SafetyBench from 57.65% to 25.61% for image attacks, from 53.08% to 24.39% for text attacks, and from 58.53% to 28.00% for mixed-modal attacks, while reducing the average utility score only from 72.1 to 71.5. The paper also reports cross-dataset prediction results for its fitted scaling law, achieving an overall RMSE of 3.54% when transferring from AdvBench to MM-SafetyBench.

Critical strengths
  1. Relevant problem and broad empirical evaluation.

The paper addresses an important safety problem in MLLMs and evaluates attacks across multiple models, including open-weight and proprietary systems, as well as image, text, and mixed-modal settings. The experiments cover multiple benchmarks and examine several factors affecting jailbreak success. Evaluating both ASR and standard multimodal utility is particularly valuable because it avoids assessing defense effectiveness solely through attack mitigation.

  1. Promising robustness–utility trade-off.

The risk-gated defense is simple and does not require modifying the base model’s parameters. On Qwen3-VL-8B, it substantially reduces ASR across all three attack modalities while retaining most of the original utility. The comparisons with In-Context Defense, unconditional benign injection, AdaShield, and ECSO, together with additional evaluations under FigStep and detector-aware adaptive attacks, provide useful evidence of its practical potential.

Critical weaknesses
  1. The theoretical framework relies on strong assumptions that limit its mechanistic claims.

The posterior reweighting formulation is mathematically plausible, but its key assumptions are not sufficiently justified. In particular, Assumption (19) in Appendix A.1 assumes fixed harmful-output probabilities (p_h) and (p_s) for any target input under the two latent modes. This is a strong simplification because harmfulness can depend substantially on the target query, even when the underlying behavioral mode is unchanged. Similarly, the semantic-diversity result assumes that the redundancy term decreases as the number of semantic categories increases, which effectively builds the desired monotonic relationship into the formulation.

The empirical validation does not fully resolve these concerns. Selecting a two-component Gaussian mixture model using BIC on hidden-state representations does not establish that the two components correspond specifically to safe and harmful generation modes. Moreover, the paper does not directly estimate the posterior probability of the harmful mode or the per-demonstration evidence contributions. The cross-dataset logistic regression results are encouraging, but they establish predictive association more directly than they establish the proposed internal mechanism. The authors should distinguish more carefully between a phenomenological model that organizes empirical observations and a validated mechanistic account of MLLM behavior.

  1. The defense mechanism and its evaluation require clearer specification.

The defense uses a harmfulness detector described as estimating risk from the target input and its in-context demonstrations. However, Appendix A.4 describes a CLIP-ViT-Base-Patch32 classifier trained on GPT-5-generated harmful inputs and benign OK-VQA examples, without sufficiently clarifying how the detector represents text-only inputs, mixed-modal inputs, and the user-provided demonstration context. It is therefore difficult to determine whether the detector captures the contextual jailbreak risk that motivates the proposed method or primarily recognizes harmfulness in individual inputs.

The paper also states that the gating thresholds are optimized on the detector’s training set. Although the evaluation datasets are reported to be disjoint from training data, a held-out calibration protocol and modality-specific generalization results would strengthen confidence in the learned gating policy. Finally, because benign demonstration injection is already an established defense strategy, the paper should more clearly isolate the contribution of risk gating from the benefit of adding benign demonstrations, ideally with controlled comparisons under matched intervention and token budgets.

Questions for authors
  1. Validation of the latent modes: How do the authors establish that the two Gaussian mixture components identified by BIC correspond to safe and harmful generation modes, rather than other sources of variation in hidden-state representations? Can the authors provide quantitative evidence linking cluster assignments to behavioral safety labels or directly estimate the context-dependent harmful-mode posterior?

  2. Harmfulness detector and calibration: How exactly does the CLIP-ViT-Base-Patch32 detector process text-only and mixed-modal inputs, and does it explicitly encode the user-provided in-context demonstrations and their responses? How are the lower and upper gating thresholds learned, and can the authors report results using a separate validation set, with performance broken down by attack modality?

  3. Contribution of risk gating: Can the authors provide a more controlled comparison that isolates the benefit of the learned gating policy from unconditional benign demonstration injection, including an oracle-gating upper bound or an equivalent intervention-budget comparison? This would help establish whether the proposed gating mechanism itself accounts for the observed robustness–utility improvement.

5 comments

We thank the reviewer for the careful reading and constructive suggestions.

W1 (latent modes) & Q1: On validation of the latent modes

Whether an MLLM internally executes an explicit posterior update cannot be directly verified, which equally holds for prior latent-variable theories of ICL (Xie et al.; Wies et al.). Our framework is a predictive model built on a latent-variable abstraction, and we validate it through its observable consequences. As suggested, we add analyses that link the clusters to safety labels and estimate the context-dependent posterior.

Existing experiment. In Sec. 3.4, we collect hidden states of Qwen3-VL-8B under different in-context configurations and fit Gaussian mixture models; BIC selects two components (Table 1). We agree that BIC alone does not tell what the two components represent.

New analyses. (i) Linking clusters to safety labels. We compare each sample's component assignment with the harmful/safe label of its response given by the GPT-5 judge. The assignment is strongly associated with the output (purity 91.34%): samples in one component mostly yield harmful responses, and samples in the other mostly yield safe ones. The association is strong but not exact, which matches Prop. 1, where each mode produces harmful outputs with its own probability (ph>psp_h > p_s) and does not determine the output. (ii) Ruling out other sources of variation. We fix the target query and vary only the context from k=0k=0 to k=8k=8 harmful demonstrations. 79.22% of samples move from one component to the other. Since the query, image, and modality are held fixed, this shift cannot be explained by input content.

Conclusion. The two components are thus latent states that are shifted by the context and that govern the tendency toward harmful or safe outputs, which is how our framework defines the two generation modes. (iii) Estimating the posterior. The probability that a hidden state belongs to the harmful component then gives an estimate of Pr⁡(Z=h∣C)\Pr(Z=h \mid C), which rises from 3.57% to 65.57% as kk increases from 0 to 8, consistent with the posterior shift predicted by Eq. 9. We add these analyses to Sec. 3.4.

W2 & Q2: On detector design and threshold calibration

Detector. CLIP-ViT-B/32 serves as a multimodal feature extractor: text is encoded by the CLIP text encoder and images by the image encoder, separately for mixed-modal inputs. To handle CLIP's 77-token limit, each demonstration's request and response, as well as the target query, are scored segment-wise, with longer texts chunked. The segment scores sis_i are aggregated additively into u(xt,C)=σ(∑ilogit⁡(si))u(x_t, C) = \sigma\big(\sum_i \operatorname{logit}(s_i)\big), mirroring the evidence accumulation in Eq. 7. The detector therefore encodes the demonstrations and their responses explicitly, and its score reflects risk accumulated over the context, not the target input alone.

Threshold learning. The thresholds (τℓ,τu)(\tau_\ell, \tau_u) are produced by a two-layer network trained with Lgate\mathcal{L}_{\text{gate}} (Eqs. 16–18, Sec. 4.2), with the detector and the target MLLM frozen. For differentiability, the hard gate is relaxed during training as σ((u−τ)/Tg)\sigma\big((u - \tau)/T_g\big) with Tg=0.1T_g = 0.1; hard thresholds are used at inference.

Held-out calibration. We re-learn the thresholds on a held-out split disjoint from both detector training and evaluation data. On Qwen3-VL-8B, this yields 25.13 / 25.51 / 26.99% ASR (image / text / mixed) with utility 71.5, comparable to the original 25.61 / 24.39 / 28.00% and 71.5. The learned gate thus generalizes across modalities. We will add these details to App. A.4.

Q3: On isolating the contribution of risk gating

We agree that this comparison is important and provide the intervention-budget comparison together with two further controls on Qwen3-VL-8B. In our framework, the effect of a fixed injection budget depends on the current posterior: the reduction σ(L0)−σ(L0−nβ)\sigma(L_0) - \sigma(L_0 - n\beta) is largest at log-odds L0=nβ/2L_0 = n\beta/2 and vanishes at both ends. The gate should therefore matter through which inputs it selects.

  • Budget-matched unconditional injection. We inject into every input, with the number of demonstrations reduced to match our average budget (300 injected tokens per input). ASR is 34.73% at 71.7 utility, versus 25.61% and 71.5 for ours, so the gain does not come from a smaller budget.
  • Random gating. We inject into the same fraction of inputs as our gate but select them at random. ASR is 45.85%, versus 25.61% for ours, so selecting the right inputs matters.
  • Component decomposition. Table 15 separates the two branches of the gate: refusal only yields 46.79% ASR and injection only yields 34.89%, while the full gate reaches 25.61%. The improvement therefore does not come from the refusal branch alone.

W1 (theoretical assumptions): On Assumption (19) and the redundancy term

Query-dependent ph,psp_h, p_s. Prop. 1 is stated for a fixed target input, so Assumption (19) can be relaxed to query-dependent ph(xt)>ps(xt)p_h(x_t) > p_s(x_t) without changing the result. Since Pr⁡(Z=h∣C)\Pr(Z=h \mid C) depends only on the context, averaging over queries gives ASR=E[ps(x)]+E[ph(x)−ps(x)]⋅Pr⁡(Z=h∣C)\text{ASR} = \mathbb{E}[p_s(x)] + \mathbb{E}[p_h(x) - p_s(x)] \cdot \Pr(Z=h \mid C), which remains monotone in the posterior. All four scaling predictions therefore hold under this relaxation.

Redundancy term. That redundancy decreases with more categories is an explicit modeling choice, reflecting that same-category demonstrations carry correlated evidence. It is not guaranteed by construction: its prediction could have failed empirically, yet it is confirmed across seven MLLMs and three modalities (Table 5).

Dear Reviewer DCP1,

Thank you again for your careful reading and constructive suggestions. As the discussion period ends soon, we would like to kindly check whether our response has addressed your concerns, in particular the new analyses of the latent modes, the detector and calibration details, and the controlled comparisons isolating the contribution of the gate. The revised manuscript is uploaded with all changes highlighted in blue. If our response resolves your concerns, we would be grateful if you could reconsider your evaluation. We are happy to address any remaining questions.

Best regards,

The Authors

Reviewer_fP8qOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper focuses on the jailbreaking problem in multimodal large language models. It proposes a posterior reweighting framework that uses a CLIP structure to detect harmful behavior from accumulated evidence in the context.

Critical strengths
  1. The paper focuses on an important research question.
  2. The paper conducts extensive experiments on different MLLMs.
Critical weaknesses

1. Insufficient Validation of the Core Theoretical Assumption. The proposed theoretical framework relies on the assumption that MLLMs operate over two latent generation modes: safe and harmful. However, I am not fully convinced that this assumption is justified. Although the authors provide hidden-state clustering and scaling experiments, these findings are not new [1] and do not validate the proposed Bayesian posterior reweighting mechanism. The paper should provide stronger evidence to support this core theoretical assumption.

[1] On Prompt-Driven Safeguarding for Large Language Models. ICML 2024

2. Limited Novelty of the Defense Mechanism. The proposed defense is mainly built on an external harmfulness detector, and using a threshold-based gating mechnaism. These components are closely related to existing safety filtering approaches, such as Llama Guard. I am not fully convinced that the proposed defense introduces sufficient technical novelty. Moreover, the paper lacks direct comparisons with standard safety filtering methods and does not clearly demonstrate how the proposed posterior reweighting theory provides unique benefits to the defense design.

3. Limited Validation Across Different Jailbreak Mechanisms. Although the paper evaluates image-based, text-based, and mixed-modal perturbation attacks, the validation of the proposed posterior reweighting theory across different jailbreak mechanisms remains limited. In particular, typography-based jailbreaks, are not sufficiently investigated in the theoretical scaling experiments. While the authors provide additional defense evaluations against FigStep, I believe more comprehensive evaluations of different multimodal jailbreak mechanisms, particularly on benchmarks specifically designed for MLLM safety, such as MM-SafetyBench[2], would strengthen the generalizability of the proposed framework.

[2]MM-SafetyBench: A Benchmark for Safety Evaluation of Multimodal Large Language Models. ECCV 2024

Questions for authors

Please refer to the weakness section

3 comments

We thank the reviewer for the feedback. We first clarify that the posterior-reweighting framework is a theory explaining ICL jailbreaks; the CLIP-based detector is only a component of the derived defense, used to gate injection.

W1: On validating the two-mode assumption

Whether an MLLM internally executes an explicit posterior update cannot be directly verified, which equally holds for prior latent-variable theories of ICL (Xie et al.; Wies et al.); our experiments therefore serve as supporting evidence for the assumption. We thank the reviewer for pointing to [1], which we will cite as consistent evidence. However, [1] shows that harmful and harmless queries are separable in text-only LLMs, i.e., it distinguishes inputs. In contrast, we model generation modes of MLLMs that shift with in-context demonstrations, and derive predictive scaling laws for ICL jailbreaks, which [1] does not study. We add new analyses that make this distinction explicit.

Existing experiment. In Sec. 3.4, we collect hidden states of Qwen3-VL-8B under different in-context configurations and fit Gaussian mixture models; BIC selects two components (Table 1).

New analyses. (i) Association with output behavior. We compare each sample's component assignment with the harmful/safe label of its response given by the GPT-5 judge. The assignment is strongly associated with the output (purity 91.34%): samples in one component mostly yield harmful responses, and samples in the other mostly yield safe ones. The association is strong but not exact, which matches Prop. 1, where each mode produces harmful outputs with its own probability (ph>psp_h > p_s) and does not determine the output. (ii) Context dependence. We fix the target query and vary only the context from k=0k=0 to k=8k=8 harmful demonstrations. 79.22% of samples move from one component to the other. Since the query is unchanged, the components are driven by the context and not by the input, unlike the query-level separation in [1].

Conclusion. The two components are thus latent states that are shifted by the context and that govern the tendency toward harmful or safe outputs, which is how our framework defines the two generation modes. The probability that a hidden state belongs to the harmful component then gives an estimate of Pr⁡(Z=h∣C)\Pr(Z=h \mid C), which rises from 3.57% to 65.57% as kk increases from 0 to 8. Input-level separability cannot capture this context-driven shift. We add these analyses to Sec. 3.4.

W2: On defense novelty and comparison with safety filters

Novelty of the defense. Our novelty is neither the detector nor benign injection itself, but a principled framework for determining when counter-evidence should be introduced. The detector only supplies a practical risk estimate for the gate. Unlike a safety filter, which makes a binary accept/refuse decision, our posterior-reweighting framework shows that the effectiveness of benign demonstrations depends on the current posterior and the available intervention budget, which motivates a three-way policy: bypass, inject, or refuse.

How the theory shapes the defense. By Prop. 1 (Eq. 5), Pjs=ps+(ph−ps)Pr⁡(Z=h∣C)P_{js} = p_s + (p_h - p_s)\Pr(Z=h \mid C), so a defense must reduce the posterior. Injecting nn benign demonstrations with average counter-evidence β\beta shifts the posterior log-odds from L0L_0 to L0−nβL_0 - n\beta (Eq. 10) and reduces the posterior by σ(L0)−σ(L0−nβ)\sigma(L_0) - \sigma(L_0 - n\beta). For a fixed budget nβn\beta, this reduction is largest at L0=nβ/2L_0 = n\beta/2 and vanishes at both ends. Inputs that are already safe gain nothing from injection and only lose utility, so they are bypassed. Strongly harmful inputs would need n≥(L0−logit⁡δ)/βn \ge (L_0 - \operatorname{logit}\delta)/\beta demonstrations, which grows linearly with L0L_0, so they are refused. Only uncertain inputs receive injection. A safety filter has no such intermediate regime: it can only accept or refuse.

Evidence. Our ablation isolates this benefit with the same detector. Used as a conventional filter ("Refusal Only", Table 15), it leaves 46.79% ASR on Qwen3-VL-8B. Adding the theory-derived counter-evidence reduces ASR to 25.61%, a 45% relative reduction. The intermediate regime also protects normal requests: a filter turns every false positive into a refusal, whereas our gate still answers these inputs after injection. 71–78% of harmful inputs are handled by injection rather than refusal (Table 15), and 31.19% of benign utility inputs fall into this regime, so utility drops only from 72.1 to 71.5 (Table 7).

Comparison with Llama Guard. We additionally compare with Llama Guard 4 (12B) as a standalone input filter. It yields 22.38% ASR at a utility of 70.3, versus 25.61% and 71.5 for ours. Llama Guard attains a lower ASR, but with a much larger model: its 12B parameters are about 80× those of our CLIP-ViT-B/32 detector and exceed the 8B target model itself, whereas our defense adds only 13.4% latency (App. A.11). Our defense comes within 3.2 points of its ASR with a lightweight detector and a smaller utility cost (−0.6 vs. −1.8). The two are also complementary: our gate is detector-agnostic, so a stronger detector such as Llama Guard can replace CLIP within the same three-way policy.

W3: On validation across jailbreak mechanisms and MM-SafetyBench

We appreciate this suggestion and respectfully clarify that MM-SafetyBench is already our primary benchmark (Sec. 5.2, App. A.4). We use its SD+TYPO setting, where each harmful query is paired with a Stable Diffusion image overlaid with typographic harmful key phrases. Typography-based inputs are therefore covered in our scaling experiments: Tables 2–5 and the default k=8k=8 setting of Table 7 are on MM-SafetyBench (e.g., 57.65% ASR for Qwen3-VL-8B). In addition, App. A.7 evaluates the defense against FigStep, a purely typographic attack. We apologize that the SD+TYPO setting was not stated clearly and will make it explicit in Sec. 5 and App. A.4.

Dear Reviewer fP8q,

Thank you again for your feedback. As the discussion period ends soon, we would like to kindly check whether our response has addressed your concerns, in particular the distinction from [1], the comparison with Llama Guard, and the clarification of our MM-SafetyBench setting. The revised manuscript is uploaded with all changes highlighted in blue. If our response resolves your concerns, we would be grateful if you could reconsider your evaluation. We are happy to address any remaining questions.

Best regards,

The Authors

Reviewer_1rBqOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
2
Read review
Paper summary

This paper proposes a posterior reweighting framework to explain in-context jailbreaks in multimodal large language models as shifts in the posterior probabilities of safe and harmful generation modes. The authors investigate how the number, ratio, strength, and semantic diversity of harmful demonstrations affect jailbreak success rates, and validate the predicted trends across multiple models. Furthermore, the paper introduces a risk-gated inference-time defense that adaptively injects benign demonstrations to reduce jailbreak success rates while preserving model utility.

Critical strengths

1.The paper provides a unified theoretical perspective on multimodal jailbreaks, supported by experiments across multiple models and attack settings. 2.The proposed defense effectively reduces jailbreak success rates while largely preserving model utility, without retraining the target model.

Critical weaknesses

1.The paper mainly relies on jailbreak success rates, without directly verifying the proposed posterior shifts within the model. 2.The two GMM components identified in Section 3.4 do not necessarily correspond to safe and harmful generation modes. 3.The defense primarily uses five benign demonstrations without systematically evaluating the effects of their number or semantic diversity.

Questions for authors

1.How can the proposed posterior reweighting mechanism be directly validated beyond observed jailbreak success rates? 2.What evidence supports the interpretation of the two GMM components as safe and harmful modes? 3.Why are five benign demonstrations used, and how do their number and semantic diversity affect defense performance?

2 comments

We thank the reviewer for the positive assessment of our unified perspective and the effectiveness of our defense. We address W2 first, as it provides the basis for W1.

W2 & Q2: On interpreting the two GMM components

Existing experiment. In Sec. 3.4, we collect hidden states of Qwen3-VL-8B under different in-context configurations and fit Gaussian mixture models with varying numbers of components. BIC selects two components (Table 1). We agree that BIC alone does not tell what the two components represent, so we add two analyses.

New analyses. (i) Association with output behavior. We compare each sample's component assignment with the harmful/safe label of its response given by the GPT-5 judge. The assignment is strongly associated with the output (purity 91.34%): samples in one component mostly yield harmful responses, and samples in the other mostly yield safe ones. The association is strong but not exact, which matches Prop. 1, where each mode produces harmful outputs with its own probability (ph>psp_h > p_s) and does not determine the output. (ii) Context dependence. We fix the target query and vary only the context from k=0k=0 to k=8k=8 harmful demonstrations. 79.22% of samples move from one component to the other. Since the query is unchanged, the components are driven by the context and not by the input.

Conclusion. The two components are thus latent states that are shifted by the context and that govern the tendency toward harmful or safe outputs, which is how our framework defines the safe and harmful generation modes.

W1 & Q1: On directly validating the posterior shift

Whether an MLLM internally executes an explicit posterior update cannot be directly verified, which equally holds for prior latent-variable theories of ICL (Xie et al.; Wies et al.). The analyses above, however, let us estimate the posterior beyond ASR: the probability that a hidden state belongs to the harmful component is an estimate of Pr⁡(Z=h∣C)\Pr(Z=h \mid C). As kk increases from 0 to 8, this estimate rises from 3.57% to 65.57%, reflecting the posterior update toward the harmful mode predicted by Eq. 9. We add these analyses to Sec. 3.4.

W3 & Q3: On the number and diversity of benign demonstrations

Five demonstrations serve as our default budget. We agree that their number and semantic diversity deserve systematic study and add two ablations on Qwen3-VL-8B (MM-SafetyBench, image attack, k=8k=8 harmful demonstrations), varying one factor at a time.

Number. We vary the number of injected benign demonstrations from 1 to 10. ASR decreases from 47.95% to 21.87%, with diminishing returns beyond 7, while utility decreases from 71.8 to 70.9. Five demonstrations already achieve 86% of this ASR reduction (25.61%) at a utility of 71.5, which is why we use five by default.

Diversity. We fix the number at five and draw the demonstrations from 1 to 4 semantic categories. ASR decreases from 25.61% to 22.76%. This follows the redundancy effect in Eq. 13, which applies equally to counter-evidence: diverse benign demonstrations provide less redundant evidence toward the safe mode.

We will add these results to the appendix.

Dear Reviewer 1rBq,

Thank you again for your positive assessment and constructive suggestions. As the discussion period ends soon, we would like to kindly check whether our new analyses of the GMM components and the ablations on benign demonstrations have addressed your questions. The revised manuscript is uploaded with all changes highlighted in blue. We are happy to clarify anything further.

Best regards,

The Authors

Reviewer_2nAdOpenReview ↗
Rating
2(+1)
Confidence
4
Informativeness
1
Presentation
2
Soundness
3
Read review
Paper summary

The paper shows how harmful demonstrations in a prompt can make a MLLLM model more likely to answer harmful questions. They model a safety-aligned MLLM as a mixture of latent “safe” and “harmful” modes, and interpret harmful in-context demonstrations as shifting the mixture weight toward the harmful mode which increases compliance with harmful requests. They also propose a defense that uses a risk detector to decide when to add safe demonstrations to the context or directly refuse the harmful request to reduce jailbreaking.

Critical strengths

S1. The experiments cover a broad range of models, both open-weight and proprietary models, as well as different attack modalities and harmful task categories.

S2. The defense gating is well introduced against using unconditional ICD injecting, as unconditional benign injection lowers ASR but degrades normal task utility across all models, thus only then injecting safe demonstrations in flagged cases.

Critical weaknesses

W1. Fitting ASR with a logistic model does not show that the model actually performs the proposed posterior update.

W2. The novelty is limited. it builds on existing safe-demonstration injection, with a learned risk gate as the main addition. The evaluation should compare against multimodal defenses, such as BlueSuffix [2], to show the work's benefit. It also doesn't show how effective their ICL attacks are against these defenses.

W3. The related work should discuss existing posterior-inference approaches to jailbreak generation, such as VERA-V[1]. Also, comparing their posterior-based defense against posterior-based attacks would strengthen the work.

[1] VERA-V: Variational Inference Framework for Jailbreaking Vision-Language Models. Liao et al. 2025 [2] Bluesuffix: Reinforced blue teaming for vision-language models against jailbreak attacks. Zhao et al. 2025

Questions for authors

see W2 and W3.

5 comments

We thank the reviewer for the constructive feedback. Our primary contribution is the posterior-reweighting framework and its testable predictions; the defense is derived from it.

W1: On whether the model performs the proposed posterior update

Our objective is not to identify the internal computation of MLLMs, but to provide a framework that explains and predicts how context composition governs ICL jailbreak success and that guides defense design. Whether an MLLM internally executes an explicit posterior update cannot be directly verified, which equally holds for prior latent-variable theories of ICL (Xie et al.; Wies et al.). We therefore validate the framework through its observable consequences, and add a new analysis that estimates the posterior from hidden states.

Existing experiment. In Sec. 3.4, we collect hidden states of Qwen3-VL-8B under different in-context configurations and fit Gaussian mixture models with varying numbers of components. BIC selects two components (Table 1), suggesting that the model's internal representations are organized around two dominant modes.

New analyses. Building on this result, we examine what the two components represent. (i) Association with output behavior. We compare each sample's component assignment with the harmful/safe label of its response given by the GPT-5 judge. The assignment is strongly associated with the output (purity 91.34%): samples in one component mostly yield harmful responses, and samples in the other mostly yield safe ones. The association is strong but not exact, which matches Prop. 1, where each mode produces harmful outputs with its own probability (ph>psp_h > p_s) and does not determine the output. (ii) Context dependence. We fix the target query and vary only the context from k=0k=0 to k=8k=8 harmful demonstrations. 79.22% of samples move from one component to the other. Since the query is unchanged, the components reflect how the model responds rather than what it is asked.

Conclusion. The two components are thus latent states that are shifted by the context and that govern the tendency toward harmful or safe outputs, which is how our framework defines the safe and harmful generation modes. This lets us estimate the posterior directly: the probability that a hidden state belongs to the harmful component is an estimate of Pr⁡(Z=h∣C)\Pr(Z=h \mid C). As kk increases from 0 to 8, this estimate rises from 3.57% to 65.57%, reflecting the posterior update toward the harmful mode predicted by Eq. 9. We add these analyses to Sec. 3.4.

W2: On novelty and multimodal defense comparisons

Novelty of the defense. Our novelty is not benign demonstration injection itself, but a principled framework for determining when counter-evidence should be introduced. Existing in-context defenses typically append safe demonstrations unconditionally, without characterizing how their effectiveness depends on the accumulated harmful evidence. Our posterior-reweighting framework provides this missing connection: benign demonstrations contribute negative log-evidence that counteracts the harmful-mode posterior, but their effectiveness depends on the current posterior and the available intervention budget. This motivates our three-way policy: bypass clearly benign inputs to preserve utility, inject counter-evidence when it can meaningfully reduce harmful-mode preference, and directly refuse highly harmful inputs for which bounded injection is insufficient. We operationalize this principle through a learned risk gate, using the detector score as a practical proxy rather than an exact posterior estimate. Unlike unconditional injection, our defense selectively allocates counter-evidence, achieving both lower ASR (25.61% vs. 38.10%) and higher utility (71.5 vs. 70.3) on Qwen3-VL-8B.

The gate is motivated by the framework. By Prop. 1 (Eq. 5), Pjs=ps+(ph−ps)Pr⁡(Z=h∣C)P_{js} = p_s + (p_h - p_s)\Pr(Z=h \mid C), so for a fixed model and query, a defense must reduce the posterior. Injecting nn benign demonstrations with average counter-evidence β\beta shifts the posterior log-odds from L0L_0 to L0−nβL_0 - n\beta (Eq. 10) and reduces the posterior by Δ(L0)=σ(L0)−σ(L0−nβ).\Delta(L_0) = \sigma(L_0) - \sigma(L_0 - n\beta).

Our defense injects a fixed number of demonstrations. For a fixed injection budget nβn\beta, this reduction is maximized at L0=nβ/2L_0 = n\beta/2 and vanishes as L0→±∞L_0 \to \pm\infty, which yields three regimes:

  • L0≪0L_0 \ll 0 (already safe): injection brings almost no gain but still costs utility (Fig. 2), so the input is bypassed.
  • L0L_0 around nβ/2n\beta/2 (uncertain): injection is most effective, so benign demonstrations are injected.
  • L0≫nβL_0 \gg n\beta (strongly harmful): pushing the posterior below a target level δ\delta requires n≥(L0−logit⁡δ)/βn \ge (L_0 - \operatorname{logit}\delta)/\beta demonstrations, which grows linearly with L0L_0 and overloads the context, so the input is refused.

This analysis motivates our three-way intervention policy. In practice, we approximate the relevant risk using an external detector and learn its thresholds to balance robustness and utility. The ablations support each part: random gating at our injection rate yields 45.85% ASR; injection only and refusal only yield 34.89% and 46.79% (Table 15); the full gate reaches 25.61% at 71.5 utility.

Comparisons. We already compare against defenses designed for MLLMs, AdaShield (Wang et al.) and ECSO (Gou et al.), together with ICD, across three benchmarks and five open-weight MLLMs. These results also show how effective our ICL attacks remain under these defenses. On Qwen3-VL-8B, our method reduces ASR to 25.61 / 29.32 / 33.03 on MM-SafetyBench / AdvBench / JailbreakBench, versus 36.38 / 40.82 / 43.26 for AdaShield and 31.31 / 35.21 / 37.74 for ECSO, with higher utility than both (71.5 vs. 70.8 / 69.7; no defense: 72.1; Table 7). The advantage holds across model scales (Table 12) and on FigStep, the structure-based attack AdaShield was designed for (e.g., 5.8% vs. 9.8% on Kimi-VL-A3B; Table 13). As suggested, we additionally evaluate BlueSuffix (Zhao et al.). On Qwen3-VL-8B, our method achieves consistently lower ASR (25.61 / 29.32 / 33.03 vs. 31.72 / 33.18 / 37.69) with comparable utility (71.5 vs. 71.9). These results are added to Table 7.

W3: On posterior-based jailbreaks (VERA-V)

We thank the reviewer for the pointer and will discuss posterior-inference jailbreak approaches, including VERA-V, in the related work. Our study, however, is scoped to ICL jailbreaks, where harmful behavior is induced by in-context demonstrations, whereas VERA-V is a single-query attack without an in-context component. Moreover, the two posteriors are different objects. VERA-V learns an attacker-side variational distribution over adversarial text–image prompts, while we model the target model's posterior over latent safe/harmful modes, which the context updates. The two works therefore study jailbreaks from complementary angles, and a direct comparison is not essential to our claims. Nevertheless, we evaluate our defense against VERA-V. On Qwen3-VL-8B, it reduces ASR from 76.94% to 34.40%, compared with 38.16% for AdaShield and 43.87% for ECSO. We will add these results to the appendix.

Note on BlueSuffix. Due to limited GPU resources, we have so far completed the BlueSuffix comparison only under image-based attacks, which already provides evidence for the comparison. Its text and mixed-modal entries are marked "–" in Table 7 and will be replaced once these experiments complete.

Dear Reviewer 2nAd,

Thank you again for your feedback. As the discussion period ends soon, we would like to kindly check whether our response has addressed your concerns, in particular the clarification of our defense's novelty and the new comparisons with BlueSuffix and VERA-V. The revised manuscript is uploaded with all changes highlighted in blue. If our response resolves your concerns, we would be grateful if you could reconsider your evaluation. We are happy to address any remaining questions.

Best regards,

The Authors

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.