arXiv:2606.24790cs.LGcs.AI2026-06中稿 · ICML

通过分析模型内部梯度,实时检测大模型幻觉生成。

Grad Detect: Gradient-Based Hallucination Detection in LLMs

论文配图:Grad Detect: Gradient-Based Hallucination Detection in LLMs
图 1 · 摘自论文原文
  • 利用单次前向反向传播的层间梯度模式判断输出是否幻觉。
  • 在多个问答数据集上优于基于置信度和采样的基线方法。
  • 最后五层包含97%以上判别性梯度信号,可高效部署。

大型语言模型在多种任务中表现卓越,但仍易产生幻觉。可靠部署需有效检测幻觉。本文提出Grad Detect,一种基于梯度的方法,通过分析推理时单次前向-反向传播的层间梯度模式预测幻觉。研究表明,模型内部梯度结构蕴含丰富输出正确性信息,仅靠输出信号无法获取。我们在多个问答基准上评估了该方法在幻觉检测与模型拒答预测上的表现,结果始终优于基于置信度和采样的基线。通过对四个架构家族共十一款模型的全面层消融实验,发现最后五层集中了超过97%的判别性梯度信号,支持高效部署且性能损失极小。Grad Detect提供了一个统一框架,可预测多维度模型可靠性,兼具高预测性能与可解释性,揭示模型失败的来源位置与机制。

原文摘要 · Abstract (English)

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.

幻觉检测梯度分析LLM可靠性

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。