Scaling Up Dataset Distillation to ImageNet-1K with Constant Memory

Justin Cui, Ruochen Wang, Si Si, Cho-Jui Hsieh

TL;DR

Researchers have developed TESLA, a new framework that scales dataset distillation to the massive ImageNet-1K benchmark. By mathematically refactoring the optimization process to use constant memory and introducing a "Soft Label Assignment" strategy, they achieved state-of-the-art accuracy while using 6x less GPU memory than previous methods.

What Problem Does This Paper Address?

Dataset Distillation (DD) aims to condense a massive dataset (like ImageNet's 1.2 million images) into a tiny set of highly informative synthetic images. If successful, you could train a high-performing model in seconds using just a handful of images.

The current gold standard for DD is Matching Training Trajectories (MTT). MTT works by making a "student" model trained on synthetic data mimic the parameter updates of a "teacher" model trained on real data. However, MTT has a massive bottleneck: to calculate the loss, it must "unroll" multiple steps of Stochastic Gradient Descent (SGD). This creates a computational graph that grows linearly with the number of steps. For a large-scale dataset like ImageNet-1K, MTT quickly exhausts even the most powerful GPUs' memory (VRAM), limiting researchers to just 1 or 2 images per class (IPC).

Methods

The authors introduce TESLA (TrajEctory matching with Soft Label Assignment), which tackles the scalability problem through two primary innovations:

  1. Constant Memory Gradient Computation: The authors discovered that the MTT loss function can be mathematically rearranged. Instead of maintaining $T$ separate computational graphs for $T$ steps of SGD, they cache a running sum of gradients. This allows them to compute the final meta-gradient sequentially, reducing memory complexity from $O(T)$ to $O(1)$.
  2. Soft Label Assignment (SLA): Distilling datasets with many classes (like ImageNet's 1,000) is difficult with standard "hard" labels (e.g., "this is a dog"). TESLA uses the pre-trained teacher models to generate "soft" labels (probability distributions) for the synthetic images at every iteration. This allows information to flow across class boundaries, significantly smoothing the optimization landscape.
Figure 1: Illustration of trajectory matching with soft label assignment (TESLA). Our method differs from MTT in two aspects: 1). The constant memory computation module calculates the exact trajectory matching loss as MTT but with constant memory complexity. 2). The train-free Soft-Label Assignment (SLA) module leverages the pretrained teacher to distill soft labels to the synthetic data points.

Datasets

The researchers evaluated their method on three standard computer vision benchmarks:

  • CIFAR-10 & CIFAR-100: Smaller datasets used to establish baselines and compare against existing SOTA.
  • ImageNet-1K: The primary target. They resized images to 64x64 to match previous work and tested scaling up to 50 IPC.

Key Insights and Ideas

  • The Memory-Efficiency Trick: The "aha moment" is the realization that the second-order gradient required for trajectory matching doesn't actually require storing the entire unrolled path. By pre-computing a global gradient vector $G$, the authors can backpropagate through each step one by one.
  • Soft Labels are Essential for Scale: While hard labels work okay for 10 classes (CIFAR-10), they fail miserably on 1,000 classes. The authors found that using soft labels from the target step of the teacher's trajectory (rather than just the final trained model) was the most effective strategy.
  • Efficiency vs. Speed: While TESLA drastically reduces memory, it does introduce a slight runtime overhead (~2-27% depending on the dataset) because it performs some calculations twice to save space. This is a very favorable trade-off for scaling to large problems.
Figure 4: Ablation study on different label strategies. Y-axis shows the maximum accuracy achieved until that iteration.

Key Results

TESLA sets a new bar for large-scale dataset distillation:

  • Memory Reduction: On ImageNet-1K, TESLA achieved a ~6x reduction in memory footprint compared to standard MTT.
  • Scaling to 50 IPC: Previous methods were stuck at 2 IPC on ImageNet-1K due to memory limits. TESLA is the first to scale to 50 IPC on a single GPU.
  • Accuracy Gains: At 50 IPC, TESLA achieves 27.9% accuracy on ImageNet-1K. While this sounds low compared to full training (33.8% in their setup), it represents an 18.2% absolute gain over the previous state-of-the-art and uses only 4.2% of the original data points.
  • Transferability: Synthetic datasets generated by TESLA for a simple ConvNet also performed well when used to train more complex architectures like ResNet-18 and Vision Transformers (ViT).
Figure 2: GPU memory usage comparison between MTT and TESLA. MTT scales linearly w.r.t. the number of match- ing steps, whereas our method uses constant memory. Re- sults are measured on CIFAR100 with batch size 100 under varying matching steps.

Limitations and Future Work

Despite the memory breakthrough, TESLA still requires storing checkpoints of the teacher model's training trajectory, which can be storage-intensive. The authors also note that while the gap is closing, there is still a significant performance difference between models trained on distilled sets versus the full original dataset. Future work may focus on removing the requirement for teacher trajectories entirely or further improving the information density of the synthetic images.

Summary updated

BibTeX
@inproceedings{cui2023scaling,
  author = {Justin Cui and Ruochen Wang and Si Si and Cho-Jui Hsieh},
  title = {{Scaling Up Dataset Distillation to ImageNet-1K with Constant Memory}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=ccwSdYv1GI},
}
Figure