UNDERSTANDING INFLUENCE FUNCTIONS AND DATA-MODELS VIA HARMONIC ANALYSIS

Abstract

Influence functions estimate effect of individual data points on predictions of the model on test data and were adapted to deep learning in Koh & Liang (2017). They have been used for detecting data poisoning, detecting helpful and harmful examples, influence of groups of datapoints, etc. Recently, Ilyas et al. ( 2022) introduced a linear regression method they termed datamodels to predict the effect of training points on outputs on test data. The current paper seeks to provide a better theoretical understanding of such interesting empirical phenomena. The primary tool is harmonic analysis and the idea of noise stability. Contributions include: (a) Exact characterization of the learnt datamodel in terms of Fourier coefficients. (b) An efficient method to estimate the residual error and quality of the optimum linear datamodel without having to train the datamodel. (c) New insights into when influences of groups of datapoints may or may not add up linearly.

1. INTRODUCTION

It is often of great interest to quantify how the presence or absence of a particular training data point affects the trained model's performance on test data points. Influence functions is a classical idea for this (Jaeckel, 1972; Hampel, 1974; Cook, 1977) that has recently been adapted to modern deep models and large datasets Koh & Liang (2017) . Influence functions have been applied to explain predictions and produce confidence intervals (Schulam & Saria, 2019) , investigate model bias (Brunet et al., 2019; Wang et al., 2019) , estimate Shapley values (Jia et al., 2019; Ghorbani & Zou, 2019) , improve human trust (Zhou et al., 2019) , and craft data poisoning attacks (Koh et al., 2019) . Influence actually has different formalizations. The classic calculus-based estimate (henceforth referred to as continuous influence) involves conceptualizing training loss as a weighted sum over training datapoints, where the weighting of a particular datapoint z can be varied infinitesimally. Using gradient and Hessian one obtains an expression for the rate of change in test error (or other functions) of z ′ with respect to (infinitesimal) changes to weighting of z. Though the estimate is derived only for infinitesimal change to the weighting of z in the training set, in practice it has been employed also as a reasonable estimate for the discrete notion of influence, which is the effect of completely adding/removing the data point from the training dataset (Koh & Liang, 2017) . Informally speaking, this discrete influence is defined as f (S ∪ {i})f (S) where f is some function of the test points, S is a training dataset and i is the index of a training point. (This can be noisy, so several papers use expected influence of i by taking the expectation over random choice of S of a certain size; see Section 2.) Koh & Liang (2017) as well as subsequent papers have used continuous influence to estimate the effect of decidedly non-infinitesimal changes to the dataset, such as changing the training set by adding or deleting entire groups of datapoints (Koh et al., 2019 ). Recently Bae et al. (2022) show mathematical reasons why this is not well-founded, and give a clearer explanation (and alternative implementation) of Koh-Liang style estimators. Yet another idea related to influence functions is linear datamodels in Ilyas et al. (2022) . By training many models on subsets of p fraction of datapoints in the training set, the authors show that some interesting measures of test error (defined using logit values) behave as follows: the measure f (x) is well-approximable as a (sparse) linear expression θ 0 + i θ i x i , where x is a binary vector denoting a sample of p fraction of training datapoints, with x i = 1 indicating presence of i-th training point and x i = -1 denoting absence. The coefficients θ i are estimated via lasso regression. The surprise here is that f (x) -which is the result of deep learning on dataset x-is well-approximated by θ 0 + i θ i x i . The authors note that the θ i 's can be viewed as heuristic estimates for the discrete influence of the ith datapoint. The current paper seeks to provide better theoretical understanding of above-mentioned phenomena concerning discrete influence functions. At first sight this quest appears difficult. The calculus definition of influence functions (which as mentioned is also used in practice to estimate the discrete notions of influence) involves Hessians and gradients evaluated on the trained net, and thus one imagines that any explanation for properties of influence functions must await better mathematical understanding of datasets, net architectures, and training algorithms. Surprisingly, we show that the explanation for many observed properties turns out to be fairly generic. Our chief technical tool is harmonic analysis, and especially theory of noise stability of functions (see O'Donnell (2014) for an excellent survey).

1.1. OUR CONCEPTUAL FRAMEWORK (DISCRETE INFLUENCE)

Training data points are numbered 1 through N , but the model is being trained on a random subset of data points, where each data point is included independently in the subset with probability p. (This is precisely the setting in linear datamodels.) For notational ease and consistency with harmonic analysis, we denote this subset by x ∈ {-1, +1} N where +1 means the corresponding data point was included. We are interested in some quantity f (x) associated with the trained model on one or more test data points. Note f is a probabilistic function of x due to stochasticity in deep net training -SGD, dropout, data augmentation etc. -but one can average over the stochastic choices and think of f as deterministic function f : {±1} N → R. (In practice, this means we estimate f (x) by repeating the training on x, say, 10 to 50 times.) This scenario is close to classical study of boolean functions via harmonic analysis, except our function is real-valued. Using those tools we provide the following new mathematical understanding: 1. We give reasons for existence of datamodels of Ilyas et al. ( 2022), the phenomenon that functions related to test error are well-approximable by a linear function θ 0 + i θ i x i . See Section 3.1. 2. Section 2 gives exact characterizations of the θ i 's for data models with/without regularization. (Earlier, Ilyas et al. (2022) noted this for a special case: p = 0.5, ℓ 2 regularization) 3. Using our framework, we give a new algorithm to estimate the degree to which a test function f is well-approximated by a linear datamodel, without having to train the datamodel per se. See Section 3.2, where our method needs only O(1/ϵ 3 ) samples instead of O(N/ϵ 2 ). 4. We study group influence, which quantifies the effect of adding or deleting a set I of datapoints to x. Ilyas et al. (2022) note that this can often be well-approximated by linearly adding the individual influences of points in I. Section 4 clarifies simple settings where linearity would fail, by a factor exponentially large in |I|, and also discusses potential reasons for the observed linearity. 2019) use harmonic analysis to decompose a neural network into a piecewise linear Fourier series, thus finding that neural networks exhibit spectral bias.



OTHER RELATED WORK Narasimhan et al. (2015) investigate when influence is PAC learnable. Basu et al. (2020) use second order influence functions and find they make better predictions than first order influence functions. Cohen et al. (2020) use influence functions to detect adversarial examples. Kong et al. (2021) propose an influence based re-labeling function that can relabel harmful examples to improve generalization instead of just discarding them. Zhang & Zhang (2022) use Neural Tangent Kernels to understand influence functions rigorously for highly overparametrized nets. Pruthi et al. (2020) give another notion of influence by tracing the effect of data points on the loss throughout gradient descent. Chen et al. (2020) define multi-stage influence functions to trace influence all the way back to pre-training to find which samples were most helpful during pre-training. Basu et al. (2021) find that influence functions are fragile, in the sense that the quality of influence estimates depend on the architecture and training procedure. Alaa & Van Der Schaar (2020) use higher order influence functions to characterize uncertainty in a jack-knife estimate. Teso et al. (2021) introduce Cincer, which uses influence functions to identify suspicious pairs of examples for interactive label cleaning. Rahaman et al. (

