AttentionCD: Reducing Factuality Hallucinations in Large Language Models using Task-specific Head-based Contrastive Decoding

Published in The Proceedings of the Third Workshop on Uncertainty-Aware NLP (UncertaiNLP 2026), co-located with EMNLP 2026, 2026

Despite the tremendous volume of data they are trained on, Large Language Models (LLMs) can generate plausibly sounding but non-factual responses. These factually hallucinated responses reduce users’ trust in such models and hinder their adoption in safety-critical applications. Among the many training-free hallucination mitigation strategies proposed, contrastive decoding strategies have received wide attention. Most of the work in this direction explores how contrasting probability distributions from different decoder layers can help in reducing factuality hallucinations. This work, in contrast, investigates whether masking of attention heads can provide reliable contrastive signals. In particular, we propose AttentionCD, a decoding strategy that masks task-specific attention heads to yield better contrastive signals to reduce factuality hallucinations in LLMs. Our approach shows competitive performance with the existing layer-based contrastive decoding strategies and offers an average performance improvement of over +11.1% over greedy decoding across different tasks and models.

Recommended citation: Viju Sudhi, Regina Stodden, and Philipp Cimiano. 2026. AttentionCD: Reducing Factuality Hallucinations in Large Language Models using Task-specific Head-based Contrastive Decoding. In The Proceedings of the Third Workshop on Uncertainty-Aware NLP, pages 30–47, Budapest, Hungary. Association for Computational Linguistics. https://doi.org/10.18653/2026.uncertainlp-main.3
Download Paper | Download Slides