这篇论文教你用梯度信号抓幻觉,比看置信度准得多,而且发现只看最后5层就够了,省算力。
Grad Detect 是一种通过分析大语言模型推理时逐层梯度模式来检测幻觉的方法。在多个 Q&A 基准(如 TriviaQA、Natural Questions)上,Grad Detect 在幻觉检测和模型弃权预测任务中均优于基于置信度或采样的基线。层消融实验覆盖 11 个模型和 4 种架构,发现最后 5 个层集中了超过 97% 的判别梯度信号,因此可实现高效部署。该方法为评估 LLM 可靠性提供了统一框架,兼具高预测性能和可解释性。
Grad Detect: Gradient-Based Hallucination Detection in LLMs
Large Language Models (LLMs) have demonstrated remarkable capabilities across diverse tasks, yet they remain prone to generating hallucinations. Detecting these hallucinations is critical for deploying LLMs reliably in high-stakes applications. We present Grad Detect, a gradient-based approach for predicting hallucinations by analyzing layer-wise gradient patterns from a single forward-backward pass during inference. Our method shows that the internal gradient structure of a model carries rich information about the correctness of its output. This information is not accessible through output-level signals alone. We evaluate Grad Detect on several Q&A benchmarks across both hallucination detection and model abstention prediction, where it consistently outperforms confidence-based and sampling-based baselines. Through comprehensive layer ablation studies across all eleven models from four architectural families, we find that the final five layers concentrate over 97% of the discriminative gradient signal, enabling efficient deployment with minimal performance loss. Grad Detect provides a unified framework for predicting multiple dimensions of LLM reliability, offering strong predictive performance alongside interpretable insights into where and how model failures originate.