TL;DR
Happy models are all alike; every compromised model is compromised in its own way. By discovering that rule-following LLMs settle into a tight, predictable internal state while jailbroken LLMs scatter into high-entropy chaos, researchers built a lightweight "chaos detector" that catches prompt injections without ever needing to memorize what an attack looks like. Better yet, it adds virtually zero latency and can nudge a derailed model back on track without fine-tuning.
What Problem Does This Paper Address?
When we deploy LLMs as autonomous agents, they operate under an instruction hierarchy: system directives ("Do not leak private data") must always override user inputs. Yet LLMs are fundamentally trained to be helpful to users, making them prime targets for instruction injection—cleverly disguised prompts that trick the model into breaking its core rules.
Current defenses generally fall into two camps, and both have blind spots:
- Surface-level monitors (like external LLM judges or text filters) treat the model as a black box. They add heavy latency and are easily fooled when an attacker wraps a harmful request inside benign-looking prose (like a movie script).
- Internal state monitors peek inside the LLM’s activations, which is faster and harder to spoof. However, existing methods make a flawed symmetric assumption: they treat "compliance" and "violation" as two neat, opposing clusters, drawing a simple boundary between them. Because attacks are infinitely creative, novel jailbreaks inevitably land on the wrong side of a fixed decision boundary.
Methods
Instead of playing whack-a-mole with infinite attack styles, the authors reframe violation detection as an Out-Of-Distribution (OOD) anomaly problem through a framework called Asymmetric Entropic Optimization (AEO). The base LLM remains completely frozen; AEO just attaches a tiny, ~2.66M-parameter multi-layer perceptron (MLP) to monitor the final transformer layer.
Here is how AEO works under the hood:
- Dual-View Feature Extraction: Looking at a single token isn't enough. AEO concatenates two internal vectors from the final layer: the terminal state ($\mathbf{i}_{\text{last}}$, the final token's vector capturing the model's ultimate conclusion) and the trajectory state ($\mathbf{i}_{\text{resp}}$, the mean-pooled activations across all response tokens, capturing temporal consistency).
- Asymmetric Entropic Loss: Rather than standard binary classification, AEO trains the MLP head asymmetrically. For compliant responses, it minimizes standard cross-entropy, forcing sharp, confident predictions ($[1, 0]$). For generic policy violations, it pushes the output toward maximum entropy—a flat, uncertain $[0.5, 0.5]$ distribution.
- Chaos Score & Zero-Shot Correction: At inference, the probability assigned to the violation class acts as a "Chaos Score." If it crosses a calibrated threshold, AEO flags the output. Optionally, a high Chaos Score can trigger a post-hoc correction loop: re-prompting the LLM with a critical safety reminder to steer its generation back onto the compliant manifold.
Datasets
The authors do not introduce a new benchmark, relying instead on established datasets to test generalization across tasks and attack styles:
- IHEval: The primary training and evaluation suite, testing instruction hierarchy conflicts across Safety, Rule-following, Machine Translation, and Language Detection. Crucially, AEO is trained here on generic violations, not sophisticated jailbreaks.
- JailbreakBench (JBB) & AdvBench: Used to evaluate transfer against archived adversarial attacks (GCG, PAIR, DSN, Adaptive Random Search, and human-crafted AIM role-play) as well as white-box adaptive GCG attacks.
- BIPIA: Benchmarks complex indirect prompt injections hidden inside Email, Table, and Code carriers.
- Multi-turn Proof-of-Concept: 100 dialogues (50 benign, 50 escalating Crescendo-style attacks) to test conversation-end detection.
Key Insights and Ideas
- The Anna Karenina Principle of LLM Latent Space ("Asymmetric Logic"): Compliant behavior collapses onto a tight, low-dimensional manifold, whereas violations diverge wildly into high-entropy space. Measuring hidden-state variance ratios ($\sigma^2_{\text{violate}}/\sigma^2_{\text{follow}}$) across five LLMs showed ratios consistently above $1\times$—scaling from $1.02\times$ on Llama-2-7B up to $1.79\times$ on Qwen2.5-14B. Better-aligned models actually form tighter compliance manifolds, making violations stand out even more sharply.
- A Structural Catch-22 for White-Box Attackers: What if an attacker knows about AEO and optimizes an adversarial prompt to fool both the LLM and the detector simultaneously? When tested against a 200-step white-box adaptive GCG attack, the attack succeeded only 7.27% of the time. Per-sample traces revealed that the two objectives are mutually antagonistic: forcing the LLM to output harmful text structurally requires pushing its hidden states off the compliance manifold, immediately spiking the Chaos Score.
Key Results
Evaluated across 8 LLM backbones (from 1.5B to 24B parameters, plus scaling checks up to 72B), AEO consistently outperforms both black-box judges and white-box attention trackers:
- Detection Accuracy: On Qwen2.5-14B-Instruct (IHEval), AEO hits 97.28% AUC with just a 10.38% false positive rate at 95% recall (FPR95)—compared to 42.46% AUC for the white-box Attention Tracker and 56.12% for an LLM Judge. Compared to a standard binary cross-entropy head on the exact same features, AEO boosts average AUC by ~12–13 points on both IHEval and unseen JBB attacks.
- Active Guardrail & Self-Correction: Blocking flagged inputs slashes unsafe outputs under structural attacks by ~96% (from 51.79% down to 2.14%). Using the Chaos Score to trigger zero-shot re-prompting lifts overall instruction-following accuracy on IHEval from 63.94% to 76.00% without touching model weights.
- Negligible Overhead: Because mean-pooling happens incrementally during generation, AEO adds $O(1)$ post-generation cost—just 1.11 ms on Qwen2.5-32B and 1.65 ms on 72B (~0.13%–0.21% relative latency), versus doubling latency with an external LLM judge.
Limitations and Future Work
- White-Box Requirement: AEO requires access to final-layer hidden states, restricting it to open-weight or self-hosted deployments rather than third-party black-box APIs.
- "Routine" Silent Failures: AEO misses about 4.07% of violations on the held-out test set. Alongside some low-entropy edge cases, these failures happen when the LLM is so thoroughly tricked that it treats a non-compliant request as a routine, mundane task—generating fluent text with zero internal conflict signal. Similarly, subtle "Rule-following" conflicts remain much harder to catch (68.7%–82.3% AUC) than overt Safety or Translation tasks.
- Early Token Interception: While AEO normally scores completed responses (or full tool-call strings before execution), the authors tested a prefix-trained head to abort bad generations after the very first token. It reached 93.0% AUC on IHEval, but failed to transfer reliably to unseen PAIR and JBB slices—leaving robust, zero-shot early interception an open challenge. (Explicit future work directions beyond these scope boundaries are not discussed in the paper.)
Summary updated