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