通过自检解码实时识别并修正幻觉词元,提升大模型输出可靠性。
Token-Guard: Towards Token-Level Hallucination Control via Self-Checking Decoding
- 在每步推理中自检生成内容,提前发现幻觉词元。
- 在潜在空间评分并迭代修剪重生成,显著降低幻觉率。
- 无需额外训练或检索,适合部署于各类大模型场景。
大型语言模型常产生与输入不符的幻觉内容。虽然检索增强生成(RAG)和基于人类反馈的强化学习(RLHF)可缓解此问题,但需依赖资源密集型检索或大规模微调。基于解码的方法更轻量,却缺乏明确的幻觉控制机制。为此,我们提出Token-Guard,一种基于自检解码的词元级幻觉控制方法。该方法在每一步推理中进行内部验证,提前检测可能的幻觉词元,避免其传播。候选片段在潜在空间中通过显式幻觉风险评分进一步评估,结合迭代修剪与重生成动态修正错误。在HALU数据集上的实验表明,Token-Guard显著减少幻觉并提升生成准确率,提供了一种可扩展、模块化的可靠生成解决方案。代码已公开。
原文摘要 · Abstract (English)
Large Language Models (LLMs) often hallucinate, generating content inconsistent with the input. Retrieval-Augmented Generation (RAG) and Reinforcement Learning with Human Feedback (RLHF) can mitigate hallucinations but require resource-intensive retrieval or large-scale fine-tuning. Decoding-based methods are lighter yet lack explicit hallucination control. To address this, we present Token-Guard, a token-level hallucination control method based on self-checking decoding. Token-Guard performs internal verification at each reasoning step to detect hallucinated tokens before they propagate. Candidate fragments are further evaluated in a latent space with explicit hallucination risk scoring, while iterative pruning and regeneration dynamically correct detected errors. Experiments on HALU datasets show Token-Guard substantially reduces hallucinations and improves generation accuracy, offering a scalable, modular solution for reliable LLM outputs. Our code is publicly available.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。