中文

幻觉信号向Transformer表示的弱监督蒸馏

人工智能 2026-04-09 v1 计算与语言 机器学习

摘要

现有的大型语言模型(LLM)幻觉检测方法依赖推理时的外部验证,需要金标准答案、检索系统或辅助判断模型。我们探究这种外部监督是否可以在训练期间蒸馏到模型自身的表示中,从而在推理时仅从内部激活实现幻觉检测。我们引入了一个弱监督框架,结合三种互补的锚定信号:子串匹配、句子嵌入相似度和LLM作为判断结果,将生成的响应标注为有锚定或幻觉,无需人工标注。使用该框架,我们从SQuAD v2构建了一个15,000样本的数据集(10,500个训练/开发样本和独立的5,000样本测试集),其中每个样本包含LLaMA-2-7B生成的答案及其完整的逐层隐藏状态和结构化的幻觉标签。随后,我们在这些隐藏状态上直接训练五个探测分类器:ProbeMLP(M0)、LayerWiseMLP(M1)、CrossLayerTransformer(M2)、HierarchicalTransformer(M3)和CrossLayerAttentionTransformerV2(M4),将外部锚定信号仅作为训练时的监督。我们的核心假设是幻觉检测信号可以蒸馏到Transformer表示中,从而实现无需推理时任何外部验证的内部检测。结果支持该假设。基于Transformer的探测器实现了最强的判别力,M2在5折平均AUC/F1上表现最佳,M3在单折验证和保留测试评估上均表现最佳。我们还基准测试了推理效率:探测器延迟范围为0.15至5.62毫秒(批处理)和1.55至6.66毫秒(单样本),而端到端生成加探测器吞吐量约为每秒0.231次查询,表明实际开销可忽略不计。

关键词

引用

@article{arxiv.2604.06277,
  title  = {Weakly Supervised Distillation of Hallucination Signals into Transformer Representations},
  author = {Shoaib Sadiq Salehmohamed and Jinal Prashant Thakkar and Hansika Aredla and Shaik Mohammed Omar and Shalmali Ayachit},
  journal= {arXiv preprint arXiv:2604.06277},
  year   = {2026}
}

备注

20 pages, 6 figures, 6 tables. Introduces a 15k-sample representation-level hallucination dataset with full transformer hidden states and multi-signal weak supervision. Evaluates 5 probing architectures and demonstrates internal hallucination detection without external inference-time signals. Includes held-out test evaluation and deployment benchmarks