RAGognizer: Hallucination-Aware Fine-Tuning via Detection Head Integration

Fabian Ridder, Laurin Lessel, Malte Schilling
4/17/2026
cs.CLcs.LG

No official code found. Best implementation: F4biian/RAGognizer (5 stars, MIT, last commit 2026-06-03).

Abstract

Retrieval-Augmented Generation (RAG) is widely used to augment the input to Large Language Models (LLMs) with external information, such as recent or domain-specific knowledge. Nonetheless, current models still produce closed-domain hallucinations and generate content that is unsupported by the retrieved context. Current detection approaches typically treat hallucination as a post-hoc problem, relying on black-box consistency checks or probes over frozen internal representations. In this work, we demonstrate that hallucination detection based on internal state representation can also serve as a direct training signal. We introduce RAGognize, a dataset of naturally occurring closed-domain hallucinations with token-level annotations, and RAGognizer, a hallucination-aware fine-tuning approach that integrates a lightweight detection head into an LLM, allowing for the joint optimization of language modeling and hallucination detection. This joint objective forces the model to improve the separability of its internal states regarding hallucinations while simultaneously learning to generate well-formed and meaningful responses. Across multiple benchmarks, RAGognizer achieves state-of-the-art token-level hallucination detection while substantially reducing hallucination rates during generation, without degrading language quality or relevance.

View on arXivView PDF

Code Implementations(1)

F4biian/RAGognizerCommunity77%
MIT

Official Repo of the Paper "Hallucination-Aware Fine-Tuning via Detection Head Integration"

51Oct 20, 20254 months agoMIT
fine-tuninghallucination-detectionllmlora

Similar Papers

Cite this paper

@article{ridder2026ragognizer,
  title  = {RAGognizer: Hallucination-Aware Fine-Tuning via Detection Head Integration},
  author = {Fabian Ridder and Laurin Lessel and Malte Schilling},
  year   = {2026},
  eprint = {2604.15945},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.15945v1}
}

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/2604.15945.svg)](https://codeofpaper.com/paper/2604.15945)

Discussion