Dataset Distillation via Knowledge Distillation: Towards Efficient Self-Supervised Pre-training of Deep Networks

Siddharth Joshi, Jiayi Ni, Baharan Mirzasoleiman

Dataset distillation (DD) shrinks massive datasets into tiny synthetic ones, allowing models to train efficiently with a fraction of the original memory and compute. While this technique has seen huge success in supervised learning, applying it to self-supervised learning (SSL) has been notoriously difficult.

SSL is vital in modern machine learning because it allows models to pre-train on vast amounts of unlabeled data before fine-tuning on specific downstream tasks. However, the chaotic, high-variance nature of SSL gradients makes traditional dataset distillation methods fail. This paper introduces MKDT (Matching Knowledge Distillation Trajectories), a novel method that uses Knowledge Distillation to smooth out these training trajectories, enabling the first effective dataset distillation for SSL.

The Challenge: High Variance in SSL Gradients

To understand why SSL dataset distillation is hard, we have to look at how standard DD techniques work. A popular method is Matching Training Trajectories (MTT), which tries to optimize a synthetic dataset so that a network training on it follows the same parameter updates (trajectory) as a network training on the real dataset.

The authors show that naively applying MTT to SSL fails spectacularly. SSL loss functions (like contrastive loss) rely on the interactions between multiple examples in a batch—for instance, pushing similar images together and dissimilar ones apart. This batch dependency creates highly variable, chaotic gradients.

Variance and failure of naive SSL distillation

When a DD algorithm tries to match these erratic training trajectories, the synthetic images receive chaotic updates and fail to learn meaningful, generalizable patterns. As a result, the distillation loss stagnates, and the synthetic images barely change from their initialization.

The Solution: Matching Knowledge Distillation Trajectories (MKDT)

To tame the high variance of SSL gradients, the authors propose a clever workaround: convert the unsupervised SSL problem into a supervised Knowledge Distillation (KD) problem during the trajectory generation phase.

The MKDT method works in three distinct steps:

  1. Train a Teacher: First, train a large "teacher" model on the full, real dataset using standard SSL algorithms (e.g., Barlow Twins or SimCLR).
  2. Generate Expert Trajectories via KD: Instead of recording the chaotic training trajectories of an SSL model, the authors train smaller "student" models to simply match the representations of the pre-trained teacher using Mean Squared Error (MSE). Because this KD objective is essentially supervised (the teacher's outputs act as the "labels"), the resulting training trajectories are much smoother and have significantly lower variance.
  3. Distill the Data: Finally, the synthetic dataset is optimized so that a network training on it follows these smooth, low-variance KD expert trajectories.

By using a pre-trained SSL teacher to generate target representations, the student model's loss becomes a simple, independent MSE calculation per image. This bypasses the batch-dependency of SSL, drastically reducing variance and making trajectory matching possible.

Key Results and Generalization

The authors evaluated MKDT by distilling CIFAR10, CIFAR100, and TinyImageNet down to just 2% and 5% of their original sizes. They then tested how well models pre-trained on these tiny synthetic datasets generalized to downstream tasks (Aircraft, CUB2011, Dogs, and Flowers) with very limited labeled data.

Downstream performance comparison for CIFAR10 pre-training

MKDT achieves state-of-the-art performance, outperforming all baselines—including random subsets, SAS subsets, and the recent KRR-ST method—by up to 13% in downstream accuracy when pre-training on a 5% distilled dataset.

Furthermore, the method is highly versatile:

  • Algorithm Agnostic: It works effectively regardless of the underlying SSL algorithm used to train the teacher (demonstrated with both BarlowTwins and SimCLR).
  • Cross-Architecture Transfer: Synthetic datasets distilled using small, simple ConvNets successfully transfer to larger architectures like ResNet-10 and ResNet-18, proving the distilled data captures fundamental, generalizable features rather than just memorizing network-specific quirks.

Limitations and Future Work

While MKDT represents a major step forward for SSL dataset distillation, it does come with limitations. Like many distillation methods, it requires significant upfront compute to train a large teacher model and generate multiple expert trajectories on the full dataset before the distillation process even begins.

Additionally, the authors noted that when transferring the distilled data to larger architectures, ResNet-18 slightly underperformed the smaller ResNet-10. This suggests that highly compressed datasets (like a 5% subset) might not contain enough diversity for very large models to fully utilize their extra capacity. Finally, as with all dataset compression techniques, there is a risk of bias amplification, as minority or outlier features in the original data might be discarded in favor of dominant patterns.

Summary updated

BibTeX
@inproceedings{joshi2025dataset,
  author = {Siddharth Joshi and Jiayi Ni and Baharan Mirzasoleiman},
  title = {{Dataset Distillation via Knowledge Distillation: Towards Efficient Self-Supervised Pre-training of Deep Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=c61unr33XA},
}
Figure