From Flat Facts to Sharp Hallucinations: Detecting Stubborn Errors via Gradient Sensitivity
Abstract
Traditional hallucination detection fails on "Stubborn Hallucinations" — errors where LLMs are confidently wrong. We propose a geometric solution: Embedding-Perturbed Gradient Sensitivity (EPGS). We hypothesize that while robust facts reside in flat minima, stubborn hallucinations sit in sharp minima, supported by brittle memorization. EPGS detects this sharpness by perturbing input embeddings with Gaussian noise and measuring the resulting spike in gradient magnitude. This acts as an efficient proxy for the Hessian spectrum, differentiating stable knowledge from unstable memorization. Our experiments show that EPGS significantly outperforms entropy-based and representation-based baselines, providing a robust signal for detecting high-confidence factual errors.
Lay Summary
Large language models (LLMs) sometimes invent fluent but false information. The most dangerous of these are "stubborn hallucinations," where the AI is completely confident in its incorrect answer. Because the model doesn't exhibit uncertainty, standard detection tools that look for hesitant or inconsistent outputs fail to catch these errors. We tackle this by shifting our focus from the AI's final answer to the underlying geometry of how it stores information. We hypothesize that genuine facts reside in stable, "flat" mathematical regions within the model, while memorized mistakes are trapped in brittle, "sharp" regions. To detect this, we developed a method that injects a tiny amount of artificial noise into the AI's input and observes how its internal signals react. A massive spike in these signals indicates the model is resting on a fragile, sharp error. Our approach successfully isolates these stubborn mistakes from true facts. By reliably catching the confident errors that previous methods miss, this work provides a crucial verification tool for deploying language models safely in high-stakes domains like medicine and law.