Rewriting History: A Recipe for Interventional Analyses to Study Data Effects on Model Behavior
Rahul Nadkarni, Yanai Elazar, Hila Gonen, Noah A. Smith
TL;DR
The paper tackles how pretraining data shape language-model behavior by proposing a formal, reusable interventional recipe that tests causal links through counterfactual retraining. It defines three stages—selecting evaluation items, identifying relevant documents, and intervening on those documents before retraining—and demonstrates the approach via two case studies on factual knowledge: term cooccurrence and information-retrieval–based queries. The findings show that manipulating training data can modulate knowledge learning, but simple interventions do not fully explain how facts are acquired, highlighting the need for more nuanced document selection and broader interventions. The work provides a practical framework and open-source guidance to study data-behavior relationships in LMs, enabling researchers to test new hypotheses about data effects.
Abstract
We present an experimental recipe for studying the relationship between training data and language model (LM) behavior. We outline steps for intervening on data batches -- i.e., ``rewriting history'' -- and then retraining model checkpoints over that data to test hypotheses relating data to behavior. Our recipe breaks down such an intervention into stages that include selecting evaluation items from a benchmark that measures model behavior, matching relevant documents to those items, and modifying those documents before retraining and measuring the effects. We demonstrate the utility of our recipe through case studies on factual knowledge acquisition in LMs, using both cooccurrence statistics and information retrieval methods to identify documents that might contribute to knowledge learning. Our results supplement past observational analyses that link cooccurrence to model behavior, while demonstrating that extant methods for identifying relevant training documents do not fully explain an LM's ability to correctly answer knowledge questions. Overall, we outline a recipe that researchers can follow to test further hypotheses about how training data affects model behavior. Our code is made publicly available to promote future work.
