Divergence-based Safety Measure for Large Language Models via Rational Inattention
This paper proposes a novel divergence-based safety measure for large language models under embedding-input attacks, which leverages the equivalence between transformer attention and rational inattention to quantify worst-case output distribution shifts while ensuring stealthiness.
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 very smart, well-read robot assistant (a Large Language Model, or LLM) that helps you make important decisions. You ask it questions, and it gives you answers. But what if a sneaky hacker could whisper tiny, almost invisible changes into the robot's "ears" (its input data) to trick it into giving you a dangerous or wrong answer?
This paper proposes a new way to measure how safe a robot assistant is against these sneaky tricks. Here is the breakdown using simple analogies:
1. The Core Problem: The "Whisper" Attack
Think of the robot's brain as a library of text. A hacker doesn't need to break down the door; they just need to whisper a tiny, almost imperceptible change to the words the robot is reading.
- The Goal: The hacker wants the robot to change its answer (e.g., from "The door is open" to "The door is locked") without you noticing.
- The Challenge: How do we know if a robot is "safe"? We need a way to measure the worst-case scenario: How much can a hacker change the robot's mind before we catch them?
2. The New "Safety Meter": The Rationality Check
The authors created a new safety meter. Instead of just looking at the final answer, they look at how the robot thinks.
The Analogy: The Overworked Manager
Imagine a manager (the robot) who has to read a huge pile of emails (the input text) to make a decision.
- Rational Inattention: Humans can't read every single word of every email perfectly. We have to be "rationally inattentive." We skim the most important parts and ignore the rest to save energy.
- The Robot's "Attention": The robot does something similar. It uses a mechanism called "Transformer Attention" to decide which words in the sentence are most important.
- The Connection: The paper argues that the robot's way of picking important words is mathematically identical to how a human manager decides what to focus on when they are tired or busy.
The Meter:
The authors built a "Rationality Meter" that checks: Is the robot focusing its attention in a normal, human-like way, or is it getting confused?
- If the robot is acting normally, the meter reads low (safe).
- If the robot is being tricked, its attention gets scattered, and the meter goes up.
3. The "Stealth" Rule
The safety test has a strict rule: The attack must be stealthy.
- Imagine a thief trying to steal a painting. If they wear a bright neon suit, they get caught immediately.
- The "Safety Measure" asks: What is the biggest change the thief can make to the robot's answer while still wearing a "camouflage suit" that keeps the Rationality Meter from screaming?
The paper calculates the Kullback–Leibler (KL) Divergence. In simple terms, this is a score that measures how different the robot's "tricked" answer is from its "normal" answer.
- High Score: The robot's mind was easily twisted by a sneaky attack. (Unsafe!)
- Low Score: The robot resisted the trick, or the trick was too obvious to be hidden. (Safer!)
4. The Experiment: GPT-2 vs. GPT-Neo
The authors tested this safety meter on two famous robot brains: GPT-2 and GPT-Neo.
- They gave both robots the same "whisper" attacks (the same budget of invisible changes).
- They watched how much the robots' answers changed while trying to stay hidden from the Rationality Meter.
The Result:
The two robots reacted differently.
- GPT-2 was more easily tricked. Even with the "camouflage," its answers shifted significantly. It had a "leakier" safety profile.
- GPT-Neo was harder to trick. It kept its answers closer to normal even when attacked.
Summary
This paper doesn't just say "hackers are bad." It builds a thermometer for AI safety.
- It treats the AI's attention mechanism like a human's limited focus.
- It uses that to create a "lie detector" that watches for subtle confusion.
- It measures how much an AI's mind can be twisted by a hidden attack before the "lie detector" goes off.
- It proves that some AI models are naturally more "tough" against these hidden tricks than others.
The ultimate goal is to help engineers pick the safer robot for important jobs and to build better defenses against future hackers.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.