Do Influence Functions Work on Large Language Models? (2025)

Abstract: Influence functions are important for quantifying the impact of individual training data points on a model’s predictions. Although extensive research has been conducted on influence functions in traditional machine learning models, their application to large language models (LLMs) has been limited. In this work, we conduct a systematic study to address a key question: do influence functions work on LLMs? Specifically, we evaluate influence functions across multiple tasks and find that they consistently perform poorly in most settings. Our further investigation reveals that their poor performance can be attributed to: (1) inevitable approximation errors when estimating the iHVP component due to the scale of LLMs, (2) uncertain convergence during fine-tuning, and, more fundamentally, (3) the definition itself, as changes in model parameters do not necessarily correlate with changes in LLM behavior. Thus, our study suggests the need for alternative approaches for identifying influential samples.

## introduction large language models (llms) such as gpt-4 @xcite , llama2 @xcite have demonstrated remarkable abilities in generating highquality texts and have been increasingly adopted in many real-world applications. despite the success in scaling language models with a large number of parameters and extensive training corpora @xcite @xcite , recent studies @xcite @xcite emphasize the critical importance of high-quality training data. high-quality data are essential for llms' taskspecific fine-tuning and alignment, since llms' performance can be severely compromised by poorquality data @xcite @xcite . thus, systematically quantifying the impact of specific training data on an llm's output is vital. by identifying either high-quality samples that align with expected outcomes or poorquality (or even adversarial) samples that misalign, we can improve llm performance and offer more transparent explanations of their predictions. unfortunately, efficiently tracing the impact of specific training data on an llm's output is highly non-trivial due to their large parameter space. traditional methods, such as leave-one-out validation @xcite and shapley values @xcite , require retraining the model when specific samples are included or excluded, a process that is impractical for llm. to address this challenge, influence functions @xcite have been introduced as a predominant alternative to leave-one-out validation by approximating its effects using gradient information, thereby avoiding the need for model retraining. these methods have been applied to traditional neural networks @xcite @xcite and more recently to llms @xcite @xcite . however, existing methods for applying influence functions to llms have focused mainly on efficiently computing these functions rather than fundamentally assessing their effectiveness across various tasks. given the complex architecture and vast parameter space of llms, we thus raise the question: are influence functions effective or even relevant to explaining llm behavior? in this work, we conduct a systematic study to investigate the effectiveness of influence functions on llms across multiple tasks specifically designed to answer this question. our results empirically demonstrate that influence functions consistently perform poorly in most settings. to understand the underlying reasons, we conducted further studies and identified three key factors contributing to their poor performance on llms. first, there are inevitable approximation errors when estimating the inverse-hessian vector products (ihvp) integral to influence functions. second, the uncertain convergence state during fine-tuning complicates the selection of initial convergent parameters, making the computation of influence challenging. lastly, and most fundamentally, influence functions are defined based on a measure of parameter changes, which do not necessarily reflect changes in llm behavior. our research highlights the limitations of applying influence functions to llms and calls for alternative methods to quantify the "influence" of training data on llm outputs. our contributions. in summary, we investigate the effectiveness of influence functions on llms across various tasks and settings. our extensive experiments show that influence functions generally perform poorly and are both computationally and memory-intensive. we identify several factors that significantly limit their applicability to llms. the previously reported successes of influence functions on llms are likely due to the specificity of the case studies. our research thus calls for research on developing alternative definitions and methods for identifying influential training samples. ## preliminaries let f θ : @xmath0; y denotes the target space; and the model f is parameterized by θ. given a training dataset ## empirical study we start with empirically investigating the effectiveness of influence functions on llms through three tasks: (1) harmful data identification, (2) class attribution, and (3) backdoor trigger detection. all the experiments are conducted using publicly available llms and datasets. ## why influence functions fail on llms as shown in the previous section, influence functions consistently perform poorly across three different tasks. the data they identify as most influential often does not match our expectations, while representation-based matching consistently does a better job. these empirical observations suggest that influence functions may not be suitable for explaining llms' behavior. in this section, we identify and discuss three perspectives that explain why influence functions may fail on llms: ## conclusion in this work, we conduct a comprehensive evaluation of influence functions-an important method for data attribution-when applied to llms, revealing their relatively poor performance across various tasks. we identify and analyze several key factors contributing to this inefficacy, including approximation errors, uncertain convergence states, and misalignment between parameter changes and llm's behaviors. these findings challenge previously reported successes of influence functions, suggesting that these outcomes were more likely driven by specific case studies than by accurate computations. we underscore the instability of gradient-based explanations and advocate for a comprehensive reevaluation of influence functions in future research to better understand their limitations and potential in various contexts. finally, our research highlights the need for alternative approaches to effectively identify influential training data.