arXiv:2603.22303cs.LGcs.AI2026-03

用样本间转换成本检测大模型幻觉,无需训练即可用。

Sample Transform Cost-Based Training-Free Hallucination Detector for Large Language Models

  • 通过计算生成样本间词嵌入的最优传输距离,量化分布复杂度。
  • 提出AvgWD和EigenWD两个指标,在多个数据集上表现媲美强基线。
  • 无需训练、适用于黑盒模型,适合部署在资源受限场景。

大语言模型中的幻觉仍是可信部署的核心障碍,亟需准确、轻量且通用的检测方法。由于提示词定义了条件分布,我们提出分布的复杂度是幻觉的有效指示器。然而,分布密度未知,生成样本为离散分布,难以量化复杂度。为此,本文计算成对样本的词嵌入集合间的最优传输距离,得到衡量样本间转换成本的Wasserstein距离矩阵,从而量化由提示词定义的分布复杂度。基于该矩阵,我们推导出两个互补信号:AvgWD(平均成本)与EigenWD(成本复杂度),构建无训练的幻觉检测器。进一步通过教师强制机制扩展至黑盒模型。实验表明,AvgWD与EigenWD在多个模型与数据集上性能媲美强基准,行为互补,验证分布复杂度作为大模型真实性有效信号的潜力。

原文摘要 · Abstract (English)

Hallucinations in large language models (LLMs) remain a central obstacle to trustworthy deployment, motivating detectors that are accurate, lightweight, and broadly applicable. Since an LLM with a prompt defines a conditional distribution, we argue that the complexity of the distribution is an indicator of hallucination. However, the density of the distribution is unknown and the samples (i.e., responses generated for the prompt) are discrete distributions, which leads to a significant challenge in quantifying the complexity of the distribution. We propose to compute the optimal-transport distances between the sets of token embeddings of pairwise samples, which yields a Wasserstein distance matrix measuring the costs of transforming between the samples. This Wasserstein distance matrix provides a means to quantify the complexity of the distribution defined by the LLM with the prompt. Based on the Wasserstein distance matrix, we derive two complementary signals: AvgWD, measuring the average cost, and EigenWD, measuring the cost complexity. This leads to a training-free detector for hallucinations in LLMs. We further extend the framework to black-box LLMs via teacher forcing with an accessible teacher model. Experiments show that AvgWD and EigenWD are competitive with strong uncertainty baselines and provide complementary behavior across models and datasets, highlighting distribution complexity as an effective signal for LLM truthfulness.

幻觉检测无训练分布复杂度Wasserstein

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