Abstract
Language models (LMs) have been shown to memorize a great deal of factual knowledge contained in their training data. But when an LM generates an assertion, it is often difficult to determine where it learned this information and whether it is true. In this paper, we propose the problem of fact tracing: identifying which training examples taught an LM to generate a particular factual assertion. Prior work on training data attribution (TDA) may offer effective tools for identifying such examples, known as "proponents". We present the first quantitative benchmark to evaluate this. We compare two popular families of TDA methods -- gradient-based and embedding-based -- and find that much headroom remains. For example, both methods have lower proponent-retrieval precision than an information retrieval baseline (BM25) that does not have access to the LM at all. We identify key challenges that may be necessary for further improvement such as overcoming the problem of gradient saturation, and also show how several nuanced implementation details of existing neural TDA methods can significantly improve overall fact tracing performance.
Introduction
Large Language Models (LLMs) function as vast repositories of information, yet they remain "black boxes" regarding the provenance of their knowledge. When a model generates a factual claim, it is often impossible to identify the specific training document that informed that claim. This lack of transparency poses significant risks for reliability, copyright, and the ability to correct hallucinations.
This paper formalizes the task of fact tracing: the identification of specific training examples, termed "proponents," that are responsible for a model's ability to generate a particular factual assertion. By evaluating existing Training Data Attribution (TDA) methods, we aim to establish a baseline for how well we can currently map model outputs back to their training sources.
Methodology
We evaluate three distinct approaches to training data attribution:
- Gradient-based Attribution (TracIn): This method estimates the influence of a training example by calculating how much the model's parameters would have changed had it been trained on that specific example. We utilize an optimized version of TracIn that accounts for the Adafactor optimizer's momentum to better reflect the actual training dynamics.
- Embedding-based Attribution (EMBED): This approach treats the model's internal representations as a latent space for information retrieval. It computes the cosine similarity between the embeddings of the training data and the test query.
- BM25 Baseline: A traditional keyword-matching algorithm (Best Matching 25) that ranks documents based on lexical overlap, serving as a model-agnostic control.
To evaluate these methods at scale, we employ a reranking setup. Rather than searching the entire training corpus, the methods are tasked with identifying the true proponent from a candidate set of 100 sentences, which includes the ground truth, top BM25 results, and random distractors.
The FTRACE Benchmark
We introduce FTRACE, a benchmark designed to provide ground-truth proponents for factual knowledge. It consists of two components:
- FTRACE-TREX: Utilizing real-world facts, we employ a "novel fact injection" technique. We identify facts unknown to a pre-trained MT5-base model and fine-tune the model on specific sentences containing these facts. This creates a clear, known link between a training sentence and a generated fact.
- FTRACE-SYNTH: A synthetic dataset featuring unique entities and relations. This environment eliminates prior knowledge and lexical noise, allowing for a "pure" test of TDA logic.
Results and Discussion
Our experiments reveal a significant performance gap between simple lexical baselines and sophisticated neural attribution methods.
The BM25 Paradox
On the FTRACE-TREX dataset, the BM25 baseline achieved a Mean Reciprocal Rank (MRR) of 77.55, significantly outperforming the best neural methods (EMBED at 64.29 and TracIn at 48.56). This suggests that in natural language settings, neural methods often struggle to distinguish between a causal training example and one that is merely semantically similar.
Synthetic Success and Gradient Saturation
In contrast, on the FTRACE-SYNTH dataset, TracIn achieved a perfect 100.00 MRR. This indicates that the underlying mathematical framework of gradient-based attribution is sound; however, its application to natural language is complicated by "gradient saturation." When a model learns a fact to the point of near-zero loss, the gradient signal vanishes, making it difficult to trace the knowledge back to its source. This is particularly problematic for facts learned during early pre-training.
Layer-wise Sensitivity
We observed that the most effective attribution signals often originate from the embedding layer (the first layer of the model). This suggests that the model's initial representation of tokens is a primary driver of factual identity, more so than the higher-level abstractions formed in later layers.
Conclusion
While TDA methods show great promise in controlled synthetic environments, they currently lag behind simple information retrieval techniques on real-world data. Future research must address the challenge of gradient saturation and the noise inherent in natural language to provide the transparency required for trustworthy AI. Ensembling different TDA methods—which appear to capture orthogonal information—remains a promising path forward.
Summary updated