Alleviating Hallucinations in Large Language Models through Multi-Model Contrastive Decoding and Dynamic Hallucination Detection

Hao Zhang (NVIDIA) · Weihua Luo (Alibaba Group) · Kaifu Zhang (Alibaba Group) · Guanhua Chen (Southern University of Science and Technology) · Chenyu Zhu (Zhejiang University) · Yefeng Liu (Alibaba Group) · Aowen Wang (Zhejiang University) · Yangxue (Alibaba Group) · Longyue Wang (Tencent AI Lab)
benchmarkscontrastive decodingcontrastive logitsdecoding strategydynamic hallucination detectionevil modelexperimental evaluationsfactual accuracyhallucinationsmulti-model contrastive decodingpretrained language modelstate-of-the-art methodstoken-by-token identificationtree-based revision mechanismtruthful model

Despite their outstanding performance in numerous applications, large language models (LLMs) remain prone to hallucinations, generating content inconsistent with their pretraining corpora. Currently, almost all contrastive decoding approaches alleviate hallucinations by introducing a model susceptible to hallucinations and appropriately widening the contrastive logits gap between hallucinatory tokens and target tokens. However, although existing contrastive decoding methods mitigate hallucinations, they lack enough confidence in the factual accuracy of the generated content. In this work, we propose Multi-Model Contrastive Decoding (MCD), which integrates a pretrained language model with an evil model and a truthful model for contrastive decoding. Intuitively, a token is assigned a high probability only when deemed potentially hallucinatory by the evil model while being considered factual by the truthful model. This decoding strategy significantly enhances the model’s confidence in its generated responses and reduces potential hallucinations. Furthermore, we introduce a dynamic hallucination detection mechanism that facilitates token-by-token identification of hallucinations during generation and a tree-based revision mechanism to diminish hallucinations further. Extensive experimental evaluations demonstrate that our MCD strategy effectively reduces hallucinations in LLMs and outperforms state-of-the-art methods across various benchmarks.