Robust Hallucination Detection in LLMs via Adaptive Token Selection

Mengjia Niu, Hamed Haddadi, Guansong Pang
4/10/2025
cs.LG

No official code found. Best implementation: mala-lab/HaMI (13 stars, last commit 2025-10-30).

Abstract

Hallucinations in large language models (LLMs) pose significant safety concerns that impede their broader deployment. Recent research in hallucination detection has demonstrated that LLMs' internal representations contain truthfulness hints, which can be harnessed for detector training. However, the performance of these detectors is heavily dependent on the internal representations of predetermined tokens, fluctuating considerably when working on free-form generations with varying lengths and sparse distributions of hallucinated entities. To address this, we propose HaMI, a novel approach that enables robust detection of hallucinations through adaptive selection and learning of critical tokens that are most indicative of hallucinations. We achieve this robustness by an innovative formulation of the Hallucination detection task as Multiple Instance (HaMI) learning over token-level representations within a sequence, thereby facilitating a joint optimisation of token selection and hallucination detection on generation sequences of diverse forms. Comprehensive experimental results on four hallucination benchmarks show that HaMI significantly outperforms existing state-of-the-art approaches.

View on arXivView PDF

Code Implementations(1)

mala-lab/HaMICommunity76%

[NeurIPS 2025] Official implementation for ''Robust Hallucination Detection in LLMs via Adaptive Token Selection'' https://arxiv.org/abs/2504.07863

131Python, Jupyter NotebookJun 18, 202511 months ago
ai-safetyhallucination-detectionhallucination-mitigationlarge-language-models

Similar Papers

Cite this paper

@article{niu2025robust,
  title  = {Robust Hallucination Detection in LLMs via Adaptive Token Selection},
  author = {Mengjia Niu and Hamed Haddadi and Guansong Pang},
  year   = {2025},
  eprint = {2504.07863},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.07863v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.07863.svg)](https://codeofpaper.com/paper/2504.07863)

Discussion