Empirical law 2: Data influence is locally additive
In this post we explore a second empirical law of neural network training, this time regarding the influence of training data.
The main result is that, if we get rid of the inherent noise in the training process by averaging over many repeated runs, then the effect of each additional training example is approximately additive.
Setup
For a machine learning problem where the goal is to map inputs from a space to real-valued outputs, we call functions of the form hypotheses. For example, neural networks trained on CIFAR-10 compute hypotheses of the form . We denote the space of all hypotheses for the problem by .
Training neural networks is an inherently stochastic process, as evidenced by the fact that varying just a single parameter at initialization induces nearly the same amount of inter-run variance by the end of training as does a fully random initialization (Summers et al. 2021, Jordan 2023). Therefore, there is no meaningful way to reduce the variance of neural network training, besides arbitrarily picking a value at which to fix the random seed.
Because of this fact, in this paper we mathematically model neural network trainings as generating distributions over hypotheses, rather than a specific hypothesis per hyperparameter setting. If denotes a neural network training with fixed hyperparameters (e.g., this one), then we write to denote that is a hypothesis sampled from the probability distribution of all hypotheses which can be produced by running . Sampling from the distribution is as simple as running the training and collecting the resulting network.
For a given training , we define its mean hypothesis as being the hypothesis . Note that the outputs of are equal to the average outputs from an ensemble of independently trained networks, in the limit as the size of the ensemble goes to infinity.
If , and we define , then we have . Therefore, our understanding of neural network training is that every run produces a hypothesis given by the mean hypothesis , plus an inter-run hypothesis-noise term . That is: \begin{equation} f = \bar f_{\mathcal A} + \varepsilon_f. \end{equation}
We are interested in understanding the effect of various hyperparameters on the outcome of neural network training. In this post (and the previous one) we study the how changes as we change various hyperparameters of . The benefit of studying rather than the individual neural networks is that, as we will show, has much more lawful empirical behavior.
In this post we experiment with a single CIFAR-10 training configuration (this one, which descends from the CIFAR-10 speed record) and vary the training dataset.
To simplify notation, we write to denote the mean hypothesis generated by running the training algorithm with training data .
Main Experiment
We demonstrate that when are two random large subsets of CIFAR-10, then the following formula holds.
Equation 1. \begin{equation} \bar f_{A \cup B} \approx \bar f_A + \bar f_B - \bar f_{A \cap B}. \end{equation}
Figure 1. Training data has a locally additive influence on the mean hypothesis.
In Figure 1, we test this figure wiht being the first 45K CIFAR-10 training examples, and the first 40K plus the last 5K. Thus is the first 40K examples, and is the entire set of 50K examples. We find that the formula holds with a high degree of accuracy.
Our real motivation leading to this result was simply to search for empirical laws. But it can also be motivated from a ‘federated-learning’ perspective:
Suppose that we have two training dataset and , with some overlap. Ideally we would like to train on their union to get the best result. But suppose that we are not allowed to do this (perhaps due to privacy concerns). Instead, we are only allowed to train models on or individually (or any subsets thereof).
Then our question is: How can we combine the resulting models to recover the performance of training on ?
Figure 1 shows that if we are training ensembles, the correct thing to do is use . To show that this is a nontrivial result, let’s compare it to the naive approach of just ensembling and .
Figure 2. Naive federated ensembling is suboptimal.
We can see that this method of federated ensembling leaves almost 10x more unexplained variance than the correct formula (Figure 1). It also loses 0.17% accuracy compared to , whereas Formula 1 loses none.
For the sake of completeness, we also try using , which is around another order of magnitude worse in terms of .

Local Additivity
Definition
Definition 1. We say that a stochastic training algorithm satisifes local additivity over a training dataset relative to a base dataset if there exists a set of hypotheses such that \begin{equation} \bar f_{D \sqcup S’} = \bar f_D + \sum_{i=1}^n \bar f_i \cdot 1{(x_i, y_i) \in S’} \end{equation} for every subset .
Local additivity is equivalent to the statement that Equation 1 holds across a certain class of dataset pairs.
Theorem 1. The following two statements are equivalent:
- If is any pair of datasets such that and , then .
- is locally additive over relative to .
Proof in Appendix.
Result 1: Neural network training is not locally additive relative to .
Comment: The global addivity assumption of Ilyas et al. (2022) would imply that satisfies local additivity over all pairs.
Corollary: Global additivity is wrong.
Neural network training satisfies local additivity when the base dataset is large and random
Discussion
My presentation so far has been light on motivation. Let me explain what motivated the formula .
Related Work: Globally Linear Datamodeling
In Datamodels: Predicting Predictions from Training Data, Ilyas et al. (2022) proposed to model the influence of data on the mean hypothesis as being globally linear. In particular, they propose that for every input , there exist datamodel weights such that can be approximated as a linear function of : \begin{equation} \bar f_{S’}(x) \approx \theta^T 1_{S’} \end{equation} where is defined as the indicator vector for the subset , so that .
To estimate these weights, they sample a series of random training subsets , and then optimize to minimize the following cost function \begin{equation} \mathcal L(\theta) = \frac1m \sum_{j=1}^m (\theta^T 1_{S_j’} - \bar f_{S_j’}(x))^2 + \lambda |w|_1 \end{equation} where the mean hypotheses are noisily estimated by a single run of training per subset, across hundreds of thousands of random subsets. The estimated datamodel weights enable several remarkable applications, including duplicate detection and estimation of data support size for each test example.
The estimated datamodel weights enable several remarkable demonstrations. First, Ilyas et al. (2022) show that for around half of CIFAR-10 test examples, there exists a set of 250 training examples whose removal from the training set causes the test example to be misclassified. They locate such sets using the maximum datamodel weights. Second, the datamodels can be used as high-quality feature embeddings, enabling duplicate detection.
To demonstrate the predictiveness of the estimated datamodel weights, Ilyas et al. (2022) compare the predictions to the ground truth mean hypotheses , across hundreds of new random subsets which were not used in the optimization process. For this comparison, the mean hypotheses are estimated using 100 runs of training per subset.
Based on our digitization of the provided figure (Figure 5 in Ilyas et al. (2022)), we observe that at the level of individual examples, the Pearson correlation between the linear datamodel predictions and the ground truth is between 0.8 and 0.9 for most examples, indicating that linear datamodeling is indeed able to at least partially model the influence of data on neural network training. We conclude that there is still a substantial gap between the approximation of data influence provided by linear datamodels and the ground truth reality.
Footnote: The loss function minimized by Ilyas et al. (2022) differs from Equation 2 in two senses. First, the authors do not model the behavior of the mean hypothesis, but rather the behavior of individual networks generated by training. This yields a mathematically equivalent but noisier loss function. Second, the authors model the correct-class margin of a test example , rather than the logit outputs on , causing their datamodel weight to have shape compared to our . This difference is not significant for the discussion in this paper.
In particular, the Spearman correlation between the logits predicted by global datamodels, and the true logits, across random counterfactual training subsets, is only .
Reductio ad Absurdum for Global Additivity
The problem with the theory of globally linear datamodeling is that there’s a simple reductio ad absurdum showing it can’t always be true.
In particular, if we let be the first 25K CIFAR-10 examples and the last 25K. Then globally linear datamodeling implies that we should have . But this runs into a problem when compared with the following intuitive statements:
- will be roughly similar to . Therefore, the hypothesis will produce logits which are roughly double the size of those produced by .
- But actually has a fairly similar logit scale to .
This is a contradiction, so the theory of global linearity cannot be right.
But this post shows that it is true in the more limited circumstance, that both and just add a small amount of extra data onto their large underlying base set . We call this empirical phenomenon local additivity. The next section explores how large the base set and additional sets and have to be for this phenomenon to hold.
Extended Experiment
In this section we’ll repeat the above experiment across a wide range of sizes and overlaps for and .
As the base set which is accessible to both federated nodes, we will use a random set of size .
And as the additional sets and which are only available to a single node each, we will use disjoint random sets of size .
In every case, both and are selected randomly from the CIFAR-10 training set, such that they meet the constraints on their size and the size of their intersection.

Figure 3. Federated learning formulas for ensemble learning across two nodes.

Figure 4. Unexplained variance. The relationship is super-linear. N = 8000 in every case.
In Figure 3 and 4 we display three values for each pair:
- The error rate given by naively ensembling and .
- The error rate given by using Equation 1.
- The ideal-world error rate given by training on all of .
We can make several observations:
- For , it appears that Equation 1 is almost perfect, no matter the value of .
- In general, the smaller is, the more accurate the formula is.
- The formula breaks down the most when is small and is large. For example, with we have , but the formula gives only , which isn’t much better than the naive ensembling method which gives .
(Note that the pair , is missing, because this would require which is impossible since the CIFAR-10 training set only contains 50,000 examples.)
Non-Random Subsets
In our experiments so far, the subsets and have been randomly sampled, which is in some sense an “easy case” for Equation 1. In this section, we test a few more pathological choices of subsets to see where the formula breaks down.
Scenarios
Recall that the CIFAR-10 training set contains 10 classes each with 5K examples, for a total of 50K examples.
We consider five scenarios. The first is just the “random 45K” scenario explored in the first section, and the remaining four are more pathological/non-random.
- (Baseline) Random 45K: Let be a random 45K examples. Let be a random 45K examples, such that the overlap with is 40K examples.
- Missing 500 cats and 500 dogs: Let be the full set, minus 500 random cats and 500 random dogs. Let be the full set, minus a different 500 random cats and 500 random dogs.
- Missing 2K cats and 2K dogs: Let be the full set, minus 2000 random cats and 2000 random dogs. Let be the full set, minus a different 2000 random cats and 2000 random dogs.
- Missing half of cats and dogs: Let be the 40K non-cat/dogs, plus 2500 cats and 2500 dogs. Let be the 40K non-cat/dogs, plus the other 2500 cats and 2500 dogs.
- Missing 4K cats or dogs: Let be the full set, minus 4000 random cats. Let be the full set, minus 4000 random dogs.
- Missing all cats or dogs: Let be the full set, minus all 5000 cats. Let be the full set, minus all 5000 dogs.
- Missing half of everything: Let be 25K random examples, and be the other 25K.
Results
| Scenario | Explained Var | ||||||
|---|---|---|---|---|---|---|---|
| 1 | 94.08% | 94.38% | 94.37% | 94.57% | 94.77% | 94.72% | 0.99990 |
| 2 | 94.50% | 94.69% | 94.63% | 94.65% | 94.76% | 94.72% | 0.99997 |
| 3 | 91.39% | 94.12% | 94.03% | 94.16% | 94.38% | 94.72% | 0.993 |
| 4 | 77.12% | 93.84% | 93.67% | 93.92% | 89.84% | 94.72% | 0.67 |
| 5 | 91.39% | 92.63% | 91.77% | 93.85% | 94.54% | 94.72% | 0.998 |
| 6 | 77.12% | 86.11% | 86.40% | 88.53% | 93.91% | 94.72% | 0.974 |
| 7 | n/a | 92.36% | 92.35% | 92.72% | 92.72% | 94.72% | 0.15 |
Note: In every scenario, is just the entire training set, hence why every scenario has .
Also note: the for the deltas is:
- 0.993
- 0.992
Discussion
Equation 1 gives superior results to the naive ensembling in every scenario except for 4, where naive ensembling is significantly better.
The reason for this can be understood with some reasoning. In scenario 4, contains neither cats nor dogs, whereas both and contain many cats and dogs. Hence, will always assign zero or slightly negative cat/dog logits, whereas the cat and dog logits assigned by and will have the usual scale. Therefore, will have approximately double the scale for its cat and dog logits as compared to its other logits, leading to over-prediction of cats and dogs. Manual inspection confirms that this reasoning pans out, since predicts either cat or dog 26% of the time, whereas the correct rate should be 20%.
This failure mode is the reason why we must add the qualification that data influence is locally additive. It is not additive if contains no examples of a subgroup which gets added in by both and .
Case 2 has the same sized gap, but reversed so that is dramatically better than .
Conclusion
Overall, we have confirmed that the formula approximately holds when and are random subsets with a relatively large overlap. And we have shown that it breaks down in circumstances where and are not random, especially those where both and both introduce a new subgroup of data which is absent from their intersection.
Appendix
Additional Figures
Here are some extra figures for the “random 45K” scenario which may be of interest to the reader.

Proofs
Lemma. Let and be disjoint sets of training data. Then assuming linear datamodeling, .
Proof. \begin{align} \bar f_{C \sqcup D}(x) &= \sum_{i=1}^n \theta_i \cdot 1{(x_i, y_i) \in C \sqcup D} \newline &= \sum_{i=1}^n \theta_i \cdot 1{(x_i, y_i) \in C} + \sum_{i=1}^n \theta_i \cdot 1{(x_i, y_i) \in D} \newline &= \bar f_C(x) + \bar f_D(x). \end{align}
Lemma. If then .
Proof. Similar.
Theorem. Assuming linear datamodeling, for all , where we assume .
Proof.
The set can be decomposed as the disjoint union . Using the lemmas we therefore have \begin{align} \bar f_{A \cup B} &= \bar f_{(A - (A \cap B)) \sqcup (B - (A \cap B)) \sqcup (A \cap B)} \newline &= \bar f_{A - (A \cap B)} + \bar f_{B - (A \cap B)} + \bar f_{A \cap B} \newline &= \bar f_A + \bar f_B - \bar f_{A \cap B}. \end{align}
