TL;DR
The paper introduces Manifold Trajectory Kinetics (MTK), a novel jailbreak detection framework that tracks how a prompt’s neighborhood structure on the data manifold evolves across all layers of a Large Language Model (LLM). Unlike traditional static, single-layer detectors, MTK provides robust defense against both aggressive adaptive attacks and "pseudo-malicious" prompts (benign queries containing sensitive keywords). By treating the LLM as a dynamic kinetic system, MTK achieves a 94% mean AUROC across diverse models and attacks without requiring any jailbreak training data.
What Problem Does This Paper Address?
As Large Language Models (LLMs) are deployed at scale, safeguarding them against "jailbreak attacks"—prompts engineered to bypass safety guardrails and elicit harmful content—is paramount.
Current internal-state detectors typically assume that benign and malicious prompts are linearly separable within a fixed metric space (like the hidden states of a single, heuristically chosen "safety layer"). The authors demonstrate that this assumption fails in two critical scenarios:
- Pseudo-Malicious Prompts (PMPs): Queries that are completely benign in intent but contain sensitive keywords (e.g., "How do I bake a bomb-shaped cake?" or "What is Harry Potter's criminal history?"). Static detectors often flag these as malicious, leading to high false-positive rates and frustrating over-refusal.
- Adaptive Attacks: A white-box adversary with full knowledge of the defense can optimize an adversarial suffix to satisfy the detector's constraints at the monitored layer while still triggering a jailbreak.
To resolve this two-sided failure, the paper shifts the defensive paradigm from static metric spaces to analyzing the dynamic geometric progression of data across the entire network manifold.
Methods
Instead of taking an isolated snapshot at a single layer, Manifold Trajectory Kinetics (MTK) tracks the layer-wise progression of a prompt as a temporal trajectory. The method operates in three distinct phases:
- Activation Trajectory Extraction: The model maintains a small reference bank of known benign prompts (including a fraction of PMPs) and raw malicious queries. As a test prompt passes through the network, MTK extracts the hidden representation of its final input token at every single layer.
- Manifold Trajectory Generation: To make the representation robust against model-specific coordinate shifts, MTK discards raw activation values. Instead, at each layer, it calculates the distance from the test prompt to the reference bank and records the rank index of its nearest benign neighbors. This converts the high-dimensional activations into a lightweight, layer-wise rank sequence vector.
- Kinetics Anomaly Detection: An outlier detector, specifically an Isolation Forest (IF), is trained exclusively on the trajectories of genuinely benign prompts. At inference time, any test trajectory that deviates significantly from typical benign geometric patterns is flagged as a jailbreak.
Datasets
The authors evaluated MTK using a robust collection of open datasets, completely separating the reference anchor sets from the evaluation sets to prevent data leakage:
- Benign Prompts: Databricks Dolly 15k, Alpaca, UltraChat, and ToxicChat (samples with toxicity = 0).
- Malicious Queries: AdvBench, MaliciousInstruct, PKU-SafeRLHF, and HarmfulQA.
- Pseudo-Malicious Prompts (PMPs): OR-Bench and XSTest (text); Unified Safety Benchmark (USB) for multimodal testing.
- Vision-Language Model (VLM) Evaluation: MM-Vet (benign), MM-SafetyBench, JailBreakV-28K, and FIGIMG (multimodal jailbreaks).
Key Insights and Ideas
- The "Bumping" Phenomenon: The core insight of the paper is that jailbreak prompts exhibit a unique, oscillating trajectory across layers. In shallow layers, local lexical tokens dominate, making the prompt cluster near malicious seeds. In middle layers, the model's internal safety checks trigger a "tug-of-war" against the jailbreak wrapper. In deep layers, the prompt strategically shifts back toward benign neighborhoods to force a compliant response (like "Sure, here is..."). Genuinely benign and pseudo-malicious prompts, by contrast, maintain stable trajectories.
- High-Dimensional Slack: The paper reveals why single-layer defenses (like SaP or HiddenDetect) fail against adaptive attacks. In high-dimensional spaces, optimizing against a single layer's constraints leaves massive geometric "slack" for an attacker to hide malicious intent in unmonitored regions of the network. Tracking the full trajectory eliminates this vulnerability.
- Cross-Modal Transferability: Because the trajectory is modeled using relative neighborhood ranks rather than raw features, the geometric signature transfers naturally to Vision-Language Models (VLMs) without needing a redesigned architecture.
Key Results
MTK was extensively tested across four popular LLMs (LLaMA2-7B-chat, LLaMA3-8B-instruct, Mistral-7B-instruct, and Vicuna-7B) against 10 distinct jailbreak attacks.
- SOTA Effectiveness: MTK achieved the highest AUROC in 31 out of 40 model-attack settings, maintaining a mean AUROC of 0.940.
- Resistance to Adaptive Attacks: Under optimized, defense-aware adaptive attacks that completely broke baseline defenses (dropping baseline True Positive Rates to near 0%), MTK maintained a robust True Positive Rate of 85% on Vicuna-7B and kept the evasion Attack Success Rate (eASR) remarkably low.
- Mitigating Over-Refusal: On the challenging OR-Bench PMP dataset, MTK maintained a True Positive Rate of 95% while keeping the False Positive Rate on PMPs at a mere 2%, drastically outperforming baselines like SelfDefend, which suffered a 55% false-positive rate.
- Multimodal Success: When applied to VLMs (LLaVA and Qwen-VL), MTK achieved average AUROCs of 0.940 and 0.924 respectively, proving its versatility.
Limitations and Future Work
While MTK demonstrates exceptional empirical robustness, the authors note a fundamental limitation: it assumes that jailbreak prompts must follow an anomalous trajectory to succeed. It remains theoretically possible that a future, highly sophisticated adaptive attack could craft a prompt whose activations sit perfectly inside benign open balls across every single layer while still eliciting harmful outputs.
Additionally, the current implementation relies on a straightforward neighbor-rank metric as a proxy for closeness. The authors suggest that future work could explore richer, more principled manifold proximity measures to model these evolutionary dynamics even more precisely.
Summary updated