GIFT: Unlocking Full Potential of Labels in Distilled Dataset at Near-zero Cost

Xinyi Shang, Peng Sun, Tao Lin

TL;DR

Dataset distillation compresses massive datasets into tiny synthetic ones, but models trained on these datasets are surprisingly sensitive to how label information is utilized. This paper introduces GIFT, a plug-and-play method that refines soft labels and uses a cosine similarity loss to train models on distilled data. GIFT boosts state-of-the-art performance at zero extra computational cost and fixes a major, previously overlooked issue: the inability of synthetic datasets to generalize across different optimizers.

What Problem Does This Paper Address?

Dataset Distillation (DD) aims to synthesize a tiny dataset that can train a model to achieve similar performance as if it were trained on the original, massive dataset. Recent state-of-the-art DD methods have found success by using "soft labels"—probability distributions generated by a pre-trained teacher model—instead of standard one-hot "hard labels."

However, the authors identify three critical gaps in how these soft labels are used:

  1. Loss Function Sensitivity: Different DD methods use different loss functions (KL divergence, Mean Squared Error, Soft Cross-Entropy) to train models on the synthetic data. The authors show that simply swapping the loss function causes drastic performance swings, indicating a lack of a unified, robust approach.
  2. Suboptimal Soft Labels: Soft labels inherit the flaws of the teacher model. Furthermore, while they provide good intra-class information, they can hinder inter-class separation.
  3. Cross-Optimizer Generalization: This is a major blind spot in DD research. A synthetic dataset optimized for an AdamW optimizer might completely fail if a user tries to train a model on it using Stochastic Gradient Descent (SGD) or standard Adam.
Performance comparison of different loss functions across DD methods

Methods

To solve these issues, the authors propose GIFT (Gaining Improvement from Full Labels at Near-zero CosT). GIFT is not a new way to generate synthetic data; rather, it is a plug-and-play method for training on already-distilled data. It consists of two simple modules:

  1. Label Refinement: GIFT combines the teacher model's soft labels with smoothed versions of the ground-truth hard labels. By taking a weighted sum of the two (with a heavy bias toward the soft label, $\gamma = 0.1$), GIFT corrects erroneous teacher signals and improves class dispersion.
  2. Cosine Similarity-Based Loss: Instead of using standard Cross-Entropy or KL divergence, GIFT trains the target model using a cosine similarity loss between the model's output and the refined labels. The authors provide a theoretical proof showing that this minimizes an upper bound on the mutual information (V-information) between the images and labels.

Because GIFT only changes the loss function and label formulation during the final evaluation/training phase, it requires no additional computational cost or dataset re-synthesis.

Datasets

The authors evaluate GIFT on standard image classification benchmarks of varying scales:

  • CIFAR-10 and CIFAR-100
  • Tiny-ImageNet
  • ImageNet-1K (A large-scale dataset where many DD methods struggle to scale)

They test across different "Images Per Class" (IPC) budgets, typically IPC = 1, 10, 50, and 100.

Key Insights and Ideas

  • Loss functions pull the strings: The choice of loss function when training on synthetic data is a massive bottleneck. Existing methods leave a lot of performance on the table simply by using suboptimal loss functions like KL divergence.
  • Hard labels still matter: Soft labels from teachers are great, but they carry the teacher's inaccuracies. Re-injecting smoothed hard labels acts as a crucial corrective mechanism, proving that the "full potential" of a dataset requires both hard and soft label information.
  • The Cross-Optimizer blindspot is a gradient scaling issue: The authors discovered why synthetic datasets fail across optimizers. Traditional losses (like KL divergence) yield tiny loss values on synthetic data. For optimizers like Adam, this causes weight decay to overshadow the primary gradient signal, halting learning. Cosine similarity inherently normalizes these vectors, stabilizing the gradients and fixing the cross-optimizer failure.

Key Results

GIFT was applied on top of several state-of-the-art DD methods (SRe2L, RDED, DATM, G-VBSM, CDA) with impressive results:

  • Accuracy Boosts: GIFT consistently improved top-1 accuracy across the board. For example, it boosted SRe2L by +4.3% on CIFAR-100 (IPC=10) and RDED by +3.9% on ImageNet-1K (IPC=10).
  • Cross-Optimizer Rescue: When training a model on RDED's CIFAR-100 synthetic data (IPC=10), switching the optimizer from AdamW to SGD normally causes accuracy to plummet to a dismal 1.9%. GIFT rescues this, achieving 53.4% (a massive +51.5% improvement).
  • Cross-Architecture Generalization: GIFT significantly improves the ability to train large models (like ResNet-101 or Swin-V2-Tiny) using data that was distilled on much smaller models (like ConvNet).
  • Zero Overhead: Empirical tests confirmed GIFT adds zero peak memory usage and negligible training time compared to baseline loss functions.
Quantitative results of GIFT on CIFAR-100 and Tiny-ImageNet

Limitations and Future Work

Limitations: The paper does not explicitly dedicate a section to limitations. However, inherently, GIFT requires the existence of both the original hard labels and the teacher-generated soft labels to function. Additionally, it introduces a hyperparameter ($\gamma$) for the mixing ratio, though the authors demonstrate that $\gamma = 0.1$ is highly robust across different datasets and architectures.

Future Work: The authors suggest that GIFT's stability and zero-cost nature make it highly promising for applications involving large-scale models and Continual Learning. Preliminary experiments in the appendix show GIFT successfully improving class-incremental learning setups, paving the way for more robust memory-replay buffers in the future.

Summary updated

BibTeX
@inproceedings{shang2025gift,
  author = {Xinyi Shang and Peng Sun and Tao Lin},
  title = {{GIFT: Unlocking Full Potential of Labels in Distilled Dataset at Near-zero Cost}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=FoF5RaA3ug},
}
Figure