Reducing hallucinations of large language models via hierarchical semantic piece
Yanyi Liu, Qingwen Yang, Jia-Wei Tang, Tiezheng Guo, Wang Chen, Li Pan, Xu Sai, Xianlin Gao, Zhi Li, Jun Liu, Yingyou Wen
Abstract
With the widespread application of large language models (LLMs) in natural language processing (NLP), hallucinations have become a significant impediment to their effective use of LLMs in industry applications. To address this challenge, we integrate existing hallucination detection and mitigation methods into a unified hallucination detection and mitigation framework. The framework consists of four main components: output parser, reference parser, fact verifier, and mitigator. These components collectively consolidate various hallucination detection and mitigation methods. Within this unified framework, we introduce the hierarchical semantic piece (HSP) for hallucination detection and mitigation. The HSP method extracts multi-granularity semantic pieces from both the reference material and the generated text. Sentence-level semantic pieces encapsulate global semantic information, while entity-level semantic pieces handle local semantic information. This method verifies the consistency between the generated text and the reference text at corresponding granularities, thereby enhancing the effectiveness of hallucination detection and mitigation. Experimental results show that the HSP method is very effective in detecting and mitigating hallucinations and shows lower computational resource consumption. Our method has great potential and promises for industry applications that rely on professionalism and reliability.