The Geometry of Harmful Intent: Training-Free Anomaly Detection via Angular Deviation in LLM Residual Streams
On the map: LLM safety and security → Safety alignment, refusal and guardrails
Abstract (arXiv)
We present LatentBiopsy, a training-free method for detecting harmful prompts by analysing the geometry of residual-stream activations in large language models. Given 200 safe normative prompts, LatentBiopsy computes the leading principal component of their activations at a target layer and characterises new prompts by their radial deviation angle θ from this reference direction. The anomaly score is the negative log-likelihood of θ under a Gaussian fit to the normative distribution, flagging deviations symmetrically regardless of orientation. No harmful examples are required for training. We evaluate two complete model triplets from the Qwen3.5-0.8B and Qwen2.5-0.5B families: base, instruction-tuned, and abliterated (refusal direction surgically removed via orthogonalisation). Across all six variants, LatentBiopsy achieves AUROC ≥0.937 for harmful-vs-normative detection and AUROC = 1.000 for discriminating harmful from benign-aggressive prompts (XSTest), with sub-millisecond per-query overhead. Three empirical findings emerge. First, geometry survives refusal ablation: both abliterated variants achieve AUROC at most 0.015 below their instruction-tuned counterparts, establishing a geometric dissociation between harmful-intent representation and the downstream generative refusal mechanism. Second, harmful prompts exhibit a near-degenerate angular distribution (σθ ≈ 0.03 rad), an order of magnitude tighter than the normative distribution (σθ ≈ 0.27 rad), preserved across all alignment stages including abliteration. Third, the two families exhibit opposite ring orientations at the same depth: harmful prompts occupy the outer ring in Qwen3.5-0.8B but the inner ring in Qwen2.5-0.5B, directly motivating the direction-agnostic scoring rule.
Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Placed in Safety alignment, refusal and guardrails, one of 12 directions in LLM safety and security. Builds on 12 of its 14 references that are in the map. First posted on arXiv 28 Mar 2026.
Builds on
12 of 14 references.
Closest ancestors · 2
Same direction, newest first
- 2024Refusal in Language Models Is Mediated by a Single Direction17 Jun
- 2024On Prompt-Driven Safeguarding for Large Language Models31 Jan
Other references · 10
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 2,914
- 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,259
- 2023Representation Engineering: A Top-Down Approach to AI Transparencycited by 1,239
- 2023Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversationscited by 1,124
- 2020On Layer Normalization in the Transformer Architecturecited by 906
- 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 679
- 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 608
- 2024JailbreakBench: An Open Robustness Benchmark for Jailbreaking Large Language Modelscited by 494
- 2023XSTest: A Test Suite for Identifying Exaggerated Safety Behaviours in Large Language Modelscited by 477
- 2023Detecting Language Model Attacks with Perplexitycited by 411
Built on by
Citing papers per year: 2026: 3.
3 papers.
- 2026Harmful Intent as a Geometrically Recoverable Feature of LLM Residual Streamscited by 4
- 2026The Entanglement Wall: Activation-Space Probes as Risk Detectors, Not Context Adjudicatorscited by 2
- 2026Recognition-Refusal Misalignment in LLMs: Why Models Answer Structurally Unanswerable Questionscited by 0
- 2026Recognition-Refusal Misalignment in LLMs: Why Models Answer Structurally Unanswerable Questions29 Aug 2026
- 2026The Entanglement Wall: Activation-Space Probes as Risk Detectors, Not Context Adjudicators12 Jul 2026
- 2026Harmful Intent as a Geometrically Recoverable Feature of LLM Residual Streams20 Apr 2026