Hallucinations remain a major obstacle to the reliable use of large language models (LLMs) in conditional text generation. Existing methods primarily assess the factuality of an entire generated text, providing limited insight into which output spans are hallucinated or how they relate to the input. We introduce the task of hallucination span detection with input-side evidence alignment, which jointly identifies hallucinated spans and aligns output tokens with the corresponding input evidence. Our approach is based on the observation that faithful output tokens are predictable from the input, whereas hallucinated tokens are not. We therefore train an encoder-based model to predict masked output tokens from the input representation, using prediction confidence for hallucination detection while naturally producing alignments to the input. Experiments show that the proposed method effectively detects hallucinated spans and identifies meaningful input-side evidence. Human evaluation confirms the quality of the predicted alignments.
Figures & tables
Figure 1: Example of hallucination span detection with input-side evidence alignment.
Figure 2: Proposed method
QA
Summary
Overall
Train (FT)
4,134 ( 8.6 %)
3,858 ( 3.0 %)
7,992 ( 5.9 %)
Dev
400 ( 9.0 %)
400 ( 3.3 %)
800 ( 6.1 %)
Dev ( λ )
500 ( 9.9 %)
500 ( 3.5 %)
1,000 ( 6.7 %)
Test
900 ( 5.4 %)
900 ( 2.9 %)
1,800 ( 4.1 %)
Table 1: Number of samples in RAGTruth (the parentheses indicate the proportion of hallucinated characters)
Instruction
Your task is to determine whether the answer contains either or both of the following two types of hallucinations: 1 . conflict: instances where the answer presents direct contradiction or opposition to the passages; 2 . baseless info: instances where the answer includes information which is not substantiated by or inferred from the passages. Then, compile the labeled hallucinated spans into a JSON dict, with a key “hallucination list” and its value is a list of hallucinated spans. If there exist potential hallucinations, the output should be in the following JSON format: {{“hallucination list”: [hallucination span 1 , hallucination span 2 , …]}}. Otherwise, leave the value as a empty list as following: {{“hallucination list”: []}}. Output:
Table 2: Prompt for Llama-SFT
Method
QA
Summary
P
R
F 1
P
R
F 1
Llama-SFT
45.0
35.6
39.8
64.1
37.9
47.6
LettuceDetect
66.9
62.1
64.4
60.2
35.5
44.6
OTAlign
8.9
45.3
14.9
4.5
34.8
7.9
Proposed
40.9
82.7
54.8
42.8
38.0
40.3
Table 3: Performance of each method in hallucination span detection (P: Precision, R: Recall, F 1 : F 1 score)
Score
Criterion
3
Predicted input token is exactly the evidence.
2
Predicted input token is in the sentence where the evidence is described, or in the relevant sentence.
1
Predicted input token is irrelevant to the true evidence.
0
Hallucination judgment is incorrect (false-positive or false-negative).
Table 4: Criteria for manual assessment of input-side evidence alignment
Method
Top- k
Type
# of words
3
2
1
0
Avg.
OTAlign
Top- 1
Faithful
588
255
57
91
185
1.65
Top- 3
Faithful
588
295
54
54
185
1.78
Proposed
Top- 1
Faithful
588
188
267
59
74
1.97
Baseless
71
40
0
19
12
1.96
Conflict
41
2
3
4
32
0.39
Top- 3
Faithful
588
268
216
30
74
2.15
Table 5: Human evaluation results
Type
Output Text
Input Text
Conf.
Faithful
[…] and a commemorative Fiesta de la Flor event is planned for April 17 and 18 .
[…] The commemorative Fiesta de la Flor in Corpus Christi, Texas – which celebrates her life – is scheduled for April 17 and 18 […]
0.782
Faithful
[…] it drew the attention of multiple law enforcement agencies including Atlanta Police Department, FBI and Federal Homeland Security. This led to her arrest on August 9 th, where a firearm and three computers were found in her home. […]
[…] authorities obtained a search warrant for her residence. They took her into custody while executing that warrant. “A firearm along with three computers was located during the search,” East Point police said […]
0.723
Faithful
[…] As you drive through tolls, the system deducts the toll amounts from your balance until it reaches a certain threshold (10$ for the TX-Tag). […]
[…] They deduct the tolls from that balance till the balance goes below a certain value (10$ for the TX-Tag) and they charge your credit card […]
0.767
Conflict
[…] we can see that the FEHA (Fair Employment and Housing Act) applies to all employers with four to fifteen employees , while the ADA (Americans with Disabilities Act) applies to employers with twenty or more employees. Additionally, the ADA distinguishes between private and public employers, whereas the FEHA does not. […]
[…] One difference between the FEHA (the Fair Employment and Housing Act) and the ADA (Americans with Disabilities Act) is that the ADA applies to all employers in the private sector that have four to fifteen employees, whereas the FEHA affects more employees, and it doesn’t distinguish between private and public employers like the ADA does. […]
0.471
Conflict
[…] The APhA has previously opposed the use of the term “drug” for chemicals used in lethal injection and has urged laws prohibiting pharmacists from participating in such cases. […]
[…] This bolsters the association’s previous positions to oppose the use of the term “drug” for chemicals used in lethal injection and to oppose laws that require or prohibit pharmacists from participation in lethal injection cases. […]
0.787
Table 6: Examples of input-side evidence alignment by the proposed method. Bold text indicates the gold hallucination span. Cyan and red indicate masked faithful and hallucinated output words, respectively. Green , orange , and purple indicate the top- 1 , - 2 , and - 3 predicted input-side words, respectively. “Conf.” colum shows the confidence values.
Type
QA
Sum
Evident Conflict
2,349
5,812
Subtle Conflict
0
339
Evident Baseless Info
23,441
10,820
Subtle Baseless Info
5,545
1,020
Table 7: Number of hallucinated characters for each hallucination type
Type
QA
Sum
Evident Conflict
14.0
16.6
Subtle Conflict
-
18.3
Evident Baseless Info
87.6
50.1
Subtle Baseless Info
91.2
37.7
Table 8: Recall of hallucination detection by type
Figure 3: Distribution of maximum confidence values by hallucination type. The red dashed line indicates the decision threshold λh=0.68 .
Figure 4: Original maximum confidence distributions. Blue and orange correspond to faithful and hallucinated tokens, respectively. The red dashed line represents the threshold λh .
Figure 5: Maximum confidence distributions after fine-tuning on QA
Figure 6: Maximum confidence distributions after fine-tuning on Summarization
As Large Language Models (LLMs) increasingly serve as foundational reasoning engines, their tendency to hallucinate remains a critical vulnerability. While recent internal state probes offer a promising alternative to slow external retrieval systems, they largely reduce hallucination detection to a token-wise binary classification task, failing to capture the structured, sequential boundaries of semantic drift. Here, we introduce an internal hidden state framework for fine-grained, span-level hallucination detection. By inspecting layer-wise activation patterns, we attempt to detect the exact hallucination onset and continuation tokens in an LLM generation. Our experiments show that this approach successfully isolates hallucination onsets, achieving substantial improvements in Precision-Recall AUC over random baselines despite extreme class imbalance. Ultimately, we propose a novel cross-model detection framework in which one model observes the internal representations elicited by another model's generation. We find that an external observer can match or exceed a generator's self-detection of its own hallucination onsets, including when the observer is the smaller model, suggesting that self-detection is not the ceiling for onset localisation.
Kingshuk Gupta, Davide Buscaldi
LIX, École Polytechnique · School of Electrical and Electronic Engineering, Nanyang Technological University · LIPN, Sorbonne Paris Nord
Large language models (LLMs) hallucinate with confidence: their outputs can be fluent, authoritative, and simply wrong. In medical, legal, and scientific applications this failure causes direct harm, and detecting it from internal model states offers a path to safer deployment. A growing body of work reports that this problem is increasingly tractable, with recent methods achieving high detection performance on widely used benchmarks. We show, however, that much of this apparent progress does not survive scrutiny. Four of the six corpora embed the ground-truth answer directly in the input prompt. A naïve text-similarity baseline we call TxTemb exploits this to achieve near-perfect detection scores without any access to model internals. To measure what genuine detection capability remains once these artifacts are controlled, we conduct a large-scale evaluation spanning twenty-two detection methods, twelve open-source models spanning six architectural families, and six corpora. We further introduce DRIFT, a supervised probe over inter-layer hidden-state transitions, as a point of comparison for live-generation detection. Our findings suggest that the field's reported progress on hallucination detection is substantially explained by benchmark construction artifacts in widely used corpora, and that the majority of established baselines perform near chance under controlled conditions; the consistent exceptions are SAPLMA and DRIFT, both supervised probes on upper-layer hidden states.
Large language models generate fluent text that can contain unfaithful claims -- a phenomenon known as hallucination. We present a multi-signal detection pipeline combining fine-tuned DeBERTa-v3 classification, Monte Carlo (MC) Dropout uncertainty quantification, and temperature-scaled calibration for response-level hallucination detection. Evaluated on the HaluEval benchmark, our pipeline achieves F1=0.915 and AUROC=0.977 on general-domain tasks, with per-task F1 scores of 0.97 (QA), 0.96 (Summarization), and 0.82 (Dialogue). MC Dropout inference further improves accuracy to 93.2%. A context ablation study confirms the model performs genuine entailment reasoning rather than exploiting surface patterns, with summarization F1 dropping 24% when knowledge context is removed. Learning curve analysis reveals that 25% of training data captures 77% of full-data performance. Beyond detection, we apply Direct Preference Optimization (DPO) to a Qwen2.5-0.5B generator, reducing its hallucination rate from 85.5% to 37.7% (55.9% relative reduction) as measured by our detector. Cross-domain evaluation on the SciFact biomedical benchmark shows that general-domain training transfers poorly (F1=0.52), motivating domain-specific fine-tuning. PubMedBERT fine-tuned on SciFact achieves F1=0.63 and AUROC=0.81, demonstrating that domain-matched pre-training is the strongest adaptation strategy. Code and models are available at https://github.com/varunteja99/hallucination-detection-nlp
Varun Teja Chundru, Debasmita Biswas
Department of Computer Science Purdue University Fort Wayne