Abstract
Ensuring that Large Language Models (LLMs) can provide verifiable answers is critical for their deployment in high-stakes domains. While Retrieval-Augmented Generation (RAG) is the current industry standard for knowledge attribution, it suffers from high latency and sensitivity to retrieval noise. This paper presents Cite Pretrain, a novel framework that teaches LLMs to cite their training data directly from internal memory without an external retriever. By utilizing an "Active Indexing" strategy during continual pretraining, models learn to bind factual knowledge to persistent document identifiers. Our results demonstrate that this approach significantly improves citation precision—by up to 30.2%—and creates models that are more robust and scalable than those relying on traditional passive indexing.
Introduction
The challenge of "hallucination" in LLMs often stems from a lack of explicit grounding in training sources. While RAG attempts to solve this by providing external context at inference time, it does not address what the model inherently "knows." Furthermore, RAG dependencies add infrastructure complexity and latency. Cite Pretrain explores a different path: can we transform an LLM into its own librarian? By embedding citations directly into the model's weights, we aim to achieve high-fidelity knowledge attribution that is both fast and retriever-free.
Methodology: Active Indexing
The core of Cite Pretrain is a two-stage process: Continual Pretraining (Index Learning) and Instruction Tuning. The innovation lies in the transition from "Passive Indexing"—simply appending document IDs to text—to Active Indexing.
Active Indexing employs a bidirectional synthetic data augmentation strategy to force the model to internalize the relationship between facts and sources:
- Forward Augmentation (Source → Fact): The model is prompted with a document ID and trained to generate the corresponding factual content.
- Backward Augmentation (Fact → Source): The model is given a fact and trained to identify the specific document ID it originated from.
To ensure the validity of generated citations at inference time, the framework utilizes constrained decoding, restricting the model's output to valid titles within the training corpus.
Experimental Setup
We evaluated Cite Pretrain using CitePretrainBench, a diverse benchmark spanning multiple domains:
- ASQA (Wikipedia): Long-form factoid question answering.
- ELI5 (Common Crawl): Open-ended explanations.
- SciQAG (arXiv): Technical and scientific grounding.
- RepliQA: Fictional documents designed to test the model's ability to learn entirely new, unseen information.
Experiments were conducted primarily on Qwen-2.5-3B and 7B architectures.
Key Results and Analysis
The implementation of Active Indexing yielded substantial improvements across all metrics. As shown in the performance table, the full Active Indexing (ActIdx) approach consistently outperformed baseline instruction-only (InsOnly) and passive indexing (PassIdx) methods.
Scaling and Robustness
A significant finding is the scalability of this approach. Unlike passive indexing, which tends to saturate quickly, Active Indexing shows a nearly linear improvement in citation precision as the augmentation ratio increases. Even at 16x the original token count, performance continued to climb. Additionally, larger models (7B) demonstrated a superior capacity for complex attribution tasks, often outperforming proprietary models like GPT-4 on specialized datasets like arXiv.
Discussion and Limitations
While Cite Pretrain offers a promising path toward retriever-free attribution, several challenges remain. The reliance on LLM-generated synthetic data for augmentation could potentially propagate hallucinations into the training set. Furthermore, as models become more adept at verbatim citation, privacy and copyright concerns regarding the "replaying" of training data must be addressed. Future research will focus on scaling these techniques to trillion-token datasets and exploring privacy-preserving identifiers.
Conclusion
Cite Pretrain demonstrates that knowledge attribution can be effectively internalized within LLM weights. By moving beyond passive reading to active, bidirectional indexing, we can create models that are not only more accurate but also fundamentally more transparent about the origins of their knowledge.
Summary updated