Abstract
Large Language Models (LLMs) often struggle with hallucinations and unreliable attribution, leading to a lack of trust in high-stakes domains. This paper introduces SAFE (Sentence-level Attribution FramEwork), a novel system designed to verify LLM outputs sentence-by-sentence during generation. SAFE employs a "think before you attribute" approach by first predicting the number of required references for a sentence. Experimental results show that SAFE achieves up to 95% classification accuracy and improves retrieval performance by 2.1% to 6.0%, offering a more reliable and interactive attribution mechanism for Retrieval-Augmented Generation (RAG) systems.
Introduction
The rapid adoption of LLMs in scientific and professional fields is hindered by two primary issues: hallucinations and "citation theater"—the practice of providing incorrect or unnecessary references. Current RAG systems typically provide citations post-hoc or at the document level, making verification cumbersome for users. The core challenge lies in the model's inability to assess the informational complexity of its own output before attempting to ground it in external evidence. The authors identify this as a "missing link" in current attribution pipelines.
The SAFE Framework
The SAFE framework addresses these challenges through a two-step "in-generation" pipeline that transforms the LLM from a black box into an interactive tool.
- Pre-attribution Classification: Before retrieval, a classifier (e.g., XGBoost or Random Forest) analyzes the generated sentence to determine if it requires zero (common knowledge), one (single fact), or multiple (complex facts) references. This classification is based on 24 numerical textual features (like named entity density) or sentence embeddings.
- Attribution: Based on the predicted reference count, the system selects an appropriate retrieval algorithm (such as SC1/SC2, BM25, or SPLADE) to identify supporting quotes from source documents.
This sentence-by-sentence approach allows for real-time interaction, where users can stop and correct the model mid-generation if a claim lacks sufficient grounding in the provided documents.
Datasets and Benchmarking
The study evaluates SAFE using WebGLM-QA and HAGRID. Recognizing the noise in existing datasets—where sentences are often over- or under-referenced—the authors introduced HAGRID-Clean. This manually curated subset features corrected labels and serves as a more rigorous standard for evaluating attribution systems, ensuring that models are not penalized for failing to find citations for filler text.
Results and Discussion
The pre-attribution step proved highly effective, reaching 95% accuracy on the HAGRID-Clean dataset. Interestingly, simple numerical features often performed as well as or better than complex high-dimensional embeddings for this classification task.
By filtering out sentences that do not require attribution, SAFE avoids the common pitfall of hallucinating citations for filler text. The integration of this step improved the accuracy of all tested attribution algorithms by 2.1% to 6.0% over standard "top-1" retrieval baselines. Furthermore, the efficiency of the XGBoost classifier ensures that this verification process does not significantly impact generation speed, making it viable for real-time applications.
Conclusion and Future Work
SAFE represents a significant step toward more transparent and reliable LLMs. By incorporating a pre-attribution "thinking" phase, the framework reduces citation theater and enables real-time fact-checking. While the system is highly effective, the authors note that sentence-level retrieval can sometimes lead to context loss. Future work will explore semi-supervised learning to expand training data and refine how the system handles out-of-context retrieved sentences.
Summary updated