acceptodds
Under review as a conference paper at ICLR 2027

Reading Between the States: Contrasting Hidden-State Dynamics for Jailbreak Detection

Abstract

Jailbreak attacks disguise harmful requests through diverse prompt constructions, posing a persistent threat to the safe deployment of large language models (LLMs). Recent defenses increasingly exploit internal hidden-state patterns across layers for jailbreak detection. However, these approaches fall short of explicitly modeling the underlying transition relationships, leaving their predictive value underexplored as generalizable detection evidence. Crucially, while unseen attacks exhibit unfamiliar trajectories, their state transitions often follow predictive regularities shared with known jailbreaks. This suggests a distinct detection principle: identifying which class-specific dynamics better predict the observed evolution. To realize this principle, we introduce **CORD** (**C**ompeting **O**perator **R**esidual **D**etection), which detects jailbreaks by comparing two predictive explanations of hidden-state evolution. CORD learns benign and jailbreak dynamical models through a conditional Koopman formulation, using shared observables to model transitions across token progression and network depth. Both models predict the same observed successors under identical context, making their prediction errors directly comparable. The resulting residual contrast assigns higher risk when jailbreak dynamics explain the observed evolution better than benign dynamics. Extensive experiments across four LLMs and ten attack families show that CORD achieves 93.94% macro TPR@1, surpassing the strongest evaluated baseline by 38.17%. Comprehensive experimental analyses demonstrate that predictive contrast captures discriminative differences between benign and jailbreak hidden-state dynamics, providing a promising basis for detecting unseen jailbreak attacks. Code: https://anonymous.4open.science/r/CORD-8DF6114514/anonymous repository.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
Large Language Models, Jailbreak Detection, AI Safety

Reviews

Among:
Shape:
1234this paper, Top 15%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 3.00 over 3 reviews, above 85% of the others.
Reviewer_LeRYOpenReview ↗
Rating
3
Confidence
3
Informativeness
3
Presentation
3
Soundness
3
Read review
Paper summary

This paper proposes CORD, a jailbreak detection method that compares the prediction errors of benign and jailbreak hidden-state dynamics using conditional Koopman operators. The method models transitions along both token and layer dimensions and uses their residual contrast for detection. Experiments on four LLMs and ten attack families show strong performance, achieving 93.94% macro TPR@1.

Critical strengths
  1. The idea of detecting jailbreaks through contrasting hidden-state dynamics is interesting and well motivated, offering a different perspective from existing representation-based methods.

  2. The experimental results are strong across multiple models and attack families, with substantial improvements over existing baselines.

  3. The matched-input comparisons, ablation studies, and theoretical analysis provide useful evidence supporting the proposed design.

Critical weaknesses
  1. The evaluation is limited to leave-one-attack-family-out settings. It remains unclear how well the method generalizes to genuinely novel or adaptive jailbreak attacks.

  2. The benefits of the Koopman formulation are not fully isolated. Comparisons with simpler predictive models, such as MLP-based or unconstrained linear predictors, would help clarify its necessity.

  3. The false positive rates increase on challenging benign inputs when using the original calibration thresholds, raising concerns about robustness under benign distribution shifts.

  4. The theoretical results rely on assumptions that are not empirically verified, and their connection to the observed detection improvements could be better established.

Questions for authors

Please refer to weaknesses.

2 comments
AuthorsOpenReview ↗

Author Response to Reviewer LeRY(1/2)

Thank you very much for your positive comments and insightful suggestions. We have carefully considered each point and provide our responses below.

Q1: How well does CORD generalize to genuinely novel or adaptive jailbreak attacks?

Response: Thank you for your valuable suggestion! Following your suggestion, we have conducted an additional comparison against four baselines on five new attacks published in 2026, using Qwen2.5-7B. The results show that CORD achieves the best or joint-best TPR@1 on all five attacks. We would like to clarify that all five attacks were excluded from training and tuning. AGILE yields CORD's lowest detection rate among the five attacks, but CORD still clearly outperforms every baseline. These empirical results demonstrate that CORD generalizes to new attacks beyond the training families.

External attackCORD (Ours)MTKJBShield-DGraphShieldGradSafe
AGILE [1]67.50%22.50%16.00%17.50%29.00%
SpatialJB [2]100.00%0.00%0.00%100.00%0.00%
LogiBreak [3]100.00%0.00%0.00%0.00%0.00%
StegoAttack [4]100.00%0.00%0.00%100.00%0.00%
CAGE [5]100.00%0.00%0.00%97.00%0.00%

Adaptive attacks

Thank you for raising this concern. Your comment has encouraged us to examine this setting more carefully. As suggested, we tested score-feedback suffix search on Llama3, and TPR@1 fell from 96.20% to 0.00%. Since attackers can use score queries to guide black-box search, they can optimize prompts to evade detection. The detection score is also differentiable with respect to hidden representations. This result indicates room for improvement in defending against adaptive attacks. As per your comment, we have added a Limitations section to the revised manuscript and discussed this limitation.

References:

[1] AGILE: Activation-Guided Local Editing for Jailbreaking Attacks

[2] SpatialJB: How Text Distribution Art Becomes The "Jailbreak Key" for LLM Guardrails

[3] LogiBreak: Logic Jailbreak: Efficiently Unlocking LLM Safety Restrictions Through Formal Logical Expression

[4] StegoAttack: Hiding in Plain Sight: A Steganographic Approach to Stealthy LLM Jailbreaks

[5] CAGE: Concept Algebra for Guardrail Evasion and Jailbreak Attacks via Lexical-Semantic Decoupling

Q2: How does CORD compare with simpler MLP-based or unconstrained linear predictors?

Response: Thank you for this insightful suggestion regarding the predictive controls. To examine the contribution of the Koopman structure, we compared CORD with three simpler predictors. CORD achieves the highest ten-family mean TPR@1 on the four evaluated models, including in comparison with the nonlinear dual predictor. The class-conditional MLP keeps the two-predictor residual score but replaces the Koopman operators with nonlinear networks. The unconstrained autonomous linear predictor uses KzKz without control inputs or spectral constraints. Persistence repeats the current state and uses the absolute prediction residual as the detection score.

Empirical results show that CORD exceeds the MLP predictor by 11.43%-21.53%. Interestingly, the more flexible nonlinear MLP performs worse than the linear predictor on three models. In this comparison, the more flexible predictor does not consistently improve detection on held-out families. Some controls perform particularly poorly on individual attacks. Persistence reaches 1.67% on Llama2-Base64, where CORD reaches 100.00%. The unconstrained linear predictor reaches 1.67% on Qwen2.5-DrAttack, where CORD reaches 90.67%. The advantage is evident both in mean detection rates across attack families and in the results on individual attacks that simpler predictors largely fail to detect. These comparisons support the use of structured Koopman prediction as an effective design choice for detecting unseen attack families.

ModelCORD (Ours)Unconstrained autonomous linearPersistenceMLP predictor
Llama2-7B-Chat93.27%89.40%71.90%81.33%
Llama3-8B-Instruct95.63%91.27%93.23%84.20%
Qwen2.5-7B92.23%72.20%72.57%75.40%
Mistral-7B-Instruct-v0.294.63%82.40%70.10%73.10%
AuthorsOpenReview ↗

Author Response to Reviewer LeRY(2/2)

Q3: How robust is CORD to benign distribution shifts at the original calibration threshold?

Response: Thank you for your valuable comment on benign distribution shift. We have evaluated robustness to benign distribution shifts by applying each detector's original threshold to ordinary benign prompts, OKTest, and XSTest-safe without recalibration. Attack detection remains above 92% on all four models. Ordinary-benign FPR stays close to 1%, and FPR on OKTest and XSTest-safe stays below 5%. The hard-benign prompts cause more false alarms, but the increase is moderate. CORD therefore maintains a useful balance between detection and false positives under this distribution shift.

Target modelAttack TPROrdinary-benign FPROKTest FPRXSTest FPR
Llama2-7B-Chat93.27%1.67%4.40%3.88%
Llama3-8B-Instruct95.63%1.17%3.93%2.64%
Qwen2.5-7B92.23%1.20%1.57%3.32%
Mistral-7B-Instruct-v0.294.63%1.27%4.57%2.20%

Q4: Are the theoretical assumptions empirically supported, and how do they relate to detection gains?

Response: Thanks for your insightful suggestion regarding the connection between theory and empirical results. Proposition 1 predicts a positive expected residual difference, Δ=Eother−Eown\Delta = E_{\mathrm{other}} - E_{\mathrm{own}}, when the separation between the two predictors’ forecasts exceeds the prediction bias of the correct-class predictor. Proposition 2 describes when this advantage carries over to held-out families. To test these predictions, we compared the two predictors' errors on benign prompts, seen attacks, and held-out attacks, using the same targets in the same observable space. For a more controlled comparison, we also matched seen and held-out attacks by their recorded harmful goals. We excluded GPTFuzz, IJP, and JailJudge because they have no exact goal matches, leaving seven attack families.

Across four models and ten attack families, the 95% paired bootstrap interval is above zero in all 40 benign and all 40 seen-family combinations at each horizon. For held-out attacks, the counts range from 37 to 38 of 40 across the three prediction horizons. The correct-class prediction advantage therefore persists on most held-out families, consistent with the predicted transfer. In the matched-goal comparison, the 95% interval remains above zero in 26-27 of 28 held-out combinations across the three prediction horizons. The advantage thus persists when attacks share the same goal but use different methods. These observations are consistent with the theoretical premise of a transferable relative prediction advantage and provide an empirical basis for the detection gains.

Evaluation settingCohort1 step2 steps4 steps
4 models x 10 familiesbenign40/4040/4040/40
4 models x 10 familiesNon-fit seen-family attacks40/4040/4040/40
4 models x 10 familiesHeld-out-family attacks37/4038/4038/40
4 models x 7 matchable familiesSeen-family attacks28/2828/2828/28
4 models x 7 matchable familiesHeld-out-family attacks26/2827/2827/28

Thank you again for your valuable time and efforts in reviewing this paper! We have revised the paper following your constructive and insightful comments. Your valuable feedback has helped us present our work more clearly and comprehensively. If any questions remain unresolved, we appreciate the opportunity for further discussion and clarification.

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

This paper proposes CORD: In a shared hidden-state representation space, it learns benign and jailbreak conditional classifiers, predicts successor states along both the token and network-depth directions, and then performs discrimination using differences in normalized prediction residuals. Through extensive experiments, the paper demonstrates that CORD achieves better generalization to unseen attacks than existing work. In addition, the paper conducts component ablation and multi-step prediction ablation experiments, demonstrating the effectiveness of the proposed method.

Critical strengths

The detection idea is novel. Rather than predicting directly from the hidden state, this paper compares the predictive capabilities of two models for different categories of the same successor state. The common target variance in the two types of prediction errors cancels out, leaving only the difference between the two predictors’ distances from the true conditional mean.

Critical weaknesses

The mathematical analysis explains why residual contrast has discriminative power when class predictions are separated and within-class prediction bias is small, but it does not adequately explain why these conditions hold for unseen jailbreak attacks. Same-input classification controls and multi-step prediction experiments provide positive evidence, but they are still insufficient to distinguish transferable transition regularities, class-related semantics and surface features. I recommend adding controlled evaluations matched in semantics and form, as well as comparisons with a general dual-predictor, to clarify the source of the detection gain and the unique contribution of the Koopman structure.

Questions for authors

To assess whether the detection gains reflect transferable predictive structure, could the authors report both predictors’ errors and their gains over persistence on benign prompts, seen attacks, and held-out attack families? Please evaluate these quantities using the same fitted observable space, targets, and include uncertainty estimates for the relative residual advantage. Does the held-out detection advantage primarily arise from better correct-class prediction, larger competing-model errors, or both?

2 comments
AuthorsOpenReview ↗

Author Response to Reviewer HP7N(1/2)

We sincerely appreciate your positive assessment of our work and your valuable suggestions. We have carefully considered all feedback and provide our responses to each point below. If any concerns remain unresolved, we appreciate the opportunity for further discussion and clarification.

Q1: How does CORD compare with a general dual-predictor and the persistence baseline?

Response: We appreciate your insightful suggestion regarding the predictor comparisons. As per your suggestion, We have extended the detection comparison to three controls, namely a persistence baseline, an unconstrained autonomous linear predictor, and an MLP dual predictor. Persistence repeats the current state and uses the absolute prediction residual as the detection score. The unconstrained autonomous linear predictor uses KzKz without control inputs or spectral constraints. The MLP dual predictor keeps the two-predictor residual score but replaces the Koopman operators with nonlinear networks.

Empirical results show that CORD exceeds the MLP predictor by 11.43%-21.53%. Interestingly, the more flexible nonlinear MLP performs worse than the linear predictor on three models. In this comparison, the more flexible predictor does not consistently improve detection on held-out families. Some controls perform particularly poorly on individual attacks. Persistence reaches 1.67% on Llama2-Base64, where CORD reaches 100.00%. The unconstrained linear predictor reaches 1.67% on Qwen2.5-DrAttack, where CORD reaches 90.67%. The advantage is evident both in mean detection rates across attack families and in the results on individual attacks that simpler predictors largely fail to detect. These comparisons support the use of structured Koopman prediction as an effective design choice for detecting unseen attack families.

ModelCORD (Ours)Unconstrained autonomous linearPersistenceMLP predictor
Llama2-7B-Chat93.27%89.40%71.90%81.33%
Llama3-8B-Instruct95.63%91.27%93.23%84.20%
Qwen2.5-7B92.23%72.20%72.57%75.40%
Mistral-7B-Instruct-v0.294.63%82.40%70.10%73.10%

Q2: Does the detection advantage come from better correct-class prediction, larger competing-model errors, or both?

Response: Thanks for this valuable suggestion. To investigate the source of the advantage in depth, we have examined the MSE of each predictor across prediction horizons. For benign prompts, "own" refers to the benign predictor. For attacks, it refers to the jailbreak predictor. "Other" always refers to the competing predictor. Each table cell contains the two ten-family means in the order own / other.

The empirical results indicate that both factors contribute, but in different ways. On held-out attacks, the correct-class error stays close to its level on seen attacks, revealing that the correct-class predictor remains accurate when the attack family changes. Meanwhile, as prediction extends from one to four steps, both errors increase, but the error of the competing predictor consistently increases faster. As a result, the gap between their prediction errors widens on the four evaluated models. These observations demonstrate that multi-step prediction makes the difference between the two class-specific dynamics more pronounced. CORD uses this difference as a discriminative signal for detection.

ModelEvaluation cohort1 step: own / other2 steps: own / other4 steps: own / other
Llama2-7B-Chatbenign0.1195 / 0.17280.2263 / 0.39090.3922 / 0.8077
Llama2-7B-ChatNon-fit seen-family attacks0.0905 / 0.15580.1725 / 0.37100.2964 / 0.7874
Llama2-7B-ChatHeld-out-family attacks0.0999 / 0.13900.1926 / 0.31150.3398 / 0.6310
Llama3-8B-Instructbenign0.0662 / 0.08800.1135 / 0.18820.1885 / 0.4030
Llama3-8B-InstructNon-fit seen-family attacks0.0622 / 0.09070.1076 / 0.20540.1784 / 0.4664
Llama3-8B-InstructHeld-out-family attacks0.0685 / 0.08780.1162 / 0.18100.1923 / 0.3775
Qwen2.5-7Bbenign0.1408 / 0.14820.2326 / 0.25820.3579 / 0.4315
Qwen2.5-7BNon-fit seen-family attacks0.1334 / 0.14300.2187 / 0.25260.3375 / 0.4452
Qwen2.5-7BHeld-out-family attacks0.1470 / 0.15180.2281 / 0.24490.3301 / 0.3842
Mistral-7B-Instruct-v0.2benign0.0832 / 0.09280.1481 / 0.18040.2474 / 0.3393
Mistral-7B-Instruct-v0.2Non-fit seen-family attacks0.0732 / 0.08210.1361 / 0.16700.2375 / 0.3328
Mistral-7B-Instruct-v0.2Held-out-family attacks0.0765 / 0.07980.1352 / 0.14610.2225 / 0.2554
AuthorsOpenReview ↗

Author Response to Reviewer HP7N(2/2)

Q3: Do the detection gains reflect transferable predictive structure, and what is the uncertainty in the relative residual advantage?

Response: Thank you for your insightful and constructive comments! Following your suggestion, we have added a paired comparison of prediction errors on benign prompts, seen attacks, and held-out attacks. Empirical results show that the correct-class predictor has lower mean error on both seen and held-out attacks. We quantify the relative residual advantage as Δ=Eother−Eown\Delta = E_{\mathrm{other}} - E_{\mathrm{own}}, where the two terms denote the MSE of the competing and correct-class predictors, respectively. Positive values indicate lower error for the correct-class predictor. For your convenience, we list the empirical results on the uncertainty in the relative residual advantage below. More specifically, the table below reports the ten-family mean difference and its 95% paired bootstrap confidence interval. We would like to clarify that both predictors are evaluated in the same observable space and on the same targets. We calculate the intervals with 2,000 bootstrap samples. For each bootstrap replicate, we resample whole prompts within each attack family, using the same prompts for both predictors.

We further examine the four models and ten held-out attack families separately. Across the three horizons, the 95% confidence interval stays above zero in 37-38 of 40 combinations, and all model-level averages below are positive. In addition, we observe that the gap is smaller on held-out attacks than on seen attacks, while it grows with the prediction horizon in both groups. These positive lower confidence bounds provide evidence that the relative residual advantage is robust to prompt resampling. Together, these results indicate the presence of transferable predictive structure.

ModelEvaluation cohort1-step Δ\Delta [95% CI]2-step Δ\Delta [95% CI]4-step Δ\Delta [95% CI]
Llama2-7B-Chatbenign0.0532 [0.0500, 0.0566]0.1646 [0.1549, 0.1748]0.4154 [0.3916, 0.4406]
Llama2-7B-ChatNon-fit seen-family attacks0.0653 [0.0638, 0.0668]0.1985 [0.1939, 0.2030]0.4910 [0.4797, 0.5019]
Llama2-7B-ChatHeld-out-family attacks0.0391 [0.0385, 0.0397]0.1189 [0.1171, 0.1205]0.2912 [0.2868, 0.2952]
Llama3-8B-Instructbenign0.0219 [0.0207, 0.0231]0.0747 [0.0707, 0.0787]0.2145 [0.2028, 0.2259]
Llama3-8B-InstructNon-fit seen-family attacks0.0285 [0.0278, 0.0293]0.0978 [0.0954, 0.1003]0.2880 [0.2812, 0.2950]
Llama3-8B-InstructHeld-out-family attacks0.0193 [0.0190, 0.0196]0.0647 [0.0638, 0.0657]0.1851 [0.1824, 0.1879]
Qwen2.5-7Bbenign0.0074 [0.0071, 0.0078]0.0256 [0.0244, 0.0269]0.0735 [0.0699, 0.0773]
Qwen2.5-7BNon-fit seen-family attacks0.0096 [0.0094, 0.0098]0.0339 [0.0331, 0.0347]0.1077 [0.1054, 0.1101]
Qwen2.5-7BHeld-out-family attacks0.0047 [0.0046, 0.0048]0.0168 [0.0165, 0.0172]0.0541 [0.0531, 0.0551]
Mistral-7B-Instruct-v0.2benign0.0096 [0.0092, 0.0101]0.0324 [0.0309, 0.0339]0.0919 [0.0879, 0.0962]
Mistral-7B-Instruct-v0.2Non-fit seen-family attacks0.0089 [0.0087, 0.0091]0.0309 [0.0302, 0.0316]0.0953 [0.0932, 0.0976]
Mistral-7B-Instruct-v0.2Held-out-family attacks0.0032 [0.0032, 0.0033]0.0109 [0.0106, 0.0112]0.0329 [0.0321, 0.0337]

Cross-family generalization with matched harmful goals

Following your suggestion, we have compared seen and held-out attacks that share the same harmful goal but use different attack methods. We exclude GPTFuzz, IJP, and JailJudge because they have no exact goal matches. On held-out attacks, the error difference has a 95% confidence interval above zero in 26-27 of 28 combinations across the three prediction horizons. The correct-class predictor therefore retains its advantage across attack methods. These findings demonstrate that CORD captures shared predictive structure across different attack forms.

Matched-goal subset1 step2 steps4 steps
Seen-family attacks28/2828/2828/28
Held-out-family attacks26/2827/2827/28

We sincerely appreciate the time and effort you have devoted to reviewing our paper. We have revised the paper following your constructive and insightful comments. We believe our paper has benefited a lot from your comments, and its presentation is now clearer and more complete. Thanks again!

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

This paper proposes CORD (Competing Operator Residual Detection), a jailbreak detection framework that distinguishes benign prompts from jailbreak attempts by comparing class-conditioned predictions of LLM hidden-state evolution. The central hypothesis is that, even when previously unseen jailbreak attacks exhibit unfamiliar hidden-state trajectories, they may retain transition dynamics that are more consistent with known jailbreaks than with benign inputs.

CORD models hidden-state transitions along both token positions and Transformer layers using conditional Koopman operators. It constructs a shared observable representation and learns separate predictive dynamics for benign and jailbreak inputs. Given a new prompt, both predictors forecast the same successor states under identical contextual conditions. The relative prediction errors are then used to compute a jailbreak risk score, with higher risk assigned when the jailbreak-specific dynamics provide a better explanation of the observed hidden-state evolution.

The authors evaluate CORD on four open-source LLMs and ten jailbreak attack families using a leave-one-attack-family-out evaluation protocol. CORD achieves a macro TPR of 93.94% at a calibrated 1% false-positive rate, substantially outperforming the strongest evaluated baseline at 55.77%. Additional experiments compare CORD with direct hidden-state classification and single-step predictive modeling, examine the contribution of token- and depth-wise dynamics, and evaluate performance on challenging benign inputs.

Overall, the paper argues that contrasting predictive hidden-state dynamics provides a more effective signal for detecting previously unseen jailbreak attacks than relying solely on descriptive representations of hidden-state trajectories.

Critical strengths
  1. Novel and well-motivated approach to jailbreak detection.

The paper introduces a distinctive perspective on jailbreak detection by modeling and contrasting class-conditioned hidden-state dynamics rather than relying solely on static representations or descriptive structural features. The use of competing benign and jailbreak predictors provides an intuitive and technically motivated detection criterion. In particular, the conditional Koopman formulation across token and layer dimensions represents an interesting application of predictive dynamical modeling to LLM safety.

  1. Substantial performance improvements over existing detection methods.

CORD demonstrates strong detection performance across four open-source LLMs and ten jailbreak attack families. The reported macro TPR of 93.94% at a calibrated 1% FPR substantially exceeds the strongest evaluated baseline (55.77%). The consistent improvements across different models and attack families provide encouraging evidence for the effectiveness of the proposed approach.

  1. Comprehensive comparisons and informative ablation studies.

The paper includes comparisons with several representative jailbreak detection methods, including MTK, JBShield-D, GraphShield, and GradSafe. Importantly, the authors also conduct matched-input comparisons against direct hidden-state classification and simpler predictive alternatives. The ablation studies examining token-wise and depth-wise dynamics further support the importance of jointly modeling both dimensions. These experiments help establish that the performance improvements are not merely attributable to the use of hidden-state information.

  1. Meaningful evaluation of generalization to unseen attack families.

The leave-one-attack-family-out evaluation protocol is a strength of the experimental design. By excluding the target attack family during detector training, the authors provide a more meaningful assessment of generalization than conventional random train-test splits. This setup is particularly relevant to jailbreak detection, where previously unseen attack strategies frequently emerge.

  1. Systematic methodological formulation and supporting theoretical analysis.

The paper presents a structured mathematical formulation of class-conditioned predictive dynamics and the residual-contrast detection criterion. The accompanying theoretical analysis provides conditions under which the correct class predictor is expected to achieve a prediction-error advantage. Together with the experimental investigations, this contributes to a technically substantive presentation of the proposed method.

Critical weaknesses
  1. Insufficient evaluation of detection performance on verified successful jailbreaks.

A major concern is whether the reported detection performance adequately reflects the ability to identify jailbreak attempts that successfully bypass the safety mechanisms of the target LLMs. The evaluation primarily uses prompts collected from established jailbreak attack datasets, but it is not sufficiently clear whether these prompts are independently verified to produce successful jailbreak outcomes for each evaluated model.

An attack prompt generated by a jailbreak method does not necessarily result in a successful safety violation. Consequently, high detection rates on attack-labeled prompts may partly reflect the recognition of attack-specific characteristics rather than the detection of genuinely successful safety bypasses.

The paper would be strengthened by reporting detection performance separately for successful and unsuccessful jailbreak attempts, using model-specific attack success assessments. Such an analysis would clarify the practical security significance of the reported improvements.

  1. Incomplete disentanglement of predictive dynamics from supervised discriminative learning.

Although the paper attributes its performance improvements to modeling class-specific hidden-state transition dynamics, the proposed framework also incorporates a supervised classification objective. Therefore, it remains unclear to what extent the observed improvements arise from learning predictive transition relationships rather than from optimizing discriminative representations.

The matched-input comparisons and existing ablations provide useful evidence, but they do not fully isolate the contribution of predictive modeling from that of supervised classification. Additional controlled experiments, particularly variants trained without the classification objective and simpler class-conditional predictive models, would help substantiate the central methodological claim.

  1. Limited evaluation against adaptive jailbreak attacks.

The leave-one-attack-family-out protocol provides evidence of generalization to attack families excluded from training. However, this setting does not establish robustness against adaptive adversaries who explicitly optimize their prompts to evade CORD.

Since the proposed detector relies on a differentiable or potentially approximable residual-contrast criterion, an attacker with sufficient knowledge or query access may be able to construct prompts that reduce the detection score while preserving the malicious objective.

Evaluating adaptive attacks targeting the proposed detection mechanism would provide a stronger assessment of its robustness in realistic adversarial settings.

  1. Limited generalizability across model scales and prompt configurations.

The evaluation focuses on four open-source LLMs with approximately 7B–8B parameters. While these experiments demonstrate consistency across several model families, it remains unclear whether the proposed approach maintains its effectiveness on larger, more recent, or architecturally different models.

Furthermore, CORD uses a fixed window of the final 64 user tokens. This design raises questions about its robustness to long-context jailbreaks, multi-turn attacks, and prompts in which the malicious objective appears outside the selected token window. Additional evaluations across different context lengths and attack placements would strengthen the generalizability claims.

  1. Limited assessment of false-positive behavior under realistic deployment conditions.

The primary evaluation emphasizes TPR at a threshold calibrated to 1% FPR on ordinary benign prompts. However, the supplementary experiments indicate that false-positive rates increase on challenging benign datasets when the same ordinary-benign threshold is applied.

This suggests that the detector's operating characteristics may depend on the distribution of legitimate requests. Although the hard-benign experiments are valuable, further analysis using a single fixed deployment threshold across heterogeneous benign distributions would provide a clearer picture of the trade-off between jailbreak detection and unnecessary refusal of legitimate requests.

Questions for authors
  1. Detection performance on successful versus unsuccessful jailbreak attempts

The paper reports strong detection performance on prompts collected from established jailbreak attack datasets. However, it is unclear whether these prompts were verified to successfully bypass the safety mechanisms of each target LLM.

Could the authors clarify whether model-specific attack success was evaluated? If so, could the authors report detection performance separately for successful and unsuccessful jailbreak attempts? This distinction would help establish whether the proposed method reliably detects successful safety bypasses, rather than primarily identifying characteristics associated with known attack-generation methods.

  1. Contribution of predictive dynamics versus supervised classification

The central claim is that contrasting class-conditioned predictive dynamics provides a more generalizable detection signal than descriptive hidden-state representations. However, the proposed framework also incorporates a supervised classification objective.

Although the matched-input classifier comparison and ablation studies are informative, could the authors further clarify how much of the improvement is attributable specifically to predictive dynamics? In particular, would the performance remain competitive without the classification loss, and how would CORD compare with simpler class-conditional predictive models trained on the same representations?

  1. Robustness against adaptive attacks

The leave-one-attack-family-out evaluation demonstrates generalization to attack families excluded from detector training. However, this does not necessarily establish robustness against attackers who explicitly optimize their prompts to evade the proposed detector.

Have the authors considered adaptive attacks targeting the residual-contrast score? How robust would CORD be when an adversary attempts to minimize its detection score while maintaining the effectiveness of the jailbreak?

  1. Sensitivity to the fixed token window and broader model generalization

CORD operates on the final 64 user tokens and is evaluated on four approximately 7B–8B language models.

How sensitive is the detection performance to the selected token-window length and the placement of malicious instructions within a prompt? In particular, how would the approach perform on long-context or multi-turn jailbreaks where the attack-bearing content may lie outside the selected window? Additionally, do the authors expect the same predictive regularities to hold for substantially larger or more recent LLMs?

  1. False-positive behavior under a fixed deployment threshold

The paper calibrates its primary operating threshold using ordinary benign prompts, while the supplementary results indicate higher false-positive rates on challenging benign inputs under that threshold.

Could the authors clarify how CORD would maintain a low false-positive rate across heterogeneous legitimate requests without recalibrating the threshold for each input distribution? Reporting detection and false-positive performance under a single fixed threshold across ordinary and hard-benign datasets would help establish its practical deployment characteristics.

2 comments
AuthorsOpenReview ↗

Author Response to Reviewer ab7Q(1/2)

We are very grateful for your insightful and constructive feedback. We have carefully considered all feedback and provide our responses to each point below. We hope the additional results and explanations help clarify your questions.

Q1: Detection performance on successful versus unsuccessful jailbreak attempts.

Response: We appreciate your valuable feedback. To evaluate whether CORD detects successful jailbreaks, we have adopted GPT-6 to assess the model outputs and measured detection rates. CORD detects 88.02%-96.56% of successful attacks and 92.91%-96.53% of unsuccessful attacks, as reported in the table below. CORD maintains high detection rates for both successful and unsuccessful attacks, reducing the average residual ASR across the four models to 1.02%. By catching these successful attacks and reducing residual ASR, CORD shows clear practical security value.

Target modelOriginal ASRResidual ASRSuccessful-attack detectionUnsuccessful-attack detection
Llama2-7B-Chat7.49%0.90%88.02%94.59%
Llama3-8B-Instruct6.43%0.35%94.62%96.53%
Qwen2.5-7B26.41%1.24%95.29%92.91%
Mistral-7B-Instruct-v0.246.31%1.59%96.56%94.71%

Q2: Contribution of predictive dynamics versus supervised classification.

Response: We thank you for this constructive and valuable comment. As per your suggestion, we have added an ablation that removes the classification loss. Although detection rates decrease without this loss, CORD still exceeds the strongest main-table baseline on all four models. We also compare CORD with an MLP predictor trained on the same representations. The MLP predictor achieves ten-family mean TPR@1 values of 81.33%, 84.20%, 75.40%, and 73.10% on the four models, respectively. CORD exceeds it by 11.43%-21.53%. These experimental results demonstrate that predictive dynamics contribute to held-out detection, while the classification loss brings an additional benefit.

Target modelFull CORDWithout classification lossAbsolute Δ\Delta TPR@1Strongest main-table baselineBaseline TPR@1
Llama2-7B-Chat93.27%73.07%+20.20%GraphShield63.70%
Llama3-8B-Instruct95.63%84.43%+11.20%GraphShield60.80%
Qwen2.5-7B92.23%85.13%+7.10%GraphShield64.90%
Mistral-7B-Instruct-v0.294.63%85.20%+9.43%JBShield-D58.23%

Comparison with simpler predictive models

We have also tested whether simpler transition rules could match CORD. Empirical results show that CORD has higher mean detection rates than both controls on the four evaluated models. The unconstrained autonomous linear predictor uses KzKz without control inputs or spectral constraints. Persistence repeats the current state and uses the absolute prediction residual as the detection score. The advantage is consistent across the four target models under held-out-family evaluation. These comparisons suggest the value of structured transition modeling in CORD for detecting unseen attack families.

Target modelCORD (Ours)Unconstrained autonomous linear predictorPersistence
Llama2-7B-Chat93.27%89.40%71.90%
Llama3-8B-Instruct95.63%91.27%93.23%
Qwen2.5-7B92.23%72.20%72.57%
Mistral-7B-Instruct-v0.294.63%82.40%70.10%

Q3: Robustness against adaptive attacks.

Response: Thanks for raising this concern. Your comment has encouraged us to examine this setting more carefully. As suggested, we tested score-feedback suffix search on Llama3, and TPR@1 fell from 96.20% to 0.00%. Since attackers can use score queries to guide black-box search, they can optimize prompts to evade detection. The detection score is also differentiable with respect to hidden representations. This result indicates room for improvement in defending against adaptive attacks. As per your comment, we have added a Limitations section to the revised manuscript and discussed this limitation.

AuthorsOpenReview ↗

Author Response to Reviewer ab7Q(2/2)

Q4: Sensitivity to the fixed token window and broader model generalization.

Response: We appreciate your constructive suggestions regarding the practical evaluation of our method. Following your recommendations, we have conducted a comprehensive set of experiments covering window length, window position, multi-turn attacks, and model size.

1) Effect of window length

As per your comment, we have tested windows of 8, 16, 32, and 64 tokens. The four-model mean detection rate improves steadily as the window grows, rising from 76.10% at 8 tokens to 93.94% at 64 tokens. This suggests that longer windows provide richer trajectory information for detection.

Model8 tokens16 tokens32 tokens64 tokens
Llama2-7B-Chat65.30%79.03%82.20%93.27%
Llama3-8B-Instruct81.20%89.10%92.13%95.63%
Qwen2.5-7B80.80%89.30%91.43%92.23%
Mistral-7B-Instruct-v0.277.10%86.97%95.33%94.63%

2) Window position

Window placement is indeed an important consideration in the design of CORD. We have compared windows at the beginning, middle, and end of the input. The corresponding four-model mean TPR@1 values are 87.78%, 87.60%, and 93.94%, respectively. On all four models, the final window performs best. Consistent with causal attention, later tokens can attend to earlier content while early tokens cannot see what follows, so the final window can still reflect content that appears earlier in the prompt. Given this consistent advantage, we use later hidden states for detection. We further identified 446 test cases where the matched attack objective text appears only before the final 64-token window. CORD achieves an overall TPR@1 of 91.26% on these cases. These findings demonstrate that detection does not require the objective text to appear within the selected window, consistent with later hidden states retaining information from earlier context.

ModelFirst 64 tokensMiddle 64 tokensLast 64 tokens
Llama2-7B-Chat82.57%88.60%93.27%
Llama3-8B-Instruct86.17%87.83%95.63%
Qwen2.5-7B91.93%86.63%92.23%
Mistral-7B-Instruct-v0.290.43%87.33%94.63%

3) Multi-turn attack evaluation

We agree that dialogue context deserves evaluation. Following your suggestion, we have extended the evaluation to multi-turn attacks with dialogue history. CORD achieves a mean detection rate of 97.25% across the four models, showing that detection remains high with dialogue history present. Combined with the window-length and position results, this evidence demonstrates that CORD can detect attacks across the evaluated dialogue contexts and hidden-state window configurations.

ModelMulti-turn attack detection
Llama2-7B-Chat97.60%
Llama3-8B-Instruct97.00%
Qwen2.5-7B96.60%
Mistral-7B-Instruct-v0.297.80%

4) Larger models

This is an insightful suggestion. We have tested CORD on Llama-3-70B and Qwen2.5-72B. Their ten-family mean TPR@1 values exceed 93%, close to the results on the smaller models. High detection rates are thus preserved on these larger target models. This further suggests that the predictive regularities used by CORD remain applicable at larger model scales.

Target modelTen-family mean TPR@1
Llama-3-70B-Instruct94.17%
Qwen2.5-72B-Instruct93.07%

Q5: False-positive behavior under a fixed deployment threshold.

Response: Thank you for this helpful suggestion regarding threshold transfer. To reflect realistic deployment, we evaluated ordinary benign prompts, OKTest, and XSTest-safe without recalibration. Each detector retains its ordinary-benign threshold. The observed ordinary-benign FPR remains close to the 1% calibration target. FPR is higher on the hard-benign sets but stays below 5% on every model, while attack detection remains above 92%. CORD therefore maintains high detection and low false-positive rates across these legitimate-request distributions. Each table entry is an average over the ten held-out attack families. These results indicate that each detector can retain its benign-calibrated threshold across the evaluated input distributions while maintaining high detection and low false-positive rates.

Target modelAttack TPROrdinary-benign FPROKTest FPRXSTest FPR
Llama2-7B-Chat93.27%1.67%4.40%3.88%
Llama3-8B-Instruct95.63%1.17%3.93%2.64%
Qwen2.5-7B92.23%1.20%1.57%3.32%
Mistral-7B-Instruct-v0.294.63%1.27%4.57%2.20%

Thank you again for your valuable time and effort in reviewing our work. We have revised the paper following your constructive and insightful suggestions. Thanks to your comments, the paper is now significantly improved. Thanks again for your valuable time and efforts!

Comments on the paper

1 comment
AuthorsOpenReview ↗

General Response by Authors

We sincerely thank the reviewers for carefully reviewing our manuscript and are encouraged by their positive assessments of the novel idea of contrasting hidden-state dynamics for jailbreak detection (all three reviewers), strong empirical performance (Reviewers ab7Q and LeRY), and informative comparisons, ablations, and theoretical analysis (Reviewers ab7Q and LeRY).

The reviewers raised several common concerns: (i) the contribution of the Koopman-based predictive dynamics is not fully isolated from simpler predictors and the supervised classification objective; (ii) the theoretical assumptions require empirical support, particularly regarding why the residual advantage transfers to held-out attack families; (iii) generalization to genuinely novel and adaptive attacks should be evaluated; (iv) false-positive behavior under benign distribution shift at a fixed threshold needs further analysis; and (v) detection of verified successful jailbreaks and sensitivity to the token window, multi-turn prompts, and model scale should be examined. In response, the revised manuscript adds the following analyses and revisions:

  • We compared CORD with MLP, persistence, and unconstrained linear predictors and ablated the classification loss. CORD outperforms these simpler predictors on average, supporting the value of its Koopman-based predictive formulation. Without classification loss, it still exceeds the strongest main-table baseline on each model. Supervised classification further improves this performance.

  • We analyzed both predictors’ errors across forecast horizons and attack families, with paired bootstrap intervals and comparisons matched by harmful goal. The correct-class predictor retains a statistically supported prediction advantage on most held-out model–family pairs, including comparisons with matched harmful goals. This provides empirical support for the transfer of the residual advantage predicted by Propositions 1 and 2.

  • We evaluated newly proposed jailbreak attacks excluded from training and tuning, alongside a score-guided adaptive attack. CORD matches or outperforms the evaluated baselines on the new attacks, supporting generalization beyond the original attack families. Susceptibility to score-guided evasion is discussed in the revised Limitations section.

  • We evaluated challenging benign datasets using each detector’s original threshold calibrated on ordinary benign prompts. CORD maintains a useful balance between detection and false positives under the tested distribution shifts, without recalibrating thresholds for each dataset.

  • We used model-specific success judgments to evaluate detection separately for successful and unsuccessful jailbreak attempts. CORD effectively detects attacks that actually succeed against the target models, leaving a low residual attack success rate across the evaluated models.

  • We evaluated window length and position, objectives outside the selected window, multi-turn attacks, and larger models. The final token window performs best overall, and detection remains effective even when the objective text appears only before that window. CORD also maintains strong detection in multi-turn settings and on the tested larger models.

We are grateful for the reviewers’ constructive comments, which have helped us substantially improve the paper. We have revised the manuscript accordingly and believe it now presents our contributions more clearly and convincingly.

Last but not least, we thank the PCs, ACs, and all reviewers again for their invaluable time and effort.

Best regards,
ICLR 2027 Submission 4487 Authors

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

Related papers

Loading the map…

Discussion (0)

Sign in to comment.