acceptodds
Under review as a conference paper at ICLR 2027

TrendGuard: Layer-Wise Safety Trend Learning for Pre-Generation Multimodal Guarding

Abstract

Multimodal jailbreaks can hide harmful intent in text, images, or their interactions, posing significant challenges for vision-language model safety. Existing safeguards either inspect generated responses, requiring full decoding before intervention, or monitor internal states before generation. While internal-state defenses are more efficient, existing approaches typically rely on isolated layer representations or order-agnostic aggregation, overlooking how safety evidence evolves across decoder depth. We present TrendGuard, a lightweight pre-generation guard for frozen large vision-language models (LVLMs) that explicitly models this evolution as a layer-wise safety trend. We observe that unsafe evidence follows distinct depth-wise patterns: layer-wise unsafe scores may rise, decline, or persist across decoder layers, and preserving such ordered trends enables discrimination between persistent unsafe evidence and transient risk-like activations. TrendGuard extracts last-token residual and MLP activations and learns sparse layer probes to obtain ordered unsafe scores across decoder depth. Based on these trends, we instantiate two representations: Trend-Abs, which captures absolute risk evolution through scores and interpretable trend statistics, and Trend-Rel, which further models class-conditional trend relationships using safe and unsafe prototypes. Experiments on seven LVLM backbones and four unsafe benchmarks demonstrate that TrendGuard achieves state-of-the-art low-FPR safety detection, improving AVG TPR@FPR≤0.05 by 6.36% on average over mainstream methods. Under the same false-positive budget, it achieves perfect recall on most benchmark–backbone pairs. Warning: this paper contains example data that may be offensive or harmful.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
ultimodal safety, jailbreak detection, large vision-language models, internal representations, pre-generation guarding, layer-wise safety trends

Reviews

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

The paper proposes TrendGuard, a pre-generation safety detector for multimodal large language models. It uses sparse probes on last-token residual and MLP representations to obtain layer-wise unsafe scores. Two variants classify these scores: Trend-Abs combines absolute scores, adjacent-layer differences, and trend statistics, while Trend-Rel measures relationships to class-conditional prototype trends. Experiments across seven backbones and four unsafe benchmarks report strong detection under a low false-positive constraint.

Critical strengths

1. Practical pre-generation detection. TrendGuard operates on frozen backbones during prompt prefill, enabling intervention before response generation. The lightweight probes and classification heads introduce little overhead in the reported throughput experiment.

2. Broad empirical coverage. The evaluation includes multiple model families, attack benchmarks, and benign datasets. The consistently high detection rates across the tested backbones provide evidence that the framework is applicable beyond a single architecture.

Critical weaknesses

W1. The paper doesn't show why the full layer-wise trajectory is needed. Figure 1 shows that safe and unsafe class-mean probe scores separate more with depth. That fits a simpler story just as well: deep layers carry the safety signal, so one well-chosen deep layer or an ordinary multi-layer classifier would be enough. The method trains a separate probe per layer and then hand-builds features on the scores (adjacent differences, onset, persistence, and so on). I don't see what this buys over, say, training a classifier on the concatenated layer scores, and the paper doesn't compare against such baselines.

W2. The gains are hard to credit to trend modeling specifically. Per-sample layer shuffling (Table 5) destroys both the order of the layers and which layer each score came from, so its drop to 2.56% may come from losing layer identity rather than depth dynamics. Also, in Table 5 the attack FNRs of Trend-Abs and Scores-only are nearly the same (all at or below 0.02%). The real difference is MM-Vet FPR (1.37% vs. 4.13%) at a fixed threshold t = 0.5, which could be a calibration difference rather than a better detector. Comparisons at matched FPR, and against stronger multi-layer baselines, would make the case much more convincing.

Questions for authors

Q1. How does TrendGuard compare with (a) the best single deep-layer probe picked on validation data and (b) a standard multi-layer classifier, such as logistic regression or a small MLP on the concatenated layer scores? "Last-layer only" and "Selected mid-late layers" in Table 5 partly cover (a); (b) is missing.

Q2. Does Trend-Abs still beat Scores-only when both are evaluated at the same benign FPR? Could you also add a control that keeps layer identity but breaks depth order, for instance a single fixed permutation of layers applied to every sample before computing the trend features? That would separate the effect of depth dynamics from that of layer identity.

Q3. All unsafe training data come from JailBreakV (600) and all safe data from MM-Vet (218) (lines 319-322). The guard could be learning "looks like JailBreakV vs. looks like MM-Vet" instead of unsafe vs. safe. How do you rule this out? Results on matched safe/unsafe pairs that share format and image source would help. Also, is the reported MM-Vet FPR computed only on MM-Vet examples that were not used for fitting or model selection?

Q4. Each layer has its own independently trained probe, so scores at different layers may differ in scale or calibration. How do you know the trend reflects the safety signal changing with depth, rather than differences between probes? Do the trends and the gains survive per-layer calibration (e.g., temperature scaling each probe on validation data)?

Q5. The robustness test lowers unsafe scores by δ = 0.2 on 8 of the 28 layers. That is a feature-space perturbation, not an attack anyone could actually run. How does TrendGuard hold up against an adaptive image-text attack that optimizes the input to fool both the guard and the underlying LVLM?

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

This paper proposes TrendGuard, a pre-generation jailbreak detection framework that models layer-wise safety trends in large vision-language models. It employs sparse linear probes to extract safety scores from different Transformer layers and introduces two trend representations, Trend-Abs and Trend-Rel, to identify potentially harmful inputs. Experiments across seven LVLMs and four jailbreak benchmarks demonstrate strong detection performance under low false-positive constraints.

Critical strengths

The paper introduces an interesting perspective on multimodal jailbreak detection by modeling the evolution of safety signals across Transformer layers rather than relying on isolated hidden states. The proposed method achieves strong detection performance across multiple LVLMs and jailbreak benchmarks while keeping the backbone frozen and requiring relatively few additional trainable parameters, demonstrating its potential for efficient pre-generation safety detection.

Critical weaknesses
  1. Although the paper includes ablations on single-layer detection and layer shuffling, it does not sufficiently distinguish the benefits of cross-layer trend modeling from those of multi-layer score aggregation. In particular, Trend-Abs directly retains raw scores from all layers, suggesting that its improvements may primarily come from multi-layer feature fusion rather than explicit trend modeling.
  2. The paper lacks comparisons with recent works, including Learning to Detect Unknown Jailbreak Attacks in Large Vision-Language Models and One Head to Rule Them All: Amplifying LVLM Safety through a Single Critical Attention Head. Furthermore, its robustness against attacks such as Activation Manipulation Attack: Penetrating and Harmful Jailbreak Attack Against Large Vision-Language Models and Exploring Visual Vulnerabilities via Multi-Loss Adversarial Search for Jailbreaking Vision-Language Models remains unexplored..
Questions for authors
  1. Can the authors further distinguish the performance gains from explicit cross-layer trend features versus simple multi-layer score aggregation?
  2. Can the authors provide comparisons with LoD and One-head Defense, and evaluate robustness against the aforementioned attacks and adaptive white-box attacks?
1 comment
AuthorsOpenReview ↗

We clarify what the Scores-only ablation measures and add comparisons with LoD and One-head.

W1

Scores-only in Table 5 is already a direct baseline based on concatenating scores from multiple layers. It retains all probe scores in layer order, concatenates them, and feeds them to an MLP, omitting differences between adjacent layers and statistical features. On Qwen2.5-VL-3B, the full Trend-Abs method has an average error rate of 0.28%, compared with 0.83% for Scores-only.

W2&Q2

We used widely adopted methods as references to make comparisons easier. Thank you for your feedback. The code for Learning to Detect Unknown Jailbreak Attacks in Large Vision-Language Models became available relatively late. We have added these experimental results and compared performance using the metric from that paper. We will include the results in the final version. We reproduced and evaluated LoD and One-head. We sampled 1,000 examples from each of the datasets we used to form a combined dataset of 3,500 examples and compared them with our method on Qwen2.5-VL-3B. The evaluation metric is TPR at FPR < 0.05. Our method outperformed both methods. The released One-head code supports only LLaVA-1.6. We adapted it to Qwen2.5 following the paper's description and found that it generalized very poorly, producing a very high misclassification rate on Qwen2.5. To ensure a rigorous comparison, we also evaluated One-head on LLaVA-v1.6-Vicuna-13B. One-head relies on a single critical attention head with limited capacity to capture safety signals, which makes it less able to generalize to different attack types. As a result, the signal from a single head is insufficiently stable across datasets under a strict low-FPR constraint.

Qwen2.5-VL-3B

MethodJailBreakVFigStepMM-SafetyBenchJAMLLMAverage
Trend-abs100.00%100.00%100.00%100.00%100.00%
LoD94.4%100.00%100.00%100.00%98.60%
One-head13.70%0.00%12.60%0.20%6.62%

LLaVA-v1.6-Vicuna-13B

MethodJailBreakVFigStepMM-SafetyBenchJAMLLMAverage
Trend-abs99.90%100.00%99.50%100.00%99.85%
One-head41.40%69.60%7.30%0.90%29.80%

The TPR evaluation requires FPR < 0.05, so the One-head decision threshold was raised to 5.5. We also evaluated it at the fixed threshold of 0.3 specified in the paper.

MethodJailBreakVFigStepMM-SafetyBenchJAMLLMAverage
One-head84.30%96.40%51.70%27.80%65.05%

Q1

The Scores-only ablation in Table 5 was designed to distinguish explicit cross-layer trend features from simple multilayer score aggregation. Scores-only and the full Trend-Abs method use the same frozen backbone, the same layer-wise safety probes, and the same ordered safety scores from all decoder layers. Scores-only concatenates the layer-wise scores and feeds them to an MLP. Trend-Abs additionally includes changes between adjacent layers and statistics such as onset, persistence, peak location, and late-layer correction. Scores-only is therefore already an order-preserving multilayer score aggregation baseline that retains all multilayer information and layer positions. We may have explained the purpose of this experiment unclearly in the paper. We will clarify the definition of Scores-only and the rationale for the experiment. Selected results from Table 5 are shown below. All rates are in percent.

MethodJailBreakV FNRFigStep FNRMM-SafetyBench FNRJAMLLM FNRMM-Vet FPRAverage
Trend-abs0.010001.370.28
Score only0.020004.130.83
Reviewer_WTy8OpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This work presents TrendGuard, a lightweight pre-generation guarding framework for frozen large vision-language models (LVLMs) that models this evolution as a layer-wise safety trend while supporting different feature formulations over the resulting ordered signal.Within this framework, the author instantiate two effective trend feature formulations: Trend-Abs, which combines absolute scores, adjacent layer changes, and interpretable trend statistics, and Trend-Rel, which models class-conditional relationships to safe and unsafe prototype trends. Experimental results substantially outperforming several existing methods.

Critical strengths

1、Focus A practical problem. The method exploits intermediate representations offers an efficient alternative to response-based safety monitoring. 2、A interesting layer-wise angle. The observation that safety-related signals evolve differently across decoder layers provides a reasonable motivation for incorporating cross-layer information into safety detection. 3、Comprehensive experimental results. The paper evaluates multiple LVLM architectures, several jailbreak benchmarks, and different training-data scales. The improvements over existing baselines are substantial.

Critical weaknesses

1、Limited method novelty. The proposed method combines layer-wise linear probing, handcrafted statistical features, and prototype-based classification. These components are well established. Explicitly modeling safety trends provides fundamental advantages over simpler multi-layer feature aggregation or supervised classifiers with comparable capacity are not sufficiently demonstrated. 2、Insufficient evidence for the importance of layer-wise dynamics. Stronger comparisons against order-preserving multi-layer concatenation, learned layer weighting, and alternative aggregation methods are needed. 3、Concerns regarding near-perfect detection performance. The reported results approach 100% TPR across nearly all datasets and backbones, despite using a relatively small training set. Such performance is remarkable. The authors should investigate potential dataset-specific shortcuts, semantic overlap between training and evaluation distributions, and robustness against adaptive or previously unseen attacks. 4、Limited evaluation of real-world safety effectiveness. The method predicts whether an input belongs to an unsafe or jailbreak-related category, but this does not necessarily indicate whether the target LVLM would actually generate harmful responses. Safety–utility trade-off when TrendGuard is deployed as an actual guard can be further discussed.

Questions for authors

1、Unsafe signals only appear in a narrow contiguous layer window and vanish in deeper layers, how robust is TrendGuard? 2、How does TrendGuard compare with a capacity-matched classifier trained directly on concatenated layer-wise probe scores, without handcrafted trend statistics or prototype features? 2、Why the layer-shuffling experiment should be interpreted as evidence for the importance of layer-wise safety dynamics ?

2 comments
AuthorsOpenReview ↗

We compare Trend-Abs with Scores-only, Learned layer weight, and Raw feature layer weight. We also analyze dataset overlap and signal persistence, and clarify how TrendGuard handles flagged inputs.

W1

Our contribution is a guard framework that uses trend features from all intermediate layers of the model, has a small number of parameters, and provides better protection. The framework also supports different intermediate-layer representations, which can all perform well. We thank the reviewer for pointing out this important distinction. Compared with simple layer aggregation, the main advantage of modeling trends across layers is that it explicitly preserves how safety signals change with depth. Mean pooling, max pooling, and learned weighting mainly reflect overall risk intensity, making it difficult to distinguish a signal that appears briefly in shallow layers and then disappears from one that continues to strengthen in deeper layers. We would also like to clarify that Scores-only in Table 5 is already a direct baseline based on concatenating scores from multiple layers. It retains all probe scores in layer order, concatenates them, and feeds them to an MLP, omitting differences between adjacent layers and statistical features. On Qwen2.5-VL-3B, the average error rate is 0.28% for the full Trend-Abs method and 0.83% for Scores-only.

W2

Scores-only in Table 5 retains information from multiple layers and omits explicit differences and statistics. This partly answers whether fusion across layers is sufficient, and it uses the same multilayer concatenation approach you mentioned. The paper did lack stronger comparisons such as learned layer weighting, and we have added the corresponding experiments. We would like to clarify that most features can perform well in our framework, and aggregating features across all layers is one approach we found particularly effective. Our claim does not require performance to depend on the model's original layer order. Some statements in the paper may have made this unclear, and we will narrow their scope.

We sampled 1,000 examples from each evaluation set to form a combined dataset of 3,500 examples and evaluated on Qwen3.5-0.8B. For the Learned layer weight setting, we learn one weight per layer and feed the resulting weighted score to an MLP. We also tested Raw feature layer weight, which aggregates the raw features using learned weights. Raw feature layer weight performed worse than Learned layer weight. We think this is because weighting raw features requires both extracting safety information and combining it across layers. Weighting scores only requires combining safety signals that have already been extracted, so it usually performs better.

SettingJailBreakVFigStepMM-SafetyBenchJAMLLMAverage
Trend-Abs100.00%100.00%100.00%100.00%100.00%
Learned layer weight99.60%100.00%99.90%100.00%99.87%
Raw feature layer weight98.60%99.80%99.40%100.00%99.45%

W3

As shown in Tables 1 and 2, we evaluated our method on attack datasets that were not used for training, including FigStep, MM-SafetyBench, and JAMLLM, and on benign datasets such as MMBench, SEED-Bench, and ScienceQA. These results suggest that what our method learned goes beyond dataset-specific shortcuts and semantic distributions. We understand your concern. To address it, we drew on Deduplicating Training Data Makes Language Models Better and sampled examples to check lexical overlap across datasets. A higher Jaccard similarity score indicates greater lexical overlap between the sample and the training data. In our results, substantial lexical overlap was observed only on the dataset from the same source as the training set, where 81% of examples had a Jaccard similarity above 0.5. The lexical overlap with the training set was close to zero for datasets from different sources, especially FigStep and JAMLLM.

DatasetNumber sampledJaccard > 0.9Jaccard > 0.75Jaccard > 0.5
JailBreakV2,0005131,2381,621
FigStep500000
MM-SafetyBench2,0001016841,490
JAMLLM2,000007

W4

TrendGuard is intended to protect the model by examining its internal representations. When TrendGuard detects an unsafe input, it stops normal decoding and returns a fixed refusal response. It allows generation only when the input is detected as safe. Under this policy, the detector's false-negative rate equals the guard bypass rate on unsafe inputs, and the false-positive rate on benign inputs equals the additional benign refusal rate caused by the guard. Our evaluation protocol is consistent with commonly used evaluation protocols.

Q1

Thank you for raising this interesting question. In Appendix Table 7, we analyzed high-risk occupancy across decoder layers using probe scores on Qwen2.5-VL-7B. Approximately 72%–99.9% of the probed layers exceeded the descriptive probe-score threshold on FigStep, MM-SafetyBench, and JAMLLM. This suggests that unsafe signals on the current benchmarks are usually persistent. Some models may show an unsafe signal only within a narrow window of consecutive layers, with the signal disappearing in deeper layers. The Qwen3.5 trend plot in Appendix Figure 8 shows that unsafe signals in this model are very short-lived, yet our framework still performs well. To further address your concern, we sampled the data and measured the longest contiguous run of layers in which the probe score stayed above the high-risk threshold. No samples had a longest run shorter than 25% of the layers, and only a small number had runs covering 25%–50% of the layers. The guard detected all such samples.

Dataset<25%25%–50%50%–75%75%–100%
JailBreakV0224974
FigStep013335152
MM-SafetyBench0216982
JAMLLM0090793

Q2

Scores-only in Table 5 is already a direct baseline based on concatenating scores from multiple layers. It retains all probe scores in layer order, concatenates them, and feeds them to an MLP, omitting differences between adjacent layers and statistical features. On Qwen2.5-VL-3B, the average error rate is 0.28% for the full Trend-Abs method and 0.83% for Scores-only.

Q3

Our experiments classify inputs using feature representations constructed through the trend analysis shown in Figure 1. Layer shuffling provides a counterfactual control that preserves the layer-wise scores and disrupts their depth structure. For each sample, the set of probe scores is exactly the same before and after shuffling. Their number, values, and overall distribution stay the same. Only the mapping between scores and layer depths changes, along with the adjacent-layer differences and statistics defined by this mapping. Shuffling distorts the trends to some extent and makes the feature semantics more complex. If detection performance drops substantially after shuffling, this suggests that an unordered set of the same multilayer scores is insufficient for the original classification task. The model also relies on how those scores evolve in a structured way across network depth.

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

Related papers

Loading the map…

Discussion (0)

Sign in to comment.