Distilling the Knowledge in Data Pruning

Emanuel Ben Baruch, Adam Botach, Igor Kviatkovsky, Manoj Aggarwal, Gérard G. Medioni

Abstract

As neural network training scales to massive datasets, data pruning has emerged as a vital technique for reducing computational costs. However, existing pruning methods often suffer from significant accuracy degradation, particularly when keeping only a small fraction of the data. This paper introduces a framework that integrates Knowledge Distillation (KD) into the data pruning pipeline. By using a teacher model trained on the full dataset to guide a student training on a pruned subset, we demonstrate substantial performance improvements across various benchmarks. Crucially, we observe that with KD, simple random pruning often matches or exceeds the performance of complex, computationally expensive pruning algorithms. We also identify a "capacity gap paradox" where smaller teachers can outperform larger ones in extremely low-data regimes.

Introduction: The Challenges of Data Pruning

The exponential growth of datasets has made training state-of-the-art models prohibitively expensive. Data pruning seeks to mitigate this by selecting a subset of "informative" samples for training. Despite its promise, two primary bottlenecks persist:

  1. The Accuracy Gap: Models trained on pruned subsets rarely reach the performance of those trained on the full dataset, especially at high pruning rates (e.g., keeping <20% of data).
  2. The Noise Trap: Many algorithms prioritize "hard" samples, which in real-world data are often noisy, mislabeled, or low-quality. Training exclusively on these outliers can lead to poor generalization.

Methodology: Pruning with Knowledge Distillation

We propose a straightforward yet powerful solution: Pruning + KD. The process involves three steps:

  1. Teacher Training: A teacher model is trained on the complete dataset $\mathcal{D}$.
  2. Data Pruning: A subset $\mathcal{P}$ is selected using a pruning algorithm (e.g., Random, Forgetting, GraNd, or EL2N).
  3. Distillation: A student model is trained on the subset $\mathcal{P}$, guided by both ground-truth labels and the "soft" probability outputs of the teacher.

A key component of our approach is Adaptive KD Weighting. We found that as the pruning fraction ($f$) decreases, increasing the weight of the teacher's signal ($\alpha$) helps the student ignore the noise inherent in "hard" samples and focus on the underlying data distribution.

Key Empirical Findings

Random Pruning is a Strong Baseline

The most significant finding is that when KD is employed, the choice of pruning algorithm becomes less critical. In fact, simple random selection often outperforms sophisticated scoring methods.

Accuracy vs. pruning methods on CIFAR-100. Random + KD significantly outperforms standard pruning methods across all data fractions.

As shown in Figure 2, "Random + KD" consistently maintains higher accuracy than complex methods like GraNd or EL2N, particularly in high-pruning regimes. On ImageNet, a model trained on a random 50% subset with KD even surpassed the accuracy of a model trained on the full 100% dataset without KD.

The Capacity Gap Paradox

In traditional KD, larger teachers generally provide better guidance. However, we discovered a "capacity gap paradox" in data pruning: when data is extremely scarce, larger teachers can actually hurt performance.

Impact of teacher size on student accuracy (CIFAR-100). In low-data regimes (f < 0.2), smaller teachers can lead to better student performance than larger ones.

Figure 3 illustrates that for very small data fractions, students benefit more from teachers with capacities similar to or even smaller than their own. This suggests that the complexity of the teacher's internal representations might overwhelm the student when there aren't enough samples to ground the distillation process.

Discussion and Practical Implications

While our method requires training a teacher on the full dataset—which might seem to negate the savings of pruning—it remains highly practical for scenarios like Hyper-parameter Optimization (HPO) or Neural Architecture Search (NAS). In these cases, a single teacher can be trained once and then used to rapidly train and evaluate hundreds of student architectures on small, pruned subsets.

Furthermore, KD acts as a natural noise filter. By providing soft labels that reflect true class relationships, the teacher prevents the student from over-fitting to the "garbage" samples often selected by hard-sample pruning algorithms.

Conclusion

Integrating Knowledge Distillation into data pruning effectively bridges the accuracy gap and mitigates the impact of noisy data. By making simple random pruning a competitive strategy, this approach simplifies the data pruning pipeline and offers a robust baseline for future research in efficient deep learning.

Summary updated

Abstract

With the increasing size of datasets used for training neural networks, data pruning becomes an attractive field of research. However, most current data pruning algorithms are limited in their ability to preserve accuracy compared to models trained on the full data, especially in high pruning regimes. In this paper we explore the application of data pruning while incorporating knowledge distillation (KD) when training on a pruned subset. That is, rather than relying solely on ground-truth labels, we also use the soft predictions from a teacher network pre-trained on the complete data. By integrating KD into training, we demonstrate significant improvement across datasets, pruning methods, and on all pruning fractions. We first establish a theoretical motivation for employing self-distillation to improve training on pruned data. Then, we empirically make a compelling and highly practical observation: using KD, simple random pruning is comparable or superior to sophisticated pruning methods across all pruning regimes. On ImageNet for example, we achieve superior accuracy despite training on a random subset of only 50% of the data. Additionally, we demonstrate a crucial connection between the pruning factor and the optimal knowledge distillation weight. This helps mitigate the impact of samples with noisy labels and low-quality images retained by typical pruning algorithms. Finally, we make an intriguing observation: when using lower pruning fractions, larger teachers lead to accuracy degradation, while surprisingly, employing teachers with a smaller capacity than the student's may improve results. Our code will be made available.
BibTeX
@inproceedings{baruch2025distilling,
  author = {Emanuel Ben Baruch and Adam Botach and Igor Kviatkovsky and Manoj Aggarwal and Gérard G. Medioni},
  title = {{Distilling the Knowledge in Data Pruning}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=D8xx4Gl3MJ},
}
Figure