Dataset distillation for memorized data: Soft labels can leak held-out teacher knowledge
Paper · 2025 · Freya Behrens and Lenka Zdeborova
Summary
A student can learn the label of an example it never trained on, even when that label was assigned at random. The condition is that its teacher saw the example and supplied detailed predictions on other examples. Freya Behrens and Lenka Zdeborová study this possibility in dataset distillation, where the aim is to train effectively on a reduced dataset. They give the student a fraction of the teacher’s inputs, each paired with the teacher’s full distribution of scores over classes. These distributions, called soft labels, preserve information about the teacher’s preferences that a single class label would discard. The authors ask whether this information includes the teacher’s memories of individual examples.
The experiment distinguishes two kinds of unseen data. The student’s test set contains examples that the teacher trained on. A separate validation set contains examples that neither network trained on. In modular addition, the authors stop training some teachers after they have fitted the training examples but before they can reliably apply the addition rule to new operands. Students can recover the correct answers on the teacher’s withheld examples while remaining poor at solving the validation problems. In experiments with independent random inputs and labels, there is no rule linking an input to its assigned class. Even there, students beat chance on the teacher’s withheld examples and sometimes reach 100% accuracy.
The paper traces this behavior to different ways of fitting the supervision. In binary logistic regression, a student can use the teacher’s scores to reconstruct its linear prediction function once it has enough independent observations. With fewer observations, the student can still recover some of the withheld labels. Networks with a rectified linear hidden layer show a more abrupt change. The student can first learn to fit or approximate the supplied soft labels with partial success on the withheld examples, then reach perfect accuracy on those examples when it starts matching the teacher’s function. In a GPT-2 classifier trained on synthetic sequences with randomly assigned classes, the largest reported student training fraction is 80%, and the resulting accuracy on the withheld teacher examples is 0.652.
A central control is the softmax temperature, which determines how prominently a soft label displays score differences among classes. At low temperatures, the targets approach ordinary class labels. In the modular addition experiments, students trained with such targets can discover the rule even when their teachers have yet to do so. At higher temperatures used in the paper, students more readily reproduce what the teacher learned, whether that is a general rule or a collection of individual answers. Removing even small entries from the soft labels can impair memory transfer. The experiments establish that memorized information can pass through a reduced training set on synthetic tasks, while leaving open how much passes through on natural data.
Deep dive: Dataset distillation for memorized data: Soft labels can leak held-out teacher knowledge
Dataset distillation experiments show how soft labels can teach a student to classify examples seen only by its teacher. · about 38 minutes to read
The problem and its context
What can a prediction reveal about other examples?
An ordinary classification label assigns an example to a class. A prediction from a trained network can say considerably more. It gives a score to every possible class, so it can distinguish an emphatic answer from a narrow preference and differentiate among alternatives it ultimately rejects. When these scores are expressed as probabilities, the resulting soft label can supervise another network. The recipient can learn which class to predict and how strongly to prefer it over the others.
One reason to preserve these distinctions is that a teacher may have discovered relationships that hold across many examples. On a structured classification task, its preferences among alternative classes might reflect similarities that the original labels do not express. A student trained on those preferences could pick up those relationships from less data. But fitting a training set can also involve learning associations specific to particular examples. The paper asks whether the distinctions among scores can communicate those associations too, including ones attached to inputs that the student never receives.
The question matters for what a successful distillation experiment establishes. Suppose a student becomes good at answering questions it did not encounter during training. If the questions were part of the teacher’s training set, the result could reflect information about those particular questions. If the questions were also new to the teacher, success would instead show that the student can apply what it learned beyond the teacher’s examples. Both outcomes can be valuable for compression. They call for different explanations, and measuring them requires knowing which network has seen which data.
This distinction is especially important when the term test set refers only to the student. In this paper, a student test item is withheld from the student but was available to the teacher during training. Validation is the stricter test of novelty with respect to both networks. Keeping track of this vocabulary makes the central result easier to interpret. An increase in student test accuracy can indicate successful transfer of an answer memorized by the teacher even if student validation accuracy stays at chance.
How earlier work understood soft supervision
As the paper describes it, knowledge distillation uses information supplied by a teacher to train a student, often with the goal of making the student smaller. Dataset distillation directs attention to the training set itself. Its aim is to find a compact set of examples that supports good performance, and it may modify or synthesize the examples to improve what they teach. This paper adopts a particularly direct form of dataset reduction. It keeps a subset of the original inputs and changes the supervision attached to them. A trained teacher supplies those targets. That design lets the authors study the effect of the targets without attributing any gain to optimized inputs. Dataset Distillation
Early work on distillation showed that a student could learn effectively from a teacher’s softened predictions. Subsequent work discussed in the paper offers several accounts of why this works. A soft target can regularize learning by giving the student a less rigid objective than an ordinary class label. It can also expose statistical relationships the teacher has inferred from the data. The paper describes an intuition in which informative representations occupy a simpler space than the original data, and soft supervision helps a student approximate a function that exploits that structure. Distilling the Knowledge in a Neural Network
The paper cites work on natural image classification in which the largest entries of the teacher’s output are especially useful for matching its performance. That finding fits an explanation in terms of meaningful alternatives. A teacher’s leading predictions may convey the most relevant class relationships for an image. The question here is whether the same intuition applies to individual memories. A small score that contributes little to choosing an image’s class could still provide a constraint on the function that produced it. The distinction between class relevance and information about the teacher’s function motivates the paper’s tests that remove entries from a soft label. A Label is Worth a Thousand Images in Dataset Distillation
The authors also discuss earlier studies in which synthetic or arbitrary inputs could serve as effective transfer examples. Some such inputs are hard to interpret as natural examples of their class, yet a student can learn from the teacher’s responses to them. As presented in the paper, this raises the possibility that the decisive property of a transfer set is how well its inputs and targets constrain the teacher’s prediction function. Under that view, a useful example need not look representative to a person. Its value can come from revealing how the teacher responds at a particular point.
Theoretical work reviewed by the authors studies settings such as deep linear networks, learning with linear representations, and the amount of information retained through distillation. The paper also describes a related analysis in which the teacher itself generates the data. That setup gives teacher and student a common prediction rule to learn. Here, by comparison, the teacher first has to fit a finite collection of assigned labels. The source of the correlation between the teacher’s soft outputs and the withheld answers is therefore part of the experiment. Quantifying Knowledge Distillation Using Partial Information Decomposition
How to isolate a teacher’s memories
Prior work cited in the paper showed that neural networks can fit examples whose class labels were assigned at random. That makes random labels useful for studying memorization. If each label is drawn independently of its input, a predictor can learn the assignments it has seen, but the data-generating process offers no way to infer the class of a fresh input. The authors use this property to separate a student’s ability to recover known assignments from its ability to generalize to new draws.
Finite random datasets can contain accidental patterns. For example, inputs in some region may happen to share a class even though their labels were assigned independently. A teacher can respond to such patterns when fitting its examples. What matters for the experiment is that the patterns do not extend to independently labeled validation examples. Repeated trials and a chance baseline help put the gains on the teacher’s examples in context. The paper’s random-data design allows those gains to be attributed to what the teacher learned from its finite sample.
Modular addition provides a complementary test. The task has a rule, but a network can fit the training examples long before it learns to solve unfamiliar ones. The paper exploits this delayed improvement, known as grokking, to obtain teachers that have the same architecture and saw the same task but differ in what they can do with new operands. A student’s behavior can then be examined with either a teacher that largely recalls answers or a teacher that applies the rule. The random-data setting removes underlying structure by construction, while modular addition lets the authors observe what happens when structure is available but the teacher has yet to use it reliably. Progress measures for grokking via mechanistic interpretability
The method, step by step
Fit the teacher, then reserve some of its examples
The procedure begins with a collection of labeled examples for the teacher. An example consists of an input and its assigned class. The teacher trains on the full collection. A separate validation set is reserved before the student enters the experiment. For modular addition, this set comes from the part of the task the teacher did not train on. For independent random data, validation examples are fresh draws from the same random process. The teacher’s performance on these examples shows whether its training success extends to data outside its own training set.
Only after fitting the teacher do the authors divide its examples into a student training subset and a student test subset. The split is random, and the subsets are disjoint. This ordering is essential. If the test items had been removed before fitting the teacher, the teacher’s predictions could not reflect training on those particular pairs. In the actual experiment, the teacher’s parameters can be influenced by all its examples, including those whose inputs and labels the student will never receive.
The authors then calculate a prediction from the teacher for each input selected for student training. That prediction is made up of logits, the numerical scores before conversion to probabilities. In the main soft-label procedure, the scores are divided by a temperature and converted into a probability vector by softmax. The student receives the original input and this vector as its target. It learns by adjusting its own scores so that its output probabilities fit the target distribution.
The reduced dataset consequently has fewer inputs than the teacher saw, and each input carries a richer target than a class name. The extra entries can constrain how the student extrapolates between and beyond its own training examples. With this setup, leakage means that these constraints improve the student’s ability to classify withheld teacher examples. It does not require the student to generate the withheld input, list the teacher’s training set, or read the teacher’s parameters directly.
Distilling a teacher and testing its withheld memories
The steps in order.
The data and the split in notation
The paper writes the teacher’s training collection as follows.
Dᵀ⋆ = {(xᵘ, yᵘ) : μ = 1, …, n}
Here Dᵀ⋆ denotes the teacher’s training set, with T indicating the teacher and the star marking the full set used to fit it. The superscript ᵘ in xᵘ and yᵘ denotes the example index μ. The input of that example is xᵘ, its class is yᵘ, and n is the number of examples. The braces collect the input–class pairs over the displayed index range.
Each vector input has d coordinates, and the output classes are indexed from 1 to c, where c is the number of classes. The paper uses D for the source of the data. Depending on the experiment, that source is a finite collection or a process from which independent examples can be sampled. The symbol Dᵥₐₗ denotes the validation set, and Dˢₜᵣₐᵢₙ and Dˢₜₑₛₜ are the student’s training and test subsets of the teacher’s set.
ρ = |Dˢₜᵣₐᵢₙ| / n
The Greek letter ρ is the student training fraction. In the numerator, the vertical bars denote the number of examples in Dˢₜᵣₐᵢₙ, and n again denotes the size of the full set seen by the teacher. A comparison at fixed ρ therefore gives the student the same fraction of the teacher’s examples even when the absolute number of examples changes. Conversely, varying ρ with a fixed teacher dataset changes what the student sees while leaving the teacher’s training information intact.
From class scores to a learning objective
The network is a function that maps an input to a vector of class scores. The student function is written fθ, where θ denotes its trainable parameters. The most direct way to use the scores is to take the class with the greatest score. The paper calls this operation the argmax. For soft supervision, it first converts the scores into probabilities.
στ(z)ₖ = exp(zₖ / τ) / ∑ⱼ₌₁ᶜ exp(zⱼ / τ)
Here z is the vector of logits, zₖ is its entry for class k, and στ(z)ₖ is the resulting probability for that class. The temperature is τ, and exp is the exponential function. The denominator sums the corresponding exponentials over j, which runs over all c classes. The same normalization is applied to every coordinate. A positive temperature preserves the ordering of the scores, so the class favored by the teacher stays the same as the distribution is sharpened or flattened.
When the greatest logit is unique, decreasing the temperature toward zero concentrates the probability on that class. A target concentrated on one class behaves like a one-hot label, a vector with all its weight on the designated class. At a larger finite temperature, the differences in probability are less extreme, and the less favored classes can contribute more to the student’s training objective. In the limit of infinite temperature, all the probabilities become equal. The useful experimental distinction is thus between temperatures that preserve score differences in a form the student can learn from and limiting targets that have lost those differences.
The standard soft target for a student training input is obtained as follows.
ŷᵘ = στ(f⋆(xᵘ))
The vector ŷᵘ is the teacher’s soft label for example μ, written as the superscript ᵘ. The function f⋆ is the trained teacher, xᵘ is the input, and στ applies the temperature-dependent softmax to the teacher’s logits. The ground-truth class of the example is used to fit the original teacher. In the student’s soft-label objective, the whole vector ŷᵘ takes the place of the ordinary one-hot target.
L꜀ₑ = −∑ᵤ₌₁ⁿ ∑ₖ₌₁ᶜ (yᵘ)ₖ log([στ(fθ(xᵘ))]ₖ)
Here L꜀ₑ is the cross-entropy loss. The outer sum runs over the examples in the set used to compute the loss, with ᵤ denoting the index μ and n the size of that set. The inner sum runs over class indices k through c, the number of classes. The input to the trainable function fθ is xᵘ, and [στ(fθ(xᵘ))]ₖ is the predicted probability for class k at temperature τ. The component (yᵘ)ₖ is the target weight for that class and is replaced by (ŷᵘ)ₖ during distillation. The logarithm is denoted by log, and the minus sign makes a low probability on a class with positive target weight contribute a penalty.
With a one-hot target, only the term for the designated class contributes directly to the sum for an example. With a soft target, the other classes enter the loss as well. The student is penalized for placing its probability mass differently from the teacher, including when the two networks already agree on which class ranks highest. This is how two students can achieve the same training accuracy and still learn different functions. The training accuracy sees only the class decision, whereas cross-entropy responds to the rest of the distribution.
For the general supervised setup, the paper describes full-batch training with Adam and default PyTorch settings. A full batch uses the entire training set for an update. Particular experiments specify their own learning rates, training times, or regularization. The binary reconstruction experiment uses direct linear algebra for the student, and the GPT-2 classifier experiment uses AdamW. Adam: A Method for Stochastic Optimization · PyTorch: An Imperative Style, High-Performance Deep Learning Library
Classifying correctly and matching the teacher
The paper tracks the teacher’s accuracy on its training set and on validation. For the student, it measures accuracy on its own training set, on the teacher’s withheld examples, and on validation. These accuracies compare the predicted class with the assigned class. The distinction is consequential if the teacher fails to fit some of its examples. A student can reproduce the teacher’s prediction on such an input and still be wrong according to the assigned class.
The authors therefore also compare predictions directly. For the binary linear experiment, one diagnostic measures the mean squared difference between the teacher’s and student’s logits on a designated set.
mse(fᵀ, fˢ, D) = (1/n) ∑ᵤ₌₁ⁿ (fˢ(xᵘ) − fᵀ(xᵘ))²
The label mse stands for mean squared error. The teacher is fᵀ, the student is fˢ, and D is the evaluation set, with n inputs. For each example index μ, written as ᵤ in the sum and ᵘ on xᵘ, the squared difference measures disagreement between the networks’ scores. The factor 1/n averages the squared differences over the chosen set. The assigned class plays no role in this calculation.
For the separate measure of class agreement, the paper uses the following expression, with the sum taken over the student test set.
accˢₘₐₜ꜀ₕ₋ₜ = (1/n) ∑ᵤ₌₁ⁿ 𝟙[argmaxⱼ fˢⱼ(xᵘ) = argmaxⱼ fᵀⱼ(xᵘ)]
The left side is the student’s agreement accuracy with the teacher. The test set contains n examples for this expression, and xᵘ is the input of the example indexed by μ. The logit for class j is fˢⱼ(xᵘ) for the student and fᵀⱼ(xᵘ) for the teacher. The notation argmaxⱼ selects the class with the greatest score. The indicator 𝟙 is 1 when the chosen classes agree and 0 otherwise, and the factor 1/n averages the indicators. Agreement in this measure allows differences in the scores, which the squared-error measure can detect.
On the independent random-label task, the rate for guessing a class is especially simple.
accchance = 1/c
Here accchance denotes the expected accuracy of chance prediction, and c is the number of equally probable classes. A fresh label has the same probability of matching any particular prediction. For a finite validation sample, an observed accuracy can fluctuate around that value. Success on the student test set can exceed it because the teacher was trained on those examples and its predictions on the student training inputs can reflect that training.
Why the linear case permits an explicit reconstruction
The multinomial logistic regression experiments use linear score functions. Their form is as follows.
fᵂ(x) = W · x
Here fᵂ is the predictor parameterized by the weight matrix W, x is the input vector, and the dot denotes multiplication of the matrix by the vector. The matrix has c rows and d columns, with one row per class and one column per input coordinate. The binary reconstruction experiment uses a separate convention with one output logit. Its sign determines the predicted class. The separate conventions also matter for the paper’s reported measures of sample complexity.
In the binary case, an observed logit gives a linear constraint on the teacher’s weight vector. Observing a logit on each student training point builds a system of constraints whose input matrix has one row per point. In that experiment the student is given the raw teacher scores. It obtains a least-squares solution through a pseudoinverse, a matrix operation that can be used even when the input matrix is rectangular or the equations do not uniquely specify the weights.
ŵ = X⁺z
The vector ŵ contains the reconstructed weights. The matrix X stacks the student training inputs as rows, X⁺ is its pseudoinverse, and z is the vector of teacher logits on those inputs. If the rows supply enough independent constraints to give X full column rank, the solution recovers the teacher’s weights. When constraints are insufficient, the pseudoinverse selects a solution consistent with the observed logits, but different weights may fit them. Predictions from the selected solution can still agree with the teacher on some withheld inputs.
The single-logit analysis expresses dataset size with the following ratio.
α = n/d
Here α is sample complexity in the sense used by the paper, n is the full teacher training set size, and d is the number of input dimensions. The number of rows available to the student depends on ρ, the fraction of these samples it sees. With the random inputs used here, identifiability occurs when the student has enough rows to span the input dimensions.
αˢᵢd(ρ) = 1/ρ
The notation αˢᵢd(ρ) denotes the student’s teacher-identification threshold in the direct-logit binary analysis. The reciprocal of ρ marks the point where the student’s sample count reaches the input dimension. The paper distinguishes this threshold from αᵀₗₐᵦₑₗ, the limit up to which the teacher can correctly classify its full training set, and αˢₗₐᵦₑₗ(ρ), the limit up to which the student can fit the assigned classes on its own training set from teacher supervision. The teacher capacity boundary approaches 2 in the proportional limit for this binary setup. The thresholds answer separate questions about fitting labels and identifying a function.
For its experiments with multiple output scores and for the main random-data ReLU diagrams, the paper uses another normalization.
α = n/(dc)
Here α is the sample complexity under this convention, n is the teacher training set size, and the denominator is the product of the input dimension d and the number of output classes c. This scale makes it possible to study how the observed regimes move as the output size changes. Numerical thresholds on this scale should be read with its denominator in mind, particularly when comparing the multiple-output experiments with direct reconstruction of a single binary logit.
Experiments and results
A visible example of transfer on random labels
The introductory experiment uses inputs with 2 coordinates, so each example can be placed on a plane, along with the regions assigned to the different classes. A fully connected teacher with biases and 100 rectified linear hidden units fits randomly assigned labels drawn from 3 classes. A rectified linear unit, or ReLU, retains a positive activation and clips a negative one to zero. The teacher achieves 100% accuracy on its training points. The student is trained on 60% of those points and tested on the remaining 40%.
The experiment compares a hard-label student with a student trained on teacher probabilities. The hard-label student gets the original classes for its training points and has no source of teacher information about the other points. It reaches roughly 30% accuracy on the withheld split. The soft-label student reaches roughly 50% on that same split. The paper reports averages over 5 initializations, with standard errors. The result establishes partial transfer in a setting where the teacher has fitted arbitrary labels and the student sees the same kinds of inputs under either training condition.
The appendix repeats this visual comparison with 20 classes and a ReLU teacher with 300 hidden units. The teacher attains 100% training accuracy, and the student again sees 60% of the teacher’s data. For the student trained with teacher soft labels, the temperature is 20. The same comparison now shows a substantial separation between direct learning from the assigned classes and learning from predictions made by the teacher. The averages again come from 5 initializations. The boundary plot in this experiment shows close correspondence between the teacher and the soft-label student in the displayed input plane.
Student accuracy on withheld teacher points in the random planar task with twenty classes
Training on the teacher’s probabilities yields much higher accuracy on the withheld points.
The numbers
| System or setting | approximate accuracy % |
|---|---|
| Original class labels | 6 |
| Teacher soft labels (this paper) | 66 |
These comparisons serve a different purpose from an evaluation on fresh random examples. Their baseline uses the same student split and removes teacher supervision. This isolates the practical difference made by giving the student the teacher’s output. In the larger random experiments, chance and fresh validation accuracy provide an additional reference. Together they help distinguish recovery of arbitrary assignments from any general predictive advantage on the underlying stream of inputs.
Modular addition with teachers that learn at different speeds
In the structured experiment, the task is addition modulo 113. Each input presents operands and a prediction token, and the target identifies the remainder class for their sum. The complete collection contains 12, 769 problems in the paper’s notation. The teacher trains on 30% of the collection, with n = 3, 830. The rest is reserved for validation. From the teacher’s training portion, the authors draw separate training and test subsets for the student at each student training fraction.
The teacher and student use a single-layer transformer. The appendix describes token embeddings of dimension 128, a dot-product attention layer with 4 heads, and a ReLU network that acts on its output. A readout produces scores for the remainder classes. The architecture can predict tokens autoregressively, but the loss in this task applies only to the last prediction. The authors use full batches, weight decay of 1.0, and Adam with a learning rate of 0.001. The setup follows the earlier grokking experiment, allowing the authors to examine what happens before and after generalization emerges.
The authors stop teacher training at different points along the learning curve. Teacher 1 has discovered the least usable structure as judged by validation. Teacher 2 performs somewhat better on validation. Teacher 3 solves the task across the validation set. Each becomes a source of training targets for a student with the same architecture. Across the student training fractions and temperatures reported for this experiment, student training accuracy is 100%. Because that number is constant, the comparison turns on how students behave on the two kinds of unseen data.
At temperature τ = 10, a student trained from teacher 1 already does better on the held-out teacher problems than on validation at small training fractions. As the fraction grows, the student reaches test accuracy 1.0, while validation accuracy approaches that of the teacher. The comparison with teacher 2 exhibits a more abrupt rise towards this outcome. In both cases, the student can retrieve answers to problems from the teacher’s training set while failing to solve comparable problems that its teacher did not practice. At this temperature, training the student for 5× as long as the teacher still leaves its validation accuracy around the teacher’s level.
At τ = 0.1, the result depends much less on which teacher supplied the targets. The distributions are close to one-hot labels, so students trained from different checkpoints receive more similar supervision. A student can still fail to generalize with a fraction such as ρ = 0.7, but the authors also observe delayed generalization under the lower-temperature conditions. A memorizing teacher can thus supply sufficiently sharp targets for a student eventually to outperform it on validation. The availability of structure in the original problem makes this possible.
A generalizing teacher changes the value of matching its scores. With teacher 3, the appendix illustrates a student given ρ = 0.3 of the teacher’s examples at τ = 10. The student improves quickly on its training set and soon succeeds on both held-out teacher examples and validation. An illustrated run with more training data at a lower temperature exhibits the delay characteristic of grokking. The contrast concerns both the amount of data required and the route by which the student learns. At high temperature, a useful rule embodied in the teacher’s prediction function can be inherited quickly. At low temperature, the student can be left to discover that rule from the labeled examples.
Binary logistic regression and the boundary for recovery
The broader random-vector experiments use independently drawn Gaussian coordinates with mean 0 and variance 1. Class labels are assigned independently and uniformly. The binary analysis trains a linear teacher by minimizing logistic loss, then reconstructs a student using the teacher’s raw logits and the student input matrix. This experiment makes the number of available constraints on the teacher’s function explicit. It also sidesteps the softmax temperature and iterative student training, which are studied separately.
At a fixed student training fraction of ρ = 0.8, the authors vary the total number of teacher examples relative to input dimension. The teacher can fit its entire set at low enough sample complexity. At d = 1600, its observed memorization boundary is approximately 1.96, close to the limiting value of 2 for the binary linear setup. While the teacher fits the full dataset, the reconstructed student correctly classifies its own training examples. In that part of the experiment, poor student test accuracy reflects what is missing from the reconstruction, even though both networks correctly label the inputs used to form it.
The student’s held-out accuracy begins near random guessing and improves as sample complexity increases within the teacher’s memorization range. For sufficiently large sample size and training fraction, it reaches at least 55% on the student test set. Near the observed identification point of approximately 1.26 for ρ = 0.8 and d = 1600, test accuracy reaches at least 0.99. The result aligns with the reconstruction argument. Once the student sees enough independent input–logit pairs, the teacher’s linear function is determined, including its predictions on the points left out of the reconstruction.
The paper uses a phase diagram to compare outcomes across combinations of training fraction and sample complexity. It treats held-out accuracy below 0.55 as little or no observable leakage, intermediate performance as weak leakage, and accuracy of at least 0.99 as full recovery in the diagram’s empirical classification. These are operational boundaries for identifying regions in finite runs. The linear identifiability threshold has a separate basis in the rank of the input matrix.
At larger dataset sizes, teacher fit deteriorates. Recovery of the teacher can then coexist with mistakes on assigned classes. To distinguish reconstruction of an imperfect teacher from failed reconstruction, the diagram uses a mean squared error cutoff of 0.1 for teacher logits. This diagnostic is valuable precisely where label accuracy becomes ambiguous. If the teacher made errors on the withheld points, strong agreement with its logits supports the reconstruction claim even though ground-truth test accuracy falls.
The appendix studies the corresponding accuracy and logit error curves in more detail. It uses d = 1600, and each plotted point averages 5 experiments. In these runs the teacher is trained with Adam at learning rate 0.001 for 10, 000 steps. The additional curves show how nearly exact predictions on the teacher’s labels, close agreement with its class decisions, and low error on its logits can be examined together. These measurements become especially informative at the boundaries between the regimes.
Linear distillation from soft labels with multiple classes
The authors next use multinomial logistic regression to study what happens under actual soft-label training. The student now learns by minimizing cross-entropy with targets generated at different temperatures. A control shuffles the teacher’s soft labels among examples of the same assigned class. It keeps the targets associated with the class while weakening the input-specific association between a point and the scores the teacher produced for it. The result is a way to test the information in the pairing separately from the information in the target vectors considered as a class-level collection.
For the temperature comparison with c = 2, the paper uses d = 1000 and examines thresholds at ρ = 0.8 with sample complexity normalized by both dimension and class count. The student’s ability to fit classes from shuffled supervision changes markedly with temperature. The class-fitting boundary for these altered targets moves from the vicinity of the teacher’s label-fitting boundary toward the student’s identification boundary as temperature increases. The unshuffled distributions support substantial recovery of held-out examples in settings where the precise association between scores and inputs is available.
The paper also varies the number of classes from small cases up to 50. A larger class set gives the student a longer probability vector on each example. It also increases the number of weights in the teacher and student. The empirical scaling analysis asks how those changes affect the different thresholds under the paper’s normalized sample complexity. At finite temperature, the student can still obtain nontrivial accuracy on the withheld examples and, in some settings, reach 100%.
The reported class-count scalings are as follows.
αˢᵢd ∼ 1/c
Here αˢᵢd is the student’s identification threshold under the multiple-output normalization, c is the class count, and ∼ indicates the reported scaling relation. The authors find that the threshold varies inversely with the number of classes on this scale.
αᵀₗₐᵦₑₗ ∼ αˢₗₐᵦₑₗ ∼ 1/log(c)
The quantities αᵀₗₐᵦₑₗ and αˢₗₐᵦₑₗ denote the teacher’s and student’s label-fitting thresholds. The notation log(c) is the logarithm of the class count, and ∼ again indicates scaling. The paper reports similar class-count behavior for these thresholds under the settings studied.
αˢ⁻ˢʰᵘᶠᶠˡᵉₗₐᵦₑₗ ∼ 1/√c
The left side is the student’s class-fitting threshold when teacher target vectors are shuffled within classes. The square root of the class count is √c, and ∼ denotes the empirical scaling. This boundary varies with class count differently from the corresponding threshold under unaltered supervision. The stated scalings describe the tested conditions. In particular, the paper notes that only the teacher’s label-fitting capacity is independent of the student fraction and the softmax temperature.
Nonlinear networks exhibit an abrupt transition
The next experiment uses teacher and student ReLU multilayer perceptrons, or MLPs, with one hidden layer. In the main comparison both networks have 500 hidden units, inputs have d = 1000 coordinates, and the problem has c = 100 randomly assigned classes. The teacher successfully fits datasets of size 25,000 and 100,000. The student sees varying fractions of the teacher’s data. The paper reports averages and standard errors from 10 runs for this comparison.
For the teacher trained on 25,000 examples, student test accuracy improves as the student receives a greater fraction of the data. Throughout this pattern, the student can fit the classes of its own training examples. It recovers some withheld teacher labels even before there is evidence that its predictions amount to a reproduction of the teacher’s function. Student validation accuracy provides the independent-data reference for detecting this partial transfer.
For 100,000 examples, the result as a function of data availability becomes less direct. As the available fraction varies, the student passes through a region where its test accuracy drops even though the teacher still fits its entire set. Test accuracy there can be below what the student achieved at the same fraction of the smaller teacher dataset. Then the student’s training and test accuracy rise abruptly to 100%. The joint recovery suggests that an optimization run can move from trying to fit the soft targets individually to finding a function that accounts for them together.
To examine this behavior across more settings, the authors vary the number of teacher examples and the fraction available to the student, at temperature τ = 20. Each configuration in the corresponding phase diagram is repeated 5 times. The diagram includes a region where the student exceeds validation performance on the withheld teacher points while failing to fit all its own training classes. In a time-resolved comparison at ρ = 0.65, one setting shows a jump in training and test accuracy around t ∼ 100, where t indexes training time. The jump coincides with a reduction in the cross-entropy loss against the teacher’s output distribution.
The nonlinear results change how a decline in student training accuracy should be read. In the direct binary reconstruction experiment, a student can match observed logits and ultimately reconstruct the teacher when it has enough independent equations. In the ReLU experiments, a student using gradient training can lose its ability to fit the supplied targets before finding a function that explains them. Access to more examples can increase the information available about the teacher and simultaneously make a strategy based on fitting targets individually harder to sustain.
A GPT-2 classifier on synthetic sequences
The final experiment uses a pretrained GPT-2 backbone with a linear classification head. The inputs are strings formed by joining randomly sampled numbers, and each input receives a random class from 1000 possibilities. This design preserves a sequence format while retaining the crucial property of the random-vector experiments. The assigned class cannot be inferred from a rule relating it to the numbers in a fresh input.
The teacher trains on 6000 sequences with the standard tokenizer for 100 epochs, using AdamW and a learning rate of 5 × 10⁻⁴. The authors produce soft labels at τ = 20, then train matched students for 200 epochs. The student training fractions are 0.2, 0.5, and 0.8. The teacher’s exact training accuracy for this run is not reported as a numerical result. The student outcomes are reported separately for training and test.
All the students reach roughly 99.5% accuracy on their own training examples. Their results on the withheld examples differ substantially across fractions. The reported random-guess reference for separately labeled sequences is roughly 0.1%. In contrast, even the student given the smallest fraction of the teacher data reaches test accuracy 0.213 on withheld teacher examples.
GPT-2 student accuracy on withheld teacher sequences by training fraction
The student given the largest share of teacher examples recovers the most withheld labels.
The numbers
| System or setting | accuracy |
|---|---|
| Student training fraction 0.2 | 0.213 |
| Student training fraction 0.5 | 0.524 |
| Student training fraction 0.8 (this paper) | 0.652 |
The experiment extends partial transfer to the GPT-2 classifier and to randomly labeled sequences. The student given 80% of the teacher examples exceeds 60% accuracy on the withheld split. The authors did not find a setting with 100% accuracy on that split in their parameter exploration. The sequence experiment consequently supports the presence of leakage in this architecture without locating the teacher-identification regime observed in some of the simpler settings.
What the ablations show
Temperature changes what the student is rewarded for learning
The temperature experiments use different target distributions derived from the same teacher. This changes the emphasis of the loss while retaining the teacher’s class ranking. Relatively sharp targets reward following the leading prediction, so there is more latitude in how the student arrives at a correct answer. At a higher finite temperature, the alternative classes exert more influence, and different ways of obtaining the same leading prediction can produce different training losses.
The modular addition checkpoints show the consequences on a task with a rule. At τ = 0.1, the student’s outcome is largely independent of the teacher checkpoint. This result is consistent with the student learning from labels that are close to the ordinary answers. At τ = 10, the checkpoint matters because the teacher’s score pattern conveys more of what it learned. Soft supervision from a memorizing checkpoint favors recovery on the teacher’s own examples, and a student can remain weak on validation. Supervision from the teacher that learned the rule can help the student succeed quickly on validation. The same choice of temperature encourages imitation in both cases.
The appendix repeats the modular addition comparison with ReLU MLPs that have 2 hidden layers of 200 units each. The authors again use teacher checkpoints with different validation performance. At low temperature, the time at which the teacher stopped training has little effect on the student’s behavior. At higher temperature, students trained from memorizing teachers can perform much better on the withheld teacher examples than on validation. This replication supports an explanation based on the target and what the teacher learned, across both architectures tested on modular addition.
The behavior at intermediate and high temperatures should be read with the limiting cases in mind. Soft labels approaching one-hot targets lose the detail of alternative scores. Soft labels approaching a uniform vector lose class distinctions as well. The high temperatures that help with teacher matching in these experiments are finite settings at which relationships among the teacher’s outputs still affect the objective. The paper’s comparisons show that these relationships can be more useful for imitation than strongly peaked probabilities.
Shuffling separates class information from input-specific scores
The shuffling control keeps a training example in its assigned class and gives it a teacher target originally produced for another member of that class. The student can still encounter similar target vectors at the class level, but it loses the characteristic score pattern that belongs to each input. This is a stronger control than replacing the targets with an arbitrary smoothing rule. The shuffled vectors come from the same teacher and retain the same kinds of small and large probabilities.
For multinomial logistic regression, the authors compare the class-fitting boundaries for students trained with the original targets and the shuffled ones. At low temperature, target vectors within a class tend towards the same one-hot shape. Exchanging them makes relatively little difference to the training signal. At higher temperature, the precise pairing has more influence. The class-fitting threshold for the shuffled case moves toward the identification boundary reported for unaltered supervision. The appendices study the temperature comparison again with 10 classes and find qualitatively similar behavior.
In the ReLU experiments, shuffling helps interpret the transition during training. At ρ = 0.65, the authors compare learning curves for unaltered and shuffled targets across different dataset sizes. The normal student can initially show training accuracy close to that of a student whose targets have been shuffled. In the case with the abrupt transition, the normal student then improves sharply on both its training data and the withheld teacher examples. The cross-entropy against the teacher’s output falls at about the same time. These observations support the authors’ interpretation that the earlier phase involves fitting or approximating individual targets and the later phase involves discovering a prediction function shared with the teacher.
The evidence for those phases comes from the curves, the losses, and the intervention on the targets. Early agreement with the shuffled condition makes it plausible that the student can spend part of training on a strategy that gains relatively little from the exact input–target pairing. The later divergence shows where the pairing becomes decisive. The experiment tracks the functional behavior across the transition. It does not directly trace the contribution of particular hidden units or establish a unique representation in the student.
Low-probability entries and a class with no direct examples
The target truncation experiments ask where information about withheld examples resides in a probability vector. The authors use matched ReLU teacher and student networks with 500 hidden units, d = 1000 input dimensions, and c = 100 classes. The student training fraction is ρ = 0.7, and the temperature is τ = 20. The unaltered soft vectors provide a baseline. Against it, the authors set the smallest k entries to zero for each student training input, using k ∈ {1, 10, 50}.
The retained entries are used without renormalizing the vectors. The cross-entropy expression can still be evaluated because it multiplies each log probability by the corresponding target weight. This intervention changes which classes contribute to the objective and changes how much target weight an example carries. In the settings where intact labels would let the student match the teacher, removing the single smallest entry is already consequential. Removing more entries rapidly worsens student test accuracy on the withheld teacher data.
One interpretation follows from what function matching requires. The top entry helps identify the preferred class. Many entries can jointly specify the numerical relations among scores at a point, providing constraints that extend beyond the class decision. A small entry can matter when the student needs these constraints across training points to recover the teacher’s function. The authors present the result as a reason to question whether retaining only the top entries would preserve memorized information. The experiment specifically supports this concern for their random-data ReLU setup.
A different intervention withholds every student training input belonging to a chosen class. Next, the authors assess how accurately the student predicts that class on the test set. Other classes’ soft labels still contain a coordinate for the omitted class, so the student sees how strongly the teacher favors or disfavors that class on the remaining inputs. The student retains high accuracy on withheld examples of the omitted class. Direct training examples for the class were therefore dispensable in the tested condition when its score remained available as part of other targets.
The complementary intervention suppresses the chosen class’s coordinate on soft labels for inputs from the other classes. This damages held-out accuracy for the chosen class, while performance on the other classes stays closer to normal. Aggregate test accuracy changes comparatively little, so the class-level measurement exposes a loss that would be easy to overlook in an overall score. The paper reports these comparisons over 5 random datasets and initializations, with standard errors.
Taken together, the class interventions show that information about a class can be carried by predictions on inputs whose assigned class is different. Such an entry records how the teacher’s function behaves for that output away from its own directly labeled examples. This gives the student constraints from which it can recover some of the class’s withheld examples. In a random-label problem, this is evidence about a dependence induced by the fitted teacher. It does not rely on semantic similarity between naturally occurring classes.
Width changes fitting capacity and held-out accuracy differently
The paper varies the widths of the teacher’s and student’s ReLU hidden layers. In the jointly varied condition, both have the same width, and the authors compare runs at ρ = 0.45 and τ = 20. They rescale the sample-complexity axis by dividing it by the student’s hidden-layer width. The curves align fairly closely on the resulting scale. This suggests that the scale of the networks’ parameter counts matters for where the transitions appear when both widths change together. The width comparison at matched sizes uses a single experimental repetition per setting.
In a separate comparison, the teacher width is held at pᵀ = 500 and only the student width is varied. A wider student can become better at fitting its own training set in settings where learning the supplied soft labels is the main challenge. The main text points to ρ = 0.7 as an example of an improvement in student training accuracy. This result concerns the capacity to fit the targets the student receives. It leaves room for a different pattern in the student’s predictions on the rest of the teacher’s examples.
The authors explore that difference by focusing on settings with partial leakage and without teacher matching. They keep the teacher width at 500 and compare a range of student widths and training fractions. In this region, reducing student capacity can improve performance on the withheld teacher labels. The relationship is also nonmonotonic. At ρ = 0.3, the paper reports that students with 250 hidden units perform about as well as students with 1000. The comparison is repeated 5 times and reports standard errors. It shows that a greater ability to fit the soft training targets does not translate into a simple ordering of test performance.
A final ReLU comparison varies the number of classes with teacher and student width fixed at 500. When the horizontal axis is scaled by the number of examples per input dimension, the qualitative behavior across teacher fit, student fit, and held-out accuracy remains similar among the tested class counts. These curves are from single runs. They support a qualitative comparison across output sizes, alongside the more explicit threshold analysis in logistic regression.
Limitations
Limits identified by the authors
The authors describe the experiments as a proof of concept built from synthetic tasks. The structured case uses a fixed arithmetic rule, and the random cases assign labels independently of inputs. This makes it possible to distinguish learning that generalizes beyond the teacher’s training set from recovering labels the teacher had occasion to memorize. A natural dataset can combine regular patterns, isolated facts, and examples whose difficulty changes with their context. The experiments do not measure how much of each kind of information would be transferred together in that setting.
The paper emphasizes the relative simplicity of the systems used for the analyses of thresholds and training behavior. Binary logistic regression supports an exact argument based on linear constraints. The ReLU results concern shallow networks, and the modular addition results use small networks on a narrow task. The GPT-2 experiment shows partial transfer on a synthetic classification problem. It leaves open whether the thresholds and the abrupt transition observed in simpler networks apply to deeper ones. Even in the GPT-2 experiment, the explored conditions did not yield 100% accuracy on the withheld teacher split.
The authors also identify optimization and regularization as open variables. Training choices affect the effective capacity of the teacher to memorize and of the student to fit its targets or learn the teacher’s function. The experiments vary several settings and show different outcomes, but they do not isolate the influence of optimization and regularization systematically. The sharp jump observed in a ReLU run is evidence about training in that setting. A general statement about when gradient training must find a teacher-matching solution would require a different analysis.
The scope is further limited to distillation through soft labels. Broader forms of dataset distillation can modify the training inputs or use other signals from a teacher. The authors leave open how those procedures behave when a teacher jointly learns transferable structure and individual memories. They also raise a question about whether memorized information can be hidden for privacy purposes while leaving useful capabilities available. The experiments identify a route by which information can pass. They do not evaluate a privacy intervention.
Limits visible in the evaluation
The two unseen splits make the main result interpretable, but low validation accuracy has different force in the structured and random tasks. A teacher that performs poorly at modular addition validation may already represent some aspect of the rule without being able to turn it into consistently correct predictions. The paper explicitly treats validation as a proxy for discovery of structure in this setting. The independent random-label construction makes for a stronger isolation of memorization because the generating process contains no predictive relationship between input and label.
Perfect classification of the finite withheld set also has different implications across experiments. In the direct binary analysis, identifiability gives a reason the reconstructed linear function agrees with the teacher beyond the observed inputs. In nonlinear settings the interpretation is supported by the joint change in train and test accuracy and by the loss against teacher outputs. Perfect test accuracy by itself establishes recovered labels on that split. It does not prove equality of the two functions everywhere, and it does not show that the student has recovered the teacher’s original parameter values.
The distillation setup gives the student inputs taken from the teacher’s own training set. What the student learns can depend on how those inputs cover the teacher’s function. The experiments therefore show what can happen when known teacher training examples are available as transfer inputs and detailed soft outputs can be measured on them. They do not measure how much a student would learn from arbitrary queries, from access limited to winning classes, or from a teacher whose training examples are unknown. The result on a known held-out split also differs from identifying which examples a teacher saw in the first place.
The random-sequence test uses assigned classes and a classification head. Its metric is accuracy on the classes of supplied inputs. A student that performs well in this test can reproduce a share of the teacher’s arbitrary associations when given the corresponding sequences. The experiment does not measure reproduction of withheld strings, ordinary next-token generation, or memorization of a pretrained system’s original corpus. The use of a pretrained backbone establishes the architectural setting for the classifier while the synthetic dataset remains the source of the measured memories.
Some of the experimental summaries require care at the level of individual settings. The class-count scaling discussion and its figure caption give different student training fractions, 0.8 and 0.55, so the reported scaling trends are easier to interpret than the exact training fraction for that comparison. The appendix places the within-class shuffling intervention on student training targets, which is the condition that can change how the student learns. The depth of reporting also varies. Some width and class-count comparisons use a single run, whereas several main comparisons include averages over repeated experiments. This matters when interpreting a precise boundary or apparent curve alignment.
Finally, the ablation that zeroes small probabilities changes the retained mass as well as the information in individual entries. The result shows sensitivity to this specific truncation of the training objective. It cannot on its own determine how another procedure, such as renormalizing the entries it retains, would affect leakage. The omitted-class comparisons give more localized evidence by following the accuracy of the affected class. Even there, the measured effects are about the teacher’s predictions and the student’s resulting classifications on the synthetic data.
What came after
No subsequent studies are documented here. The authors leave open two questions arising directly from the experiments. One is where the boundaries lie between learning a general rule, recovering individual memories, and fitting the teacher’s predictions when all these behaviors are possible in the same task. The other is how much control over that transfer a distillation procedure can exert when the aim is to preserve useful generalization while limiting the spread of memorized information.
Cite
Cite as Freya Behrens and Lenka Zdeborova. 2025. Dataset distillation for memorized data: Soft labels can leak held-out teacher knowledge. arXiv:2506.14457 · ICLR 2026.
@misc{behrens2025dataset,
title = {{Dataset distillation for memorized data: Soft labels can leak held-out teacher knowledge}},
author = {Freya Behrens and Lenka Zdeborova},
year = {2025},
doi = {10.48550/arxiv.2506.14457},
eprint = {2506.14457},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2506.14457}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/behrens-2025-dataset-distillation-memorized-data-soft/