← Latest papers
🤖 machine learning

The Geometry of Harmful Intent: Training-Free Anomaly Detection via Angular Deviation in LLM Residual Streams

LatentBiopsy is a training-free anomaly detection method that identifies harmful prompts by measuring their angular deviation from a normative reference direction in LLM residual streams, achieving high accuracy across various model variants—including those with surgically removed refusal mechanisms—by exploiting the geometric dissociation between harmful intent and alignment behaviors.

Original authors: Isaac Llorente-Saguer

Published 2026-03-31
📖 5 min read🧠 Deep dive

Original authors: Isaac Llorente-Saguer

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you have a giant, super-smart library (a Large Language Model) that can write stories, answer questions, and solve problems. But sometimes, people try to trick the library into writing dangerous or harmful things. Usually, the library is trained to say, "No, I won't do that," and refuse the request.

This paper introduces a new security guard named LatentBiopsy. Here is the simple breakdown of how it works, using some everyday analogies.

1. The Problem: The "Refusal" Trick

Most safety systems work like a bouncer at a club. They look at the person asking for entry (the prompt) and check a list of "bad guys." If they see a bad guy, they say "No."

But what if the bad guy changes their clothes, or what if the bouncer gets fired? In the world of AI, researchers have found a way to "surgically remove" the part of the AI that says "No" (called refusal ablation). Now, the AI is like a robot that cannot say no; it will happily generate harmful content if asked.

The big question was: If the AI can't say "No," can we still tell it's about to do something bad?

2. The Solution: The "Body Language" Detector

LatentBiopsy doesn't look at the words the AI is thinking about saying. Instead, it looks at the AI's internal body language.

Think of the AI's brain as a giant room filled with invisible strings (called residual streams). Every time the AI thinks about something, it pulls on these strings in a specific direction.

  • Safe thoughts pull the strings in a comfortable, relaxed pattern (like standing in a circle holding hands).
  • Harmful thoughts pull the strings in a very specific, tight, and unusual direction.

LatentBiopsy is a camera that takes a snapshot of these strings before the AI writes a single word. It doesn't need to know what "bad" looks like in advance. It just needs to know what "normal" looks like.

3. How It Works: The "Safe Circle"

Here is the step-by-step magic:

  1. The Training (The "Safe Circle"): The researchers show the AI 200 completely normal, boring questions (like "What's the weather?" or "Write a poem about a cat"). They measure how the AI's internal strings move for these. They draw a giant, invisible "Safe Circle" based on these movements.
  2. The Test (The "Angle"): When a new prompt comes in, the system measures the angle of the AI's internal strings compared to that Safe Circle.
    • If the angle is close to the circle, it's safe.
    • If the angle is way off (even if it's on the other side of the circle), it's flagged as dangerous.
  3. The Score: It gives a "danger score" based on how weird the angle is. No harmful examples were needed to teach it this; it just learned what "normal" feels like.

4. The Big Surprise: The "Ghost Signal"

This is the most important part of the paper.

The researchers took two different families of AI models (Qwen). They took the "refusal" ability (the part that says "No") and surgically removed it. The AI became a "zombie" that couldn't refuse anything.

The Result: Even though the AI couldn't say "No," the LatentBiopsy camera still saw the danger.

  • Analogy: Imagine a person who has had their voice box removed and can no longer say "Stop!" or "Help!" Even though they are silent, their body language (sweating, trembling, looking terrified) still clearly shows they are in danger.
  • The Finding: The "geometry" of the harmful intent (the way the strings are pulled) is separate from the mechanism that says "No." You can delete the "No" button, but the "Danger Signal" remains visible to an outside observer.

5. The "Opposite Rings" Mystery

The researchers found something weird and funny about the two different AI families they tested:

  • In Family A, dangerous thoughts pulled the strings outward (away from the center).
  • In Family B, dangerous thoughts pulled the strings inward (toward the center).

It's like two different dance halls where the "bad dancers" spin in opposite directions. Most safety systems would break because they assume bad dancers always spin one way. But LatentBiopsy is smart enough to say, "I don't care which way you spin; if you're spinning differently than the safe dancers, you're flagged."

Why Does This Matter?

  1. It's Fast: It takes less than a millisecond to check. It's like a metal detector that beeps instantly without slowing you down.
  2. It's Hard to Trick: Because it looks at the internal "body language" rather than the words, it's very hard for hackers to fool it.
  3. It Works on "Broken" AI: Even if someone tries to hack an AI to remove its safety filters, this tool can still detect that the AI is about to do something harmful.

In a nutshell: You don't need to know what a criminal looks like to catch them. You just need to know what a normal, law-abiding citizen looks like. If someone's "internal posture" is weirdly different from the crowd, you know something is up—even if they are pretending to be polite.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →