Abstract
Data attribution methods are used to measure the contribution of training data towards model outputs, and have several important applications in areas such as dataset curation and model interpretability. However, many standard data attribution methods, such as influence functions, utilize model gradients and are computationally expensive. In our paper, we show in-context probing (ICP) -- prompting a LLM -- can serve as a fast proxy for gradient-based data attribution for data selection under conditions contingent on data similarity. We study this connection empirically on standard NLP tasks, and show that ICP and gradient-based data attribution are well-correlated in identifying influential training data for tasks that share similar task type and content as the training data. Additionally, fine-tuning models on influential data selected by both methods achieves comparable downstream performance, further emphasizing their similarities. We also examine the connection between ICP and gradient-based data attribution using synthetic data on linear regression tasks. Our synthetic data experiments show similar results with those from NLP tasks, suggesting that this connection can be isolated in simpler settings, which offers a pathway to bridging their differences.
Introduction
Data attribution is the "detective work" of machine learning: it aims to identify which specific training examples caused a model to produce a particular output. This is vital for cleaning noisy datasets, improving model interpretability, and valuing data. Traditionally, this is done using Influence Functions, which rely on calculating model gradients. For Large Language Models (LLMs) with billions of parameters, calculating these gradients is computationally staggering and often impossible for "black-box" models accessed via APIs. This paper investigates whether we can bypass gradients entirely by using the LLM's own in-context learning (ICL) abilities to "probe" the value of data.
Methodology
The researchers compare three distinct approaches to data valuation:
- Influence Inner Product (InflIP): A standard gradient-based method that measures the alignment between the gradient of a training point and a test point.
- Local Data Influence (InflLoc): A "one-step" method that measures how much the model's likelihood for a test point changes after a single step of fine-tuning on a training point.
- In-Context Probing (ICP): The novel proxy. It measures the model's likelihood for a test point when a training point is provided in the prompt as a one-shot example.
The theoretical backbone of the paper is the "implicit gradient descent" hypothesis: the idea that a Transformer's forward pass over a prompt effectively performs a mathematical operation similar to a gradient update.
Key Results and Insights
High Correlation in Similar Domains
On the Alpaca instruction-following dataset, ICP and InflIP rankings showed a high Spearman correlation (up to 0.73 for Pythia-1b). This correlation is strongest when the training data and the target task share the same task type (e.g., both are instruction-following) and content (semantic similarity as measured by BertScore).
The Breaking Point: Task Similarity
When the task types differ (e.g., trying to use unstructured pretraining data to influence an instruction-following task), the connection between ICP and gradient-based attribution collapses. ICP essentially "fails" to recognize the influence of data that doesn't look like a demonstration, highlighting that its utility as a proxy is contingent on task alignment.
Comparable Downstream Performance
Models fine-tuned on the top 15% of data selected by ICP achieved an overall win rate of 62.26% on Alpaca Eval, nearly identical to the 62.98% achieved by data selected via the much more expensive InflIP. Crucially, ICP is significantly more efficient; scoring the Alpaca dataset took 10 GPU hours with ICP, compared to 90 GPU hours for the gradient-based InflIP—a 9x speedup.
Conclusion
In-Context Probing offers a powerful, efficient, and black-box-compatible alternative to gradient-based data attribution. While its effectiveness is bound by task and content similarity, its performance on instruction-tuning data makes it a viable tool for practical dataset curation in the era of massive LLMs. Future work remains to determine if these correlations strengthen as models scale and to bridge the theoretical gap between ICL and formal influence functions.
Summary updated