Agustin Picard

Lucas Hervier

Thomas Fel

David Vigouroux

Influenciae A library for tracing the influence back to the data-points

In today's AI-driven world, understanding model behavior is becoming more important than ever. While libraries abound for doing so via traditional XAI methods, the domain of influence-based techniques for data-centric explanations remains mostly underserved. To fill this void, we introduce Influenciae, an opensource library that implements the state-of-the-art methods for estimating the influence of training points on the model, with a focus on efficiency and scalability to fit the needs and the recent trends in the field. Finally, we have thoroughly documented and included plenty of tutorials to make the library reachable to the public, in the hopes that it will bring these methods back into the spotlight.

Introduction

In the rapidly evolving landscape of artificial intelligence, eXplainable AI (XAI) has emerged as a critical domain, bridging the gap between the opacity of complex models and the need for transparency and accountability. The importance of XAI cannot be overstated, particularly as AI systems become increasingly integrated into various facets of our daily lives, from healthcare to finance and beyond. To ensure the widespread adoption of AI in these critical domains, it is imperative to not only build highly accurate models but also to gauge their reliability and interpretability. In this pursuit, traditional XAI techniques offer a plethora of post-hoc methods for understanding predictions [START_REF] Kim | Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav)[END_REF][START_REF] Colin | What i cannot predict, i do not understand: A human-centered evaluation framework for explainability methods[END_REF][START_REF] Zhang | Invertible concept-based explanations for cnn models with non-negative concept activation vectors[END_REF][START_REF] Fel | Unlocking feature visualization for deeper networks with magnitude constrained optimization[END_REF][START_REF] Scott | A unified approach to interpreting model predictions[END_REF][START_REF] Zhou | Learning deep features for discriminative localization[END_REF][START_REF] Ramprasaath R Selvaraju | Grad-cam: Visual explanations from deep networks via gradient-based localization[END_REF][START_REF] Sundararajan | Axiomatic attribution for deep networks[END_REF][START_REF] Slack | Fooling lime and shap: Adversarial attacks on post hoc explanation methods[END_REF][START_REF] Tulio Ribeiro | why should i trust you?" explaining the predictions of any classifier[END_REF][START_REF] Simonyan | Deep inside convolutional networks: Visualising image classification models and saliency maps[END_REF][START_REF] Olah | Feature visualization[END_REF][START_REF] Ruth | Interpretable explanations of black boxes by meaningful perturbation[END_REF][START_REF] Novello | Making sense of dependence: Efficient blackbox explanations using dependence measure[END_REF][START_REF] Smilkov | Smoothgrad: removing noise by adding noise[END_REF][START_REF] Vitali Petsiuk | Rise: Randomized input sampling for explanation of black-box models[END_REF][START_REF] Tobias Springenberg | Striving for simplicity: The all convolutional net[END_REF]. What if we could directly trace model behavior back to the training data itself?

The first reference to using a notion of the influence of training data in the model's implemented function as a means to explain the behavior of deep neural networks dates back to [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF], where Koh & Liang proposed a technique to approximately compute influence functions without needing to re-train the model -one of the major setbacks of (approximate) leave-k-out techniques. This allowed them to attribute some of the model's predictions to the presence of certain "influential" data-points in the training dataset. However, as any approximation, it comes with some limitations [START_REF] Basu | On second-order group influence functions for black-box predictions[END_REF][START_REF] Bae | If influence functions are the answer, then what is the question? NeurIPS[END_REF][START_REF] Schioppa | Theoretical and practical perspectives on what influence functions do[END_REF], and other alternatives have since been released with the promise of improving on their results. Namely, in [START_REF] Yeh | Representer point selection for explaining deep neural networks[END_REF], the authors propose to use the representer point theorem for kernels to re-write the function implemented by the neural network as a kernel decomposed in a sum of the effects of each of the training data-points, and use the coefficient associated to each of them as a notion of their influence on the actual model. Nevertheless, this procedure requires the training of a surrogate model at the last layer, thus potentially limiting the faithfulness of the method. As a response to this, an improvement was devised in [START_REF] Sui | Representer point selection via local jacobian expansion for post-hoc classifier explanation of deep neural networks and ensemble models[END_REF], where this was no longer required. 1). We showcase how we can find the most influential points for a wrong prediction from the Imagenette subset of the ILSVRC [START_REF] Deng | Imagenet: A largescale hierarchical image database[END_REF] dataset, and thus, better understand why the model got it wrong. These examples can be separated in two classes: Proponents whose presence in the training set helps lower the loss on the sample under study; and Opponents that increase the model's loss -i.e. confuse the model. For a complicated test sample labeled as Chainsaw but predicted as Golf ball, we observe that the main opponents are images of chainsaws where the blade isn't quite visible, while the proponents contain mostly images of golf balls in different settings.

In yet another vein, [START_REF] Ilyas | Datamodels: Predicting predictions from training data[END_REF] introduced another approach to approximating leave-one-out (LOO) and used it as a way of extracting insights from the training dataset. In particular, they propose to train a linear model to predict a quantity related to an set of neural networks based on the presence of a point (or group of points) on the choice of the subsample of the training dataset.

Nonetheless, all the aforementioned methods suffer from a high computational and memory costs, and this can be exacerbated if their implementation is not correctly optimized. For instance, there are several ways of approximately computing the product of the inverse of a given matrix and a vector without needing to materialize the matrix in memory [START_REF] Martens | Deep learning via hessian-free optimization[END_REF][START_REF] Arnoldi | The principle of minimized iterations in the solution of the matrix eigenvalue problem[END_REF][START_REF] Schioppa | Scaling up influence functions[END_REF] that demand some knowledge on how auto-differentiation frameworks work to obtain the most optimized implementations. Additionally, dealing with very large datasets can be quite cumbersome, as the amount of elements that need to be stored in memory can be quite important, and thus why lazy and batched computations can help lessen memory requirements.

In summary, our contribution addresses the pressing need for readily available and open-source, reliable AI models and methods to measure their reliability. From the point of view of post-hoc, attribution, feature visualization and concept-based XAI, this has already been (at least, partially) addressed via some well-known libraries [START_REF] Fel | Xplique: A deep learning explainability toolbox[END_REF][START_REF] Kokhlikyan | Captum: A unified and generic model interpretability library for pytorch[END_REF][START_REF] Klaise | Alibi explain: Algorithms for explaining machine learning models[END_REF][START_REF] Scott | A unified approach to interpreting model predictions[END_REF], but, to the best of our knowledge, this has not been the case for influence-based techniques. Thus, we introduce Influenciae, an open-source Python package optimized for TensorFlow models that implements most of the prominent methods for computing data influence in the literature, complemented with documentation and a set of userfriendly tutorials that walk users through the process of getting started with our library. The essence of our library is schematized in Fig. 1. We hope that this library will make data-attribution methods more accessible to everyone in the community. For the red point on the left, due to its position (outlier), its influence will be much higher than that of a data-point that's close to other points, and thus, provide a model that's much more different than in the other case. This can be quantified by the Cook's distance -i.e. the influence values -and estimate the importance of each of these red data-points in the model.

Attributing model behavior through data influence

The idea behind influence is that provided with a data point, a model, and all the other data used in constructing the model, the Influence Function quantifies the extent to which the data contributed positively or negatively to the current state or behavior of the model. To illustrate this, let's consider the entirety of data points presented in Figure 2 and the resulting estimator, symbolized by the blue line -a common outcome for both scenarios. However, if one chooses to retain the distinctive red data point from the training dataset, the estimator takes on a new form-the red curve. This stark contrast becomes evident when observing the two graphs (right and left). Depending on the specific data point held out during the model's training phase, the resulting machine learning model can exhibit significantly divergent behavior compared to when trained on the complete dataset. The influence vector associated with the excluded data point provides valuable insights into the disparity between the perturbed model and the original one. Additionally, it offers guidance by indicating the "direction" in which the perturbed model moved with respect to the original model when the data-point was held out from the training dataset.

In this section, we aim to comprehensively cover all the methods that we implemented in the toolkit, introducing each one with technical details and highlighting their advantages and drawbacks. For any end-user familiar with the different techniques at stake, a summary is provided in Table 1.

Notation

Throughout the paper, each one of the methods will explain a machine learning model h : X → Y, with X and Y being respectively the input and output domain. In particular, this model is parameterized by the weights θ ∈ Θ ⊆ R d . If not specified otherwise, h is trained on a training dataset D train ⊂ (X × Y) of size n to minimize a loss function ℓ : (X , Y, Θ) → R. We denote a sample by the tuple z = (x, y)| x ∈ X , y ∈ Y. When an index subscript as i or j is added, e.g. z i , it is assumed that z i belongs to the training dataset. If the subscript "test" is added, z test , the sample does not belong to the training data. When there is no subscript, the sample can either belong to the training data or not. Finally, the empirical risk function is denoted as L(θ) := 1 n (x,y)∈Dtrain ℓ(x, y, θ) = 1 n zj ∈Dtrain ℓ(z j , θ), the parameters that minimized this empirical risk as θ * := arg min θ L(θ) and an estimator of θ * is denoted θ.

Influence Calculator

Paper

Method Name Object name in Influenciae [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF] First Order Influence Function (Eq. 2)

FirstOrderInfluenceCalculator [C, T] [4] RelatIF (Eq. 3) FirstOrderInfluenceCalculator [C, T] [19] First Order Group Influence FirstOrderInfluenceCalculator [C, T] [6] Second Order Group Influence SecondOrderInfluenceCalculator [C, T] [39]
RPS-L2 (Eq. 4)

RepresenterPointL2 [C, T] [37]
RPS-LJE (Eq. 5)

RepresenterPointLJE [C, T] [27]
TracIn (Eq. 6)

TracIn [C, T] [30], [2] Arnoldi Iteration Influence Functions ArnoldiInfluenceCalculator [C, T] Inverse Hessian Vector Product Paper Method Name Object name in Influenciae N/A Exact computation ExactIHVP [C] [1] LiSSA LissaIHVP [C] [23] Conjugate Gradient Descent ConjugateGradientIHVP [C]
Table 1: Summary of the methods available in the Influenciae library. The techniques for computing influence -i.e. InfluenceCalculators and inverse-hessian-vector products (IHVPs) that we have implemented in the library thus far. The C and T captions following the object name are clickable link to respectively the source code and the tutorial (if available). We showcase some examples in Fig. 3.

Influence functions

Influence functions originated from the field of robust statistics in the early 70s. In essence, they evaluate the change of a model's parameters as one up-weights a training sample by an infinitesimal amount ϵ [START_REF] Frank | The influence curve and its role in robust estimation[END_REF]: θϵ,zj := arg min θ L(θ) + ϵℓ(z j , θ). One way to estimate the change in a model's parameters of a single training sample would be to perform leave-one-out (LOO) retraining, that is, to train the model again with the sample of interest being held out of the training dataset. However, repeatedly re-training the model to retrieve the parameters' changes exactly can be computationally prohibitive, especially when the dataset size and/or the number of parameters grows. As removing a sample z j can be linearly approximated by up-weighting it by ϵ = -1 n , computing influence helps to estimate the change of a model's parameters if a specific training point was removed. Thus, by making the assumption that the empirical risk L is twice-differentiable and strictly convex with respect to the model's parameters θ -making the Hessian [START_REF] Cook | Residuals and influence in regression[END_REF] proposed to compute the influence of z j on the parameters θ as:

H θ := 1 n zi∈Dtrain ∇ 2 θ ℓ(z i , θ) positive definite -, Cook & Weisberg
I(z j ) := -H -1 θ ∇ θ ℓ(z j , θ) (1)
Later, Koh and Liang [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF] popularized influence functions in the machine learning community as they took advantage of auto-differentiation frameworks to efficiently compute the hessian for Deep Neural Networks (DNNs) and derived Eq. 1 to formulate the influence of up-weighting a training sample z j on the loss at a test point z test :

IF(z j , z test ) := -∇ θ ℓ(z test , θ) T H -1 θ ∇ θ ℓ(z j , θ) (2)
[18] in Influenciae

This approach is the one implemented in the Influenciae library as the FirstOrderInfluence-Calculator object. One can discover more in the Source Code and the dedicated Tutorial.

This formulation opens its way into example-based XAI as it compares to the study of finding the nearest neighbors of z test in the training dataset -i.e. the most similar examples -albeit with two major differences: i) points with high training loss are given more influence revealing that outliers can dominate the model's parameters [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF], and ii) H -1 θ measures what Koh & Liang called: the resistance of the other training points to the removal of z j [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF].

Inverse hessian vector product

It should be noted that hessian computation remains a significant challenge. Although one could perform the exact computation of the hessian and then invert it, it can computationally prohibitive as it requires second order derivatives to be calculated for all the target weights, and the inversion is typically O(n 3 ). Thus, the library includes several methods to estimate the inverse-hessian-vector product (IHVP) in Eq. 2. As suggested in [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF], the stochastic estimation via [START_REF] Agarwal | Second-order stochastic optimization for machine learning in linear time[END_REF] (LiSSA: Linear time Stochastic Second-order Algorithm) or through conjugate gradient descent [START_REF] Martens | Deep learning via hessian-free optimization[END_REF] are implemented. Furthermore, it also includes the Arnoldi algorithm [START_REF] Arnoldi | The principle of minimized iterations in the solution of the matrix eigenvalue problem[END_REF] as it is performed by Schioppa et al. in [START_REF] Schioppa | Scaling up influence functions[END_REF] (in which they also compare the three approaches).

IHVP in Influenciae

The library includes all the aforementioned IHVP: ExactIHVP, ConjugateGradientDescentIHVP [START_REF] Martens | Deep learning via hessian-free optimization[END_REF] and LissaIHVP [START_REF] Agarwal | Second-order stochastic optimization for machine learning in linear time[END_REF].

Those three objects can be used as a parameter for InfluenceCalculator needing to perform IHVP. The Arnoldi algorithm [START_REF] Arnoldi | The principle of minimized iterations in the solution of the matrix eigenvalue problem[END_REF] is also implemented but it is directly embedded in its own InfluenceCalculator: ArnoldiInfluenceCalculator [START_REF] Schioppa | Scaling up influence functions[END_REF]. One can discover more concerning the IHVP operators in the Source Code.

RelatIF

As highlighted by Barshan et al. [START_REF] Barshan | Relatif: Identifying explanatory training samples via relative influence[END_REF], the influential instances yielded by Eq. 2 tend to overlap for vastly different test samples due to the overpowering effect of the influence of the most influential training samples over the test samples. To overcome this issue, they suggest putting constraints on the re-weighting of influential instances by normalizing the formulation in 2:

RelatIF(z, z test ) := I up,loss (z, z test )

||H -1 θ ∇ θ ℓ(z, θ)|| (3)
[4] in Influenciae By setting the parameter normalize of the FirstOrderInfluenceCalculator to true at initialization, one is actually using RelatIF. One can discover more in the Source Code and the dedicated Tutorial.

Group influence

Oftentimes, we are not only interested in the influence of individual instances but rather in the influence of a group of training samples (e.g. mini-batch effect, multi-source data, etc., as per [START_REF] Wei | On the accuracy of influence functions for measuring group effects[END_REF].). Koh et al. [START_REF] Wei | On the accuracy of influence functions for measuring group effects[END_REF] propose to utilize the sum of individual influences, and demonstrate that this constitutes a reliable proxy for ranking groups based on their influence.

[

19] in Influenciae

As this approach is derived from [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF], you can compute the influence of a group of data points using the same FirstOrderInfluenceCalculator object but using a method dedicated to group influence. One can discover more in the Source Code and the dedicated Tutorial.

However, this approximation leads to large absolute and relative errors. In addition, Basu et al. [START_REF] Basu | On second-order group influence functions for black-box predictions[END_REF] point out that such approximations ignore possible cross-correlations between samples in the group. Thus, they suggest studying second-order approximations instead "to capture model changes when a potentially large group of training samples is up-weighted".

[6] in Influenciae

This work is encapsulated in the SecondOrderInfluenceCalculator object of the library. One can discover more in the Source Code and the dedicated Tutorial.

However, it should be highlighted that their formulation can be computationally demanding, and they specify that it holds for linear prediction models where the underlying optimization is convex, but could eventually break in the case of DNNs. In a later work, Basu et al. [START_REF] Basu | Influence functions in deep learning are fragile[END_REF] further investigated the most appropriate settings for reliably computing such influence scores from a theoretical standpoint.

Kernel-based influence

Besides influence functions, other paradigms exist for finding the training examples that are the most responsible for a given set of predictions. For instance, Yeh et al. [START_REF] Yeh | Representer point selection for explaining deep neural networks[END_REF] suggest an approach that leverages kernels and the representer point theorem [START_REF] Schölkopf | A generalized representer theorem[END_REF] "which loosely states that under certain conditions, the minimizer of a loss functional over a reproducing kernel Hilbert space (RKHS) can be expressed as a linear combination of kernel evaluations at training points". Therefore, they decide to focus on explaining only the pre-activation prediction layer of a neural network Φ(x i , θ) := θ 1 f i with θ 1 the parameters of the last classification layer and f i the last intermediate layer feature for input x i . Considering these last notations, they posit that if θ constitutes a stationary point of the optimization problem: arg min θ {L(θ) + λ||θ 1 || 2 } for some λ > 0, then it is possible to compute the representer value for z test given z as follows:

RPSL2(z, z test ) := 1 -2λn ∂ℓ(z, θ) ∂Φ(x, θ) * f T z f ztest = α(z) * κ(z, z test ) , (4) where α(z) = 1 -2λn ∂ℓ(z,θ)
∂Φ(x,θ) and κ(z, z test ) = f T z f ztest . This representer value is the quantity that will define as the influence of an instance, with its sign providing additional insights: positive representer values are excitatory while negative ones are inhibitory to the prediction at the given test point. Note that α(z) could be used as an importance measure of the training sample z on θ 1 . [START_REF] Yeh | Representer point selection for explaining deep neural networks[END_REF] in Influenciae This approach can be reproduced with Influenciae by using the RepresenterPointL2 object. One can discover more in the Source Code and the dedicated Tutorial.

On one hand, this formulation has the significant advantage of being less memory intensive to compute as it does not require the computation of hessian matrices. On the other hand, it suffers on crucial drawback: it works only for models that perform a linear matrix multiplication before the final activation and one needs to introduce a heavy L2 regularization on the last layer of the model during the optimization phase, thus one cannot explain the behavior of pre-trained models. One workaround for the latter can be to retrain a regularized model while imposing some closeness between the retrained model's outputs and the original one's. However, Sui et al. [START_REF] Sui | Representer point selection via local jacobian expansion for post-hoc classifier explanation of deep neural networks and ensemble models[END_REF] state that, despite the similarity between these two models' outputs, disagreements between the two can still exist. Moreover, they point out that the previous approach tends to yield a static ranking of training samples for test points in the same class providing more of a class-level explanation rather than an instance-level explanation. In order to overcome those issues they suggest a derivation for Representer Point Selection (RPS) based on a Local Jacobian Taylor expansion (LJE). In practice, they suppose that they have a model θ such that:

n i=1 ∂ℓ(zi, θ) ∂θ1 | θ1= θ1 ≃ 0.
By taking a one-step gradient ascent from the trained model they obtain θ * 1 , which is supposed to be close to the original model's parameters θ1 , but with a small shift in the loss's landscape. With the help of a first-order Taylor expansion they propose to rewrite Eq. 4 as: While they need the same assumptions as [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF] i.e. that ℓ be twice differentiable and strictly convexthey only require them with respect to the last linear layer's parameters θ 1 . In addition, their approach only requires one step of gradient ascent, compared to a possible retraining with RPS-L2, but they need stronger assumptions mainly because of the hessian.

RPSLJE(z, z test ) := θ * 1 1 f z n - 1 n H -1 θ * 1 ∂ℓ(z, θ * ) ∂Φ(x, θ * ) * κ(z, z test ) (5)

Tracing influence throughout the training process

Another popular approach for identifying influential instances involves leveraging training dynamics -which in practice is done by replaying the training process with model checkpoints in a post-hoc fashion. Mainly, such approaches rely neither on being near optimality nor being strongly convex, which is more realistic considering the reality of DNNs.

Pruthi et al. [START_REF] Pruthi | Estimating training data influence by tracing gradient descent[END_REF] propose to save only model checkpoints θ ti , and with that information, they decompose the difference between the loss of the data-point under study at the end of training compared to at the beginning of training along the path taken by the training process. Supposing that one has k checkpoints θ [t1] , ..., θ [t k ] corresponding to iterations t 1 , ..., t k and that the step size η i is kept constant between checkpoints i -1 and i we can use the following as an influence measure:

T racInCP (z, z test ) = k i=1 η i ∇ θ l(z, θ [ti] ).∇ θ l(z test , θ [ti] ) (6)
[27] in Influenciae Influenciae provides a simple TracIn object to allow one to replicate this method. One can discover more in the Source Code and the dedicated Tutorial.

It should be noted that this formulation is also derived for the SGD optimization process in minibatches, but it can be adjusted to work for other optimization techniques and training processes. The main advantage of this technique relies on its simplicity (compared to [START_REF] Hara | Data cleansing for models trained with sgd[END_REF]) while being empirically demonstrated as efficient as RPSL2 (Eq. 4) [START_REF] Yeh | Representer point selection for explaining deep neural networks[END_REF] or IF (Eq. 2) [START_REF] Wei | Understanding black-box predictions via influence functions[END_REF]. Nonetheless, this kind of approach requires handling the training procedure to save the different checkpoints, potentially numerous, which in practice is not always feasible.

API

With the ever growing size of datasets and models, the most memory-efficient way of computing influence-related quantities is possibly to take advantage of lazy and batched computations as implemented in the tensorflow.data.Dataset module. This is why we have built Influenciaein such a way as to operate entirely via Tensorflow Datasets. Starting from the observation that the influence score/vector of a sample has meaning only by comparing it with other samples of a dataset, all core functions of the Influenciaelibrary take as an argument a dataset and return a dataset that the user can iterate over to extract the influence score or the influence vector. All methods implemented in the library inherit from the BaseInfluenceCalculator class which contains all the core functionality. Oftentimes, the samples associated with the highest or smallest values of influence score can reveal outliers of the distribution or mislabeled samples, thus abnormal model behaviour. In addition, one could be interested in retrieving the training samples most responsible for the prediction of a given test sample. For all these cases, the API provides a top_k function to retrieve the most "relevant" samples.

# For a given dataset to explain , this function will return a dataset # containing the top_k closest samples of the training set # of each sample to explain explanation_ds = influence_calculator . top_k ( samples_to_explain , train_ds . batch [START_REF] Ramprasaath R Selvaraju | Grad-cam: Visual explanations from deep networks via gradient-based localization[END_REF] , k =5 , order = ORDER . DESCENDING )

Finally, the API provides save and load arguments to avoid recomputing each time the influence's values.

# The argument save_top_k_ds_path allows to save the result of top_k explanation_ds = influence_calculator . top_k ( samples_to_explain , train_ds . batch [START_REF] Ramprasaath R Selvaraju | Grad-cam: Visual explanations from deep networks via gradient-based localization[END_REF] , k =5 , order = ORDER . DESCENDING , save_top_k_ds_path = " ./ my_path / " )

Conclusion

The year 2017 brought along a wave of interest in influence functions and data-centric approaches for understanding model behavior. This interest peaked a little later, but, due to their computational cost, these techniques have never really gotten the opportunity to catch up to other types of in terms of popularity and use by the general public. We believe that by providing an efficient implementation in a popular auto-differentiation framework, we can facilitate their usage, and thus, hopefully reignite the initial flame of data-centric explanations.

Figure 1 :

 1 Figure 1: Influenciae. Our library implements a plethora of influence-based methods for attributing model behavior to training data (see Table1). We showcase how we can find the most influential points for a wrong prediction from the Imagenette subset of the ILSVRC[START_REF] Deng | Imagenet: A largescale hierarchical image database[END_REF] dataset, and thus, better understand why the model got it wrong. These examples can be separated in two classes: Proponents whose presence in the training set helps lower the loss on the sample under study; and Opponents that increase the model's loss -i.e. confuse the model. For a complicated test sample labeled as Chainsaw but predicted as Golf ball, we observe that the main opponents are images of chainsaws where the blade isn't quite visible, while the proponents contain mostly images of golf balls in different settings.

Figure 2 :

 2 Figure 2: Illustrating Influence functions. For a linear regression problem defined by the dataset constituted by the blue data-points and an eventual held-out red data-point, we can compute the influence function for two different cases of held-out points, yielding two different perturbed models.For the red point on the left, due to its position (outlier), its influence will be much higher than that of a data-point that's close to other points, and thus, provide a model that's much more different than in the other case. This can be quantified by the Cook's distance -i.e. the influence values -and estimate the importance of each of these red data-points in the model.

Figure 3 :

 3 Figure 3: An example of all the methods available in Influenciae in application. For each test sample, we applied 2 different techniques and plotted the 3 most influential Proponent samples -whose presence in the training set helps lower the loss on the sample under study; and the 3 most influential Opponent samples -whose presence confuses the model.

  from deel . influenciae . common import InfluenceModel , ExactIHVP from deel . influenciae . influence import F i r s t O r d e r I n f l u e n c e C a l c u l a t o r # Extract the end of the model defined by the target layer influence_model = InfluenceModel ( model , target_layer , loss_function ) # Create the influence calculator from the model with the exact ihvp ihvp_calculator = ExactIHVP ( influence_model , train_dataset ) i n f luence_calculator = F i r s t O r d e r I n f l u e n c e C a l c u l a t o r ( influence_model , train_dataset , ihvp_calculator ) # Return a dataset containing the self influence score for each point # of the training dataset d a t a _ a n d _ i n f l u e n c e _ d a t a s e t = influence_calculator . c om p u t e_ i n fl u e nc e _ va l u es ( train_dataset )

https://www.deel.ai/

Acknowledgements

This work has benefited from the AI Interdisciplinary Institute ANITI, which is funded by the French "Investing for the Future -PIA3" program under the Grant agreement ANR-19-P3IA-0004. The authors gratefully acknowledge the support of the DEEL 1 project.