SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Extension to Different Biases. To fulfill different fairness demands, we further discuss the generalization of the bias function  $B(\hat{\theta})$  in Eq. 6 to other bias measurements. We provide the extension to the most frequently used group fairness measurement demographic parity [34] which requires equal positive prediction assignment across subgroups (e.g. male and female). Eq. 6 can be rewritten as:
$$
I _ {u p, b i a s} (z _ {k}) = - \left(\nabla_ {\hat {\theta}} \frac {1}{\left| \mathcal {G} _ {A = 1} \right|} \sum_ {c _ {i} \in \mathcal {G} _ {A = 1}} f _ {\hat {\theta}} (c _ {i}) - \nabla_ {\hat {\theta}} \frac {1}{\left| \mathcal {G} _ {A = 0} \right|} \sum_ {c _ {j} \in \mathcal {G} _ {A = 0}} f _ {\hat {\theta}} (c _ {j})) H _ {\hat {\theta}} ^ {- 1} \nabla_ {\hat {\theta}} L (z _ {k}, \hat {\theta}), \right. \tag {10}
$$
where  $\mathcal{G}_{A = 1}$  and  $\mathcal{G}_{A = 0}$  represents the subgroup with protected attribute  $A = 1$  and 0. The extension to equal opportunity [35], which requires the positive predictions to be equally assigned across positive classes, can be rewritten as:
$$
I _ {u p, b i a s} (z _ {k}) = - \left(\nabla_ {\hat {\theta}} \frac {1}{\left| \mathcal {G} _ {1 , 1} \right|} \sum_ {c _ {i} \in \mathcal {G} _ {1, 1}} f _ {\hat {\theta}} (c _ {i}) - \nabla_ {\hat {\theta}} \frac {1}{\left| \mathcal {G} _ {0 , 1} \right|} \sum_ {c _ {j} \in \mathcal {G} _ {0, 1}} f _ {\hat {\theta}} (c _ {j})\right) H _ {\hat {\theta}} ^ {- 1} \nabla_ {\hat {\theta}} L (z _ {k}, \hat {\theta}), \tag {11}
$$
where  $\mathcal{G}_{1,1}$  represents the sub-group where  $A = 1$  and  $Y = 1$ .
Extension to Deep Models. In the previous sections, it's assumed that  $\hat{\theta}$  could be the global minimum. However, if  $\hat{\theta}$  is obtained in deep networks trained with SGD in a non-convex setting, it might be a local optimum and the exact influence can hardly be computed. We follow the strategy in [32] to approximate the influence in deep networks, and empirically demonstrate the effectiveness of FMD in deep models. Moreover, for deep networks where a linear classifier is stacked on a backbone feature extractor, we apply our unlearning mechanism to the linear classifier or several top MLP layers.
Efficient Influence Computation. A critical challenge to compute the influence in Eq. 6 is to explicitly calculate the inverse Hessian. Here we employ the implicit Hessian-vector products (HVPs) [32, 67] to efficiently approximate  $\nabla_{\hat{\theta}}L(z_k,\hat{\theta})$ . Meanwhile,  $\nabla_{\hat{\theta}}L(z_k,\hat{\theta})$  in Eq. 6 can be pre-calculated and applied to different  $\nabla_{\hat{\theta}}B(\hat{\theta})$ . To avoid the  $O(d^{3})$  computational cost to calculate the inverse Hessian in every step, we pre-calculate it before the removal and keep it constant during unlearning phase [63]. The alternative strategy which continuously updates the inversion Hessian is also analyzed in the Appendix.
Algorithm 1: The FMD framework.
Input: dataset  $D_{ex}$ , loss  $\mathcal{L}$ , attribute of interest  $\mathcal{A}$ , Hessian matrix  $H$ , bias threshold  $\delta$ , parameter  $\theta$ ,  $n = \| D_{ex}\|$ .
$B\gets B(D_{ex},\mathcal{A},\theta)$
$H^{-1}\gets \operatorname {Inverse}(H)$
if  $B > \delta$  then
for  $i = 1,2,3,\dots,n$  do  $\begin{array}{r}\bigtriangleup \leftarrow \nabla_{\hat{\theta}}L(c_i,\hat{\theta}) - \nabla_{\hat{\theta}}L(\bar{c}_i,\hat{\theta})\\ \theta \leftarrow \theta +H^{-1}\bigtriangleup \end{array}$  end
Output:  $\theta$
4.1 Experiment details
Dataset. Our experiments are conducted on three datasets. Colored MNIST is constructed by adding color bias to the MNIST dataset [68]. Bias-aligned samples are constructed by adding a particular color to a particular digit like {Digit1_Color1} while other colors are for bias-conflicting samples. Following [3, 69, 70], we build 3 different training sets by setting different biased ratios {0.995, 0.99, 0.95} for biased-aligned training samples, where a high ratio indicates a high degree of bias. CelebA [71] is a face recognition dataset with 40 types of attributes like gender, age (young or not), and lots of facial characteristics (such as hair color, smile, beard). We choose Gender as the bias attribute, and Blonde hair and Attractive as the outputs following [7, 8]. Adult Income Dataset is a publicly available dataset in the UCI repository [72] based on the 1994 U.S. census data. The dataset records an individual's income (more or less than $50,000 per year) along with features such as occupation, marital status, and education. In our experiment, we choose gender and race as biased attributes following [73, 74]. We follow the pre-processing procedures in [75]. As for the experiment on the language model, we use StereoSet [76] as our test set. StereoSet is a large-scale natural dataset to measure stereotypical biases in gender, profession, race, and religion.
Baselines. For the sanity check experiment on a toy Colored MNIST dataset, we use a vanilla logistic regression model as the baseline. For experiments with deep networks, we compare our method with one pre-processing baseline Reweigh [77], 6 in-processing debiasing baselines (LDR [25], LfF [78], Rebias [79], DRO [7], SenSEI [80], and SenSR [81]) and 4 post-processing baselines (EqOdd [35], CEqOdd [35], Reject [82] and PP-IF [83]). We compare our method on language model with five debiasing baselines: Counterfactual Data Augmentation (CDA) [84], Dropout [85], Iterative Null-space Projection (INLP) [86], Self-debias [87], and SentenceDebias [88]. Details can be referred to Appendix C.
Construction of Counterfactual Dataset  $D_{ex}$ . We separately construct counterfactual sets for the three datasets, while bias-aligned samples in the small dataset  $D_{ex}$  are all split from the test set. In the Colored MNIST dataset, we randomly add another color on the same digit image as the counterfactual sample. As for the Adult dataset, we flip the protected attribute to the opposite while keeping other attributes and target labels exactly the same. For the CelebA dataset, we select images with the same target labels but the opposite protected attribute. To fulfill the request for counterfactual, we rank the similarity between images by comparing the overlap of other attributes and choose the most similar pair to form the factual and counterfactual samples. Part of the generated sample pairs is visualized in Fig. 2. Note that for the CelebA dataset, the counterfactual data are not that strict as the gender attribute is not independent of other features in the natural human facial images. We use Crows-Pairs [89] as our external dataset for the language model. Each sample in Crows-Pairs consists of two sentences: one that is more stereotyping and another that is less stereotyping, which can be utilized as counterfactual pairs.
Figure 2: Visualization of factual and counterfactual pairs for three datasets.
Implementation details. We use multi-layer perceptron (MLP) with three hidden layers for Colored MNIST and Adult, and ResNet-18 [90] for CelebA following the setting in [8]. During training, we set the batch size of 256 for Colored MNIST and Adult, respectively, and 64 for CelebA following [25, 78, 7]. We use pre-trained BERT [91] and GPT-2 [92], provided by Huggingface. During unlearning, we freeze the parameters of all other layers except the last classifier layer. The running time of all baselines is evaluated on a single RTX3090 GPU for a fair comparison. In our experiment, we select the number of samples  $k = 5000$  for Colored MNIST, and  $k = 200$  for both Adult and CelebA. The bias threshold is set to 0.
4.2 Sanity Check on Logistic Regression with a Toy Dataset
We conduct an experiment on a logistic regression task to illustrate our method. We simplify the Colored MNIST classification task to a binary classification problem of distinguishing between only digits 3 and 8, on a training set with a bias ratio of 0.95. and a balanced test set. We trained a regularized logistic regressor:  $\mathrm{argmin}_{w\in R^d}\sum_{i = 1}^{n}l(w^T x_i,y_i) + \lambda \| w\| _2^2$  . Fig. 5(a) illustrates the classification results of the vanilla regressor on part of test samples. We denote Digit by shape (triangle and rectangle) and Color by color (red and blue). The solid line represents the learned classification boundary and the dotted line represents the expected classification boundary. The test accuracy is 0.6517 and it can be observed that most bias-conflict samples tend to be misclassified according to their colors. Moreover, we select and visualize the most helpful and harmful samples in Fig. 5(c) based on Eq. 6. We found that the most helpful samples are in the  $5 \%$  bias-conflict samples while harmful samples are bias-aligned samples. The unlearning curve is provided in Fig. 5(b). With only 50 samples, the accuracy is improved amazingly by  $25.71\%$  and the counterfactual bias decreases by 0.2755, demonstrating the effectiveness of our method.
Figure 3: (a) Illustration of the learned pattern on our toy dataset. (b) Accuracy and bias curves during unlearning. (b) Visualization of helpful samples (top row) and harmful samples (bottom row).
4.3 Experiment on Deep Models
Results on Colored MNIST. Tab. 1 shows the comparisons on the Colored MNIST dataset. We reported test accuracy, counterfactual bias, debiasing time, and the number of samples used for all methods. Our approach demonstrates competing performance on accuracy and superior performance on bias compared with retraining baselines. Meanwhile, we only make use of one-tenth of unlearning samples and reduce the debiasing time by 1-2 magnitudes.
Bias Ratio	Method	Acc.(%)↑	Bias ↓	Time(s)	#Samp.
0.995	Vanilla	38.59	0.5863	-	-
LDR	66.76	0.4144	1,261	50 k
LIF	56.45	0.3675	661	50 k
Rebias	71.24	0.3428	1,799	50 k
Ours	71.70	0.3027	59	5 k
0.99	Vanilla	51.34	0.4931	-	-
LDR	76.48	0.2511	1,330	50 k
LIF	64.71	0.2366	726	50 k
Rebias	80.41	0.2302	1,658	50 k
Ours	80.04	0.2042	48	5 k
0.95	Vanilla	77.63	0.2589	-	-
LDR	90.42	0.2334	1,180	50 k
LIF	85.55	0.1264	724	50 k
Rebias	89.63	0.1205	1,714	50 k
Ours	89.26	0.1189	56	5 k
Table 1: Results on Colored MNIST. (bold: best performance, underline: second best performance.)
Attr.	Method	Acc.(%) ↑	Bias ↓	Time(s)	# Samp.
Gender	Vanilla	85.40	0.0195	-	-
LDR	77.69	0.0055	927	26,904
LFF	73.08	0.0036	525	26,904
Rebias	76.57	0.0041	1292	26,904
Reweigh	82.60	0.0051	36	26,904
SenSR	84.09	0.0049	571	26,904
SenSeI	83.91	0.0016	692	26,904
PP-IF	81.96	0.0027	13	26,904
Ours	81.89	0.0005	2.49	500
Race	Vanilla	84.57	0.0089	-	-
LDR	78.32	0.0046	961	26,904
LFF	75.16	0.0024	501	26,904
Rebias	77.89	0.0038	1304	26,904
Reweigh	82.97	0.0015	36	26,904
SenSR	84.09	0.0036	571	26,904
SenSeI	83.91	0.0015	692	26,904
PP-IF	82.37	0.0015	13	26,904
Ours	83.80	0.0013	2.54	500
Table 2: Results on Adult.
Results on Adult. The results are in Table 2. It can be observed that the vanilla method performed the best in accuracy on both tasks, since in the real-world dataset, race and gender are biased w.r.t income in both training and test set and the well-trained model fits this correlation. However, to achieve fair prediction, we would not expect biased attributes to dominate predictions. Compared with other debiasing methods, our method achieved the best results in both accuracy and bias, with much less debiasing time on a smaller dataset.
Results on CelebA. We compare on average accuracy (Avg.), Unbiased accuracy [8] (Unb.) tested on the balanced test set, and Worst-group accuracy [7] (Wor.) tested on the unprivileged group to illustrate the performance, as reported in Tab. 3. It can be observed that the vanilla model performs well on the whole dataset (Avg.) but scores a really low accuracy (Wor.) on the worst group, which means the learned model heavily relies on the bias attribute to achieve high accuracy. Our method obviously bridges this gap and outperforms all other debiasing baselines on Wor. and Unb. in the two experiments. The experiments also demonstrate that our method is consistently feasible even in the absence of perfect standardized counterfactual samples in real-world datasets, by selecting a certain amount of approximate counterfactual data.
Results on Large Language Models (LLM). We further extended our method to the LLM debiasing scenario. Results are presented in Tab. 4. We report two metrics: Language Modeling Score (LMS) measures the percentage of instances in which a language model prefers the meaningful over meaningless association. The LMS of an ideal language model is 100 (the higher the better). Stereotype Score
Attr.	Method	Unb.(%)↑	Wor.(%)↑	Avg.(%)↑	Bias ↓	Time(s)
Blonde	Vanilla	66.27	47.36	94.90	0.4211	-
LfF	84.33	81.24	93.52	0.2557	67,620
LDR	85.01	82.32	86.67	0.3126	24,180
DRO	85.66	84.36	92.90	0.3206	28,860
Ours	89.73	87.15	93.41	0.0717	191
Attractive	Vanilla	63.17	40.59	77.42	0.3695	-
LfF	67.44	52.25	77.24	0.2815	67,560
LDR	68.14	54.47	81.70	0.2986	24,420
DRO	66.14	62.33	78.35	0.3004	30,540
Ours	72.18	68.16	80.99	0.1273	187
(SS) measures the percentage of examples in which a model prefers a stereotypical association over an anti-stereotypical association. The SS of an ideal language model is 50 (the closer to 50 the better). It shows that our method can outperform or achieve comparable performance with baseline methods. As for BERT, our method reaches the best (denoted by **bold**) or second best (denoted by **underline**) performance in 5 of 6 metrics. Description of baselines can be referred to Appendix C.2.
Table 3: Results on CelebA.
Backbone	Attribute	Method	SS	LMS	Attribute	Method	SS	LMS	Attribute	Method	SS	LMS
BERT	gender	Vanilla	60.28	84.17	race	Vanilla	57.03	84.17	religion	Vanilla	59.7	84.17
CDA	59.61	83.08	CDA	56.73	83.41	CDA	58.37	83.24
Dropout	60.66	83.04	Dropout	57.07	83.04	Dropout	59.13	83.04
INLP	57.25	80.63	INLP	57.29	83.12	INLP	60.31	83.36
Self-debias	59.34	84.09	Self-debias	54.30	84.24	Self-debias	57.26	84.23
SentDebias	59.37	84.20	SentDebias	57.78	83.95	SentDebias	58.73	84.26
Ours	57.77	85.45	Ours	57.24	84.19	Ours	57.85	84.90
GPT-2	gender	Vanilla	62.65	91.01	race	Vanilla	58.9	91.01	religion	Vanilla	63.26	91.01
CDA	64.02	90.36	CDA	57.31	90.36	CDA	63.55	90.36
Dropout	63.35	90.40	Dropout	57.50	90.40	Dropout	64.17	90.40
INLP	60.17	91.62	INLP	58.96	91.06	INLP	63.95	91.17
Self-debias	60.84	89.07	Self-debias	57.33	89.53	Self-debias	60.45	89.36
SentDebias	56.05	87.43	SentDebias	56.43	91.38	SentDebias	59.62	90.53
Ours	60.42	91.01	Ours	60.42	91.01	Ours	58.43	86.13
Effectiveness on Different Bias Metrics. We validate the generalization ability of our unlearning method based on different fairness metrics on the Colored MNIST with bias severity 0.99. In Tab. 5, we compare the performance of unlearning harmful samples based on three different biases: Counterfactual bias (Co.), Demographic parity bias (De.) [34], and Equal opportunity bias (Eo.) [35]. For each experiment, we report the changes in three biases. We can note that our method is consistently effective on all three bias metrics. Meanwhile, our counterfactual-based unlearning can significantly outperform the other two in terms of accuracy, Co., and De., and is comparable with them on Eo..
Table 4: Results with Large Language Models (BERT and GPT-2).
Acc.(%) ↑	Co. ↓	De. ↓	Eo. ↓
Vanilla	65.17	0.3735	0.5895	0.2235
Unlearn by De.	71.52	0.1796	0.4026	0.0116
Unlearn by Eo.	71.12	0.1826	0.4217	0.0103
Unlearn by Co. (Ours)	87.90	0.1051	0.1498	0.0108
Table 5: Ablation on Different Biases.
Acc. ↑	Bias ↓	Time(s)↓
Vanilla	65.17	0.3735	-
Unlearn by Eq. 7	90.68	0.1182	36.87
Unlearn by Eq. 8	91.18	0.1023	39.63
Unlearn by Eq. 9 (Ours)	90.42	0.1051	0.059
Table 6: Ablation on Unlearning Strategies.
Effectiveness of Unlearn Strategies. We empirically investigate the feasibility of the unlearning mechanism on training and external samples on the Colored MNIST with bias severity 0.99. In Tab. 6, we report the results of unlearning harmful training samples (Eq. 7), unlearning by replacing harmful
samples with their bias-conflict helpful samples (Eq. 21) and unlearning with external counterfactual sample pairs (Eq. 23). It can be observed that unlearning in the training dataset can achieve higher accuracy and less bias, and Eq. 21 excels on both metrics. But unlearning with training samples requires much more time and training samples might not be available in practice, while unlearning with external samples provides a satisfactory alternative.
Attr.	Method	Acc.(%)↑	Co. ↓	De. ↓	Eq. ↓	Time(s)
Gender	EqOdd	82.71	0.0247	0.5991	0.0021	0.0113
CEqOdd	83.22	0.0047	0.4469	0.0125	0.5583
Reject	74.63	0.0876	0.2744	0.3140	14.420
Ours	83.49	0.0019	0.1438	0.0460	0.0389
Race	EqOdd	83.22	0.0139	0.7288	0.0021	0.0105
CEqOdd	82.88	0.0012	0.6803	0.0054	3.6850
Reject	74.63	0.1156	0.4349	0.1825	14.290
Ours	83.12	0.0006	0.4219	0.0367	0.0360
Method	# Lay.	# Para.	Acc(%) ↑	Bias ↓	Time(s)
Vanilla	-	-	51.34	0.4931	-
Ours1	1	1 K	71.19	0.2757	3.75
Ours2	2	11 K	74.18	0.3134	432.86
Ours3	3	21 K	61.45	0.2949	496.44
Table 8: Ablation on # MLP Layers.
Table 7: Discussion on Post-processing Methods.
Discussion on Post-processing Methods. We compare our method to post-processing methods, i.e., Equalized Odds Post-processing (EqOdd) [35], Calibrated Equalized Odds Post-processing (CEqOdd) [35] and Reject Option Classification (Reject) [82], as shown in Tab. 7. Note these methods only apply to logistic regression. Our method outperforms them in most cases on Adult. It is also worth noting that these post-processing methods aimed at a specific fairness measure tend to exacerbate unfairness under other measures while our method consistently improves the fairness under different measures.
Ablation on the Number of Samples. Fig. 4 demonstrates the sensitivity of our unlearning performance w.r.t. number of samples on Colored MNIST with a bias ratio of 0.99. The accuracy increases and bias decreases incrementally with more samples, and becomes steady after the number is beyond 5,000. On the other hand, the unlearning time increases linearly with the number of samples. Additionally, constructing a large number of counterfactual samples in practice might be time-consuming as well. Practical usage of the FMD would require a trade-off based on utility requirements.
Figure 4: Ablation on # Samples.
Ablation on Number of Fine-tuning Layers. We explore the impact of unlearning different numbers of layers (i.e., the last (one), two, three MLP) on the Color MNIST, with results in Tab. 11. Interestingly, the accuracy excels with two layers but decreases with three layers. Additionally, fine-tuning multiple layers takes much longer time on computation on much more parameters. It is also worth noting that our method could achieve such superior or competing performance even only by updating the last layer in deep models, which calls for more in-depth analysis in the future.
Biased behaviors in contemporary well-trained deep neural networks can perpetuate social biases, and also pose challenges to the models' robustness. In response, we present FDM, an all-inclusive framework for fast and effective model debiasing. We explicitly measure the influence of training samples on bias measurement and propose a removal mechanism for model debiasing. Comprehensive experiments on multiple datasets demonstrate that our method can achieve superior/competing accuracies with a significantly lower bias as well as computational cost.
Our work preliminarily explored the application of our method to large language models, as well as more analysis on model fairness from different perspectives, which will be in our future plan. In addition, our method is not applicable to black-box models, which are of high interest in real-world scenarios. Our proposed method requires generating counterfactual pairs with labeled sensitive attributes, while many datasets do not have enough labels. Research on fairness with few/no attribute labels is still in the infant stage [93], and we will further explore it.
This work is supported by the National Natural Science Foundation of China (Grant No. 62106222), the Natural Science Foundation of Zhejiang Province, China(Grant No. LZ23F020008) and the Zhejiang University-Angelalign Inc. R&D Center for Intelligent Healthcare.
A Influence Function on Bias and Extension to DNN.
A.1 Deriving the Influence Function on Bias.
In this part, we provide detailed derivation of the influence function on bias in Eq. 5 in the main work. We first start from the influence function on parameters, we can also be referred to [32, 64].
Assuming there are  $n$  training samples  $z_{1},z_{2}\dots,z_{n}$ , where  $z_{i} = (x_{i},y_{i})$ , and let  $L(z,\theta)$  represent the loss function of sample  $z$  under the model parameters  $\theta$ , then the trained  $\hat{\theta}$  is given by:
$$
\hat {\theta} = \operatorname {a r g m i n} _ {\theta} R (\theta) = \operatorname {a r g m i n} _ {\theta} \frac {1}{n} \sum_ {i = 1} ^ {n} L \left(z _ {i}, \theta\right). \tag {12}
$$
Study the impact of changing the weight of a training sample  $z$  on the model parameters  $\theta$ . If we increase the weight of this sample  $z$  in the training set by  $\epsilon$ , then the perturbed parameters  $\hat{\theta}_{\epsilon, z}$  obtained according to ERM (Empirical Risk Minimization) will be:
$$
\hat {\theta} _ {\epsilon , z} = \arg \min  _ {\theta} R (\theta) + \epsilon L (z, \theta). \tag {13}
$$
Define the parameter change  $\Delta_{\epsilon} = \hat{\theta}_{\epsilon ,z} - \hat{\theta}$ , and note that, as  $\hat{\theta}$  doesn't depend on  $\epsilon$ , the quantity we seek to compute can be written in terms of it:
$$
\frac {d \hat {\theta} _ {\epsilon , z}}{d \epsilon} = \frac {d \Delta_ {\epsilon}}{d \epsilon}. \tag {14}
$$
Since  $\hat{\theta}_{\epsilon ,z}$  is a minimizer of  $R(\theta)$ , therefore it satisfies the first-order derivative condition, which means the first-order derivative with respect to  $\theta$  is zero:
$$
0 = \nabla R (\hat {\theta} _ {\epsilon , z}) + \epsilon \nabla L (z, \hat {\theta} _ {\epsilon , z}). \tag {15}
$$
Next, since  $\hat{\theta}_{\epsilon ,z}\rightarrow \hat{\theta}$  as  $\epsilon \to 0$  , we perform a Taylor expansion of the right-hand side:
$$
0 \approx \left\{\nabla R (\hat {\theta}) + \epsilon \nabla L (z, \hat {\theta}) \right\} + \nabla^ {2} R (\hat {\theta}) + \epsilon \nabla^ {2} L (z, \hat {\theta}) \Delta_ {\epsilon},
$$
where we have dropped  $o(\| \Delta_{\epsilon}\|)$  terms. Solving for  $\Delta_{\epsilon}$ , we get:
$$
\Delta_ {\epsilon} \approx - \{\nabla^ {2} R (\hat {\theta}) + \epsilon \nabla^ {2} L (z, \hat {\theta}) \} ^ {- 1} \{\nabla R (\hat {\theta}) + \epsilon \nabla L (z, \hat {\theta}) \}.
$$
Since  $\hat{\theta}$  minimizes  $R$ , we have  $\nabla R(\hat{\theta}) = 0$ . Dropping  $o(\epsilon)$  terms, we have
$$
\Delta_ {\epsilon} \approx - \nabla^ {2} R (\hat {\theta}) ^ {- 1} \nabla L (z, \hat {\theta}) \epsilon . \tag {16}
$$
Note that it is assumed that  $R$  is twice-differentiable and strongly convex in  $\theta$ . we define:
$$
H _ {\hat {\theta}} = \nabla^ {2} R (\hat {\theta}) = \frac {1}{n} \sum_ {i = 1} ^ {n} \nabla_ {\hat {\theta}} ^ {2} L \left(z _ {i}, \hat {\theta}\right) \tag {17}
$$
exists and is positive definite. This guarantees the existence of  $H_{\hat{\theta}}^{-1}$ . The final influence function can be written as:
$$
I _ {u p, p a r a m s} (z) = \left. \frac {d \hat {\theta} _ {\epsilon , z _ {k}}}{d \epsilon} \right| _ {\epsilon = 0} = - H _ {\hat {\theta}} ^ {- 1} \nabla_ {\hat {\theta}} L (z, \hat {\theta}), \tag {18}
$$
Considering  $B(\hat{\theta})$  measured on any  $\mathcal{A}$  with any  $D_{ex}$ , our goal is to quantify how each training point  $z$  in the training set  $D_{tr}$  contributes to  $B(\hat{\theta})$ . We apply the chain rule on Eq. 18:
$$
I _ {u p, b i a s} \left(z _ {k}, B (\hat {\theta})\right) = \frac {d B \left(\hat {\theta} _ {\epsilon , z _ {k}}\right)}{d \hat {\theta} _ {\epsilon , z _ {k}}} \frac {d \hat {\theta} _ {\epsilon , z _ {k}}}{d \epsilon} \Big | _ {\epsilon = 0} = - \nabla_ {\hat {\theta}} B (\hat {\theta}) H _ {\hat {\theta}} ^ {- 1} \nabla_ {\hat {\theta}} L \left(z _ {k}, \hat {\theta}\right), \tag {19}
$$