TL;DR
OLMoTrace is a novel system that allows us to trace language model (LM) outputs directly back to their original training data, even across massive multi-trillion-token datasets. This breakthrough enables unprecedented insight into why LMs generate specific text, facilitating tasks like fact-checking and understanding model behavior.
What Problem Does This Paper Address?
Modern Large Language Models (LLMs) are trained on colossal datasets, often containing trillions of tokens. While these models exhibit remarkable capabilities, understanding the origin of their outputs—especially for high-stakes applications—remains a significant challenge. Existing methods for tracing LM outputs back to training data struggle to scale to such massive datasets due to their heavy computational demands. This gap makes it difficult to debug, verify, and trust LM generations, hindering their adoption in critical domains.
Methods
The core of OLMoTrace's innovation lies in its efficient tracing mechanism, powered by an extended version of the infini-gram system. The process involves several key steps:
- Maximal Matching Spans: OLMoTrace first identifies "maximal matching spans" – segments of the LM output that appear verbatim in the training data. This is achieved by leveraging
infini-gram's ability to index and search massive text corpora using suffix arrays. A novel parallel algorithm significantly speeds up this process, reducing the time complexity. - Filtering for Long and Unique Spans: To focus on more informative matches, spans are filtered based on their unigram probability, prioritizing those that are longer and contain less common tokens.
- Retrieving Enclosing Documents: For each filtered span, OLMoTrace retrieves up to 10 documents from the training data that contain the span.
- Merging Spans and Documents: Overlapping spans and multiple snippets from the same document are merged to simplify the user interface.
- Reranking Documents by Relevance: Documents are reranked using the BM25 score, which measures the relevance of retrieved documents to the LM output and user prompt. This helps prioritize the most pertinent sources.
The system is designed for real-time performance, returning results within seconds, making it interactive and user-friendly.
Datasets
The paper primarily discusses the use of the OLMo models' training data for tracing. Specifically, it mentions the OLMo-2-32B-Instruct model, which was trained on approximately 3.2 billion documents and 4.6 trillion tokens, encompassing pre-training, mid-training, and post-training (SFT, DPO, RLVR) datasets. The system is designed to be applicable to any LM, provided access to its full training data.
Key Insights and Ideas
- Scalability is Key: The most significant insight is the development of a system that can efficiently trace LM outputs across trillions of tokens in near real-time. This overcomes a major hurdle in understanding large models.
- Verbatim Matches as Direct Connections: OLMoTrace focuses on exact, verbatim matches. The paper posits that these direct lexical connections are the most straightforward way to understand where an LM might have learned a particular phrase or sentence.
- Beyond "Black Box": By revealing the training data origins, OLMoTrace moves beyond treating LMs as complete black boxes, offering a lens through which to understand their behavior.
- "Creative" Expressions Aren't Always Novel: The system can reveal that seemingly novel or creative LM outputs might be verbatim reproductions of text found in the training data, such as fan fiction or specific writing styles.
Key Results
- Low Inference Latency: OLMoTrace achieves an average inference latency of 4.46 seconds for LM responses of around 458 tokens, enabling real-time interaction.
- Span Length: The selected spans are relatively long, with a mean length of 10.4 tokens, indicating substantial verbatim matches.
- Document Relevance: The system achieves good document relevance, with an average score of 1.82 for the first displayed document and 1.50 for the top-5 documents (on a 0-3 scale), as evaluated by LLM-as-a-Judge.
- Training Data Distribution: The vast majority (96.7%) of retrieved documents belong to the pre-training data, with smaller percentages from mid-training (0.9%) and post-training (2.4%) stages.
Limitations and Future Work
- Verbatim Matches Only: OLMoTrace currently only identifies verbatim matches. It does not capture paraphrased or semantically similar content, which might also influence LM outputs.
- Correlation vs. Causation: The retrieved documents are not necessarily causal for the LM's output, nor are they intended as citations or evidence. They simply show where the text was found.
- Copyright and PII: The paper acknowledges the potential for exposing problematic content, including copyright infringement and PII. While measures are in place (takedown requests, PII filtering), this remains an area of concern.
- Future Work: The authors invite the community to explore additional use cases for OLMoTrace, suggesting its potential in fact-checking, understanding hallucinations, and exploring LM creativity. Further research could focus on extending tracing to non-verbatim matches and exploring the causal relationship between training data and LM behavior.
Summary updated