Abstract
Neural sequence models often generate fluent but factually unsupported text, known as hallucinations. This paper introduces a method for detecting these at the token level by training on synthetic data. By using a pretrained BART model to fill masked segments of target sentences without source context, the authors create a "hallucination factory." A detector fine-tuned on this data identifies unfaithful content without requiring reference translations, enabling significant performance gains in low-resource machine translation through rectified training.
Introduction
Neural sequence models are highly effective at producing natural language but suffer from "hallucination"—generating content logically inconsistent with the input. Because these outputs are fluent, they are difficult to detect. Standard metrics like BLEU focus on surface similarity and fail to catch these semantic errors. Furthermore, most existing metrics provide only sentence-level scores. This work proposes a token-level hallucination detection task and a method to train models for it without human-labeled data.
Methodology
The authors propose a two-part solution involving synthetic data generation and a token-level detector.
Synthetic Data Generation
To address the lack of human-labeled data, the authors created a "hallucination factory." They take a correct target sentence, mask parts of it, and use a pretrained BART model to fill the blanks. Since BART does not see the original source text, it naturally hallucinates new content to maintain fluency.
Token-Level Labeling and Detection
By comparing the original sentence with the BART-generated version using edit distance, tokens are automatically labeled as "faithful" (0) or "hallucinated" (1). Large pretrained models (XLM-RoBERTa for translation, RoBERTa for summarization) are then fine-tuned on this data. At test time, the model predicts a label for every word based on the source and generated output.
Rectified Training
The token-level labels are used to improve model training. In a self-training setup, the loss on tokens identified as hallucinations is masked or ignored, preventing the model from learning unfaithful patterns from noisy data.
Datasets and Evaluation
The approach was evaluated on:
- XSUM: Abstractive summarization of BBC articles.
- Machine Translation (MT): A multi-domain Chinese-English dataset.
- New Benchmarks: Manual annotations for MT in Patent and COVID-19 domains to test robustness.
- Quality Estimation: The WMT18 English-German word-level quality estimation task.
Key Insights
- Fluency as a Tool: The fluency of generative models like BART can be leveraged to create high-quality synthetic data for detection tasks.
- Reference-Free Detection: The model detects hallucinations using only the source input and output, making it suitable for real-time deployment.
- Granularity: Moving to token-level labels allows for "surgical" interventions during training, preserving the correct parts of a sentence.
- POS Trends: Analysis indicates that nouns are the most frequently hallucinated part of speech, likely due to their factual weight.
Results
The proposed model consistently outperformed baselines across six benchmarks, achieving an average F1 score of approximately 0.60 without human-annotated training data. In low-resource MT, filtering hallucinated tokens improved BLEU scores significantly (e.g., from 0.14 to 5.18 in a noisy setup). It also achieved state-of-the-art results on the WMT18 Quality Estimation task, surpassing the previous best system by 2 points.
Limitations
Human agreement on hallucinations is only moderate (Kappa ≈ 0.56), highlighting the task's difficulty. Technical limitations include the 512-token input limit of RoBERTa, which may truncate long documents in summarization. Future work could utilize "Longformer" architectures or extend the framework to data-to-text generation.
Summary updated