🤖 AI Summary
This work addresses the challenge of hallucination in autonomous agents deployed in open environments when using external tools, where existing approaches lack reliable, training-free detection mechanisms. The authors propose a training-free spectral guardrail that identifies hallucinatory behavior by analyzing attention topology—specifically smoothness and entropy. Their findings reveal that spectral features from a single transformer layer can detect hallucinations with near-perfect accuracy, suggesting that hallucination fundamentally arises from abrupt shifts in the thermodynamic state of the model’s attention. The study also uncovers a “loud lies” phenomenon, wherein hallucinated outputs exhibit distinct spectral signatures. Evaluated on Llama 3.1 8B, the method achieves a 97.7% recall (98.2% using Layer 26 smoothness) and attains the best discriminative performance on Mistral 7B with an AUC of 0.900, demonstrating effective, label-free, and cross-model hallucination detection.
📝 Abstract
Deploying autonomous agents in the wild requires reliable safeguards against tool use failures. We propose a training free guardrail based on spectral analysis of attention topology that complements supervised approaches. On Llama 3.1 8B, our method achieves 97.7\% recall with multi-feature detection and 86.1\% recall with 81.0\% precision for balanced deployment, without requiring any labeled training data. Most remarkably, we discover that single layer spectral features act as near-perfect hallucination detectors: Llama L26 Smoothness achieves 98.2\% recall (213/217 hallucinations caught) with a single threshold, and Mistral L3 Entropy achieves 94.7\% recall. This suggests hallucination is not merely a wrong token but a thermodynamic state change: the model's attention becomes noise when it errs. Through controlled cross-model evaluation on matched domains ($N=1000$, $T=0.3$, same General domain, hallucination rates 20--22\%), we reveal the ``Loud Liar''phenomenon: Llama 3.1 8B's failures are spectrally catastrophic and dramatically easier to detect, while Mistral 7B achieves the best discrimination (AUC 0.900). These findings establish spectral analysis as a principled, efficient framework for agent safety.