| Data and losses | |
|---|---|
| real training set | |
| distilled set, with fixed one-hot labels | |
| network weights | |
| average cross-entropy on the real and the distilled set | |
| their gradients at the current weights | |
| Unrolled and one-step matching | |
| random initial weights | |
| learned step size of the unrolled run (Wang et al.) | |
| weights after steps on the distilled set (gradient matching) | |
| per-output-unit cosine distance between gradients | |
| the expert's step size, in the one-step case | |
| Trajectory matching | |
| an expert's weights at checkpoint | |
| the student's weights after steps from | |
| student steps, and expert updates they must cover | |
| synthetic batch at step and its cross-entropy | |
| learned student step size | |
| normalized endpoint distance, the loss on the pixels | |
| latest allowed start checkpoint | |
| step- gradient, their sum, the expert's displacement (TESLA) | |
| Paper symbols | |
| the trajectory-matching paper writes and | |
| Cui et al. write for the step size and for the number of steps | |
| Wang et al. write too, and for the synthetic images | |
Context. Dataset distillationlearning a few synthetic training images per class that can replace a large real training set when a model is trained on them (Wang et al., 2018); a coreset, by contrast, keeps a subset of the real images. Reading note: Dataset distillation seeks a small synthetic set, typically 1 to 50 images per class, that trains a network from scratch nearly as well as the full dataset. Scoring a synthetic set directly requires differentiating through an entire training run, and memory grows linearly with the number of steps. Earlier work either unrolled a few steps (Wang et al., 2018) or matched one gradient step at a time (Zhao et al., 2021). Cazenavette et al. (2022) instead match a longer stretch of training. They start a student at a saved real-data checkpoint, take a few steps on the synthetic images, and optimize the pixels so it lands where the real run was several epochs later.
In practice, trajectory matching is the synthesis method that most clearly beats strong subsets of real images on small datasets at small budgets with one-hot labels. On CIFAR-10 at 10 images per class, a ConvNet trained on its synthetic set reaches 65.3% test accuracy, against 26.0% for 10 random real images per class and 84.8% for the full dataset. Re-evaluations with matched augmentation and stronger real subsets preserve a wide lead. The lead fades as budgets approach a few hundred images per class on CIFAR-10, as shown for gradient and distribution matching. It also vanishes on Tiny ImageNet once real images receive a teacher's soft labels. Scaling runs into storage for the real-data trajectories and memory for the unrolled student steps. Cui et al. (2023) remove the memory growth and reach ImageNet-1k at 64 × 64, where soft labels carry most of the accuracy.
Setting. Write the real training set, images with their class labels for the real training set and the distilled set: a few synthetic images per class, each with a fixed one-hot label; its pixels are what distillation optimizes for the distilled set, whose images carry fixed one-hot labels. At network weights the weights of the classifier being trained, a small ConvNet in most experiments here, let the average cross-entropy of the network with weights over the real training set and the average cross-entropy of the network with weights over the distilled set be the average cross-entropy on each set. Write their gradients as , the gradient of the real-data loss at the current weights and , the gradient of the distilled-set loss at the current weights. Evaluation trains a fresh network from random initialization on alone and scores it on the real test set, at budgets measured in images per classthe number of distilled images of each class (IPC in the papers); 10 images per class of CIFAR-10 is 100 images, 0.2% of its 50,000 training images.
The bilevel objective (Wang et al., 2018). Wang et al. treat the synthetic pixels and a learned step size the step size of the short training run on the synthetic images, learned along with them as parameters of a short run from random initial weights the network's initial weights, drawn from the usual random initialization. They minimize the trained network's expected loss on the real data:Over multiple steps on successive synthetic batches, backpropagation runs through every step, so memory and compute scale linearly with rollout length. Expanding to first order around (derived here) giveswith both gradients evaluated at . To first order, one synthetic step lowers the real-data loss in proportion to , the alignment between the synthetic and real gradients.
Gradient matching (Zhao et al., 2021). Zhao et al. avoid unrolling by targeting gradient alignment directly at every step. As a network trains on the synthetic set, each step at weights the weights of the network after steps of training on the distilled set, during distillation updates the pixels so the synthetic gradient matches the real gradient:The distance a sum, over layers and output units, of one minus the cosine between the synthetic and the real gradient of that unit's incoming weights compares gradients per output unit, matched class by class. Each pixel update differentiates through only one gradient computation, so the step is cheap. Cazenavette et al. argue that matching one step at a time is short-sighted. Small single-step mismatches accumulate over long training runs, so a student trained on gradient-matched images can drift far from the real-data trajectory.
Matching a stretch of training (Cazenavette et al., 2022). Trajectory matching captures long-range progress without unrolling from initialization. It starts each student at a saved checkpoint from a real-data run, so a short, affordable stretch still trains on weights that real training actually visits. First, many expertsnetworks trained on the real training set with their weights saved after every epoch; 200 for CIFAR, 100 for the ImageNet subsets train normally on , saving their weights an expert's saved weights at checkpoint ; the sequence is its trajectory after every epoch. Each distillation step picks an expert and a start checkpoint , initializes , and runs the student for the number of student steps on synthetic batches in one distillation step; much smaller than steps with a learned step size the student's step size on the synthetic images, learned along with the pixels. Step uses an augmented synthetic batch the batch of synthetic images used at student step , passed through a random differentiable augmentation; is the cross-entropy on it with cross-entropy . The loss measures squared distance to the expert's weights the number of expert updates that the student's steps must cover; checkpoints are saved once per epoch, so in practice a few epochs updates later, normalized by how far the expert moved:Backpropagating through all steps updates both the pixels and . Because , each synthetic step does the work of several real updates, and adapts to that ratio.
Sampling stretches across many experts covers training from initialization up to a start-checkpoint cap the latest checkpoint a student may start from; set too high, the images learn from late stretches where the expert barely moves, and set too low, they never see the middle and late parts of training, skipping the very end of training where the expert barely moves. Dividing by puts early and late stretches on the same scale. Without that normalization, late stretches where the expert moves little would produce small squared distances and weak gradients. Because every expert finishes training beforehand, distillation never touches real images while optimizing the synthetic pixels.
Gradient matching as the one-step case. Setting connects the two methods directly. Take one student step and one full-batch expert step from the same weights with expert step size the step size of the expert's training on real data; its single step here is , and minimize the normalized loss over (derived here):The minimum occurs at , which is a positive step when . One-step trajectory matching therefore reduces to gradient matching with a single global cosine across all weights. Zhao et al. instead sum one cosine per output unit, and their ablation shows the difference. On MNIST at 1 image per class with a ConvNet, a single global cosine reaches 69.2% against 91.7% for the per-unit distance. They also match gradients at weights reached by training on the synthetic set rather than at saved expert checkpoints. Beyond one step, trajectory matching extends gradient matching to multi-step stretches anchored on real trajectories.
Small-dataset gains. In Cazenavette et al.'s evaluation, each distilled set trains five fresh width-128 ConvNets from scratch. On CIFAR-10 at 10 images per class, trajectory matching reaches 65.3%, against 52.1% for DSAgradient matching with differentiable augmentation (Zhao and Bilen, 2021): the same random augmentation is applied to the real and the synthetic batch before their gradients are compared, 26.0% for random real images, and 84.8% for the full dataset. It also leads every compared method on CIFAR-100 and Tiny ImageNet at 1, 10, and 50 images per class. Cazenavette et al. also report the first distillation runs on 128 × 128 ImageNet subsets, reaching 63.0% on ImageNette at 10 images per class against 87.4% for the full subset.
Why longer stretches help. Ablations confirm that multi-step matching drives the gain over gradient matching. On CIFAR-100 at 1 image per class, accuracy is lowest when one student step matches a short expert stretch and highest when both and are large. In a direct trajectory test up to 1,000 steps, a fresh network trained on DSA images drifts farther from real-data checkpoints than one trained on trajectory-matched images as the horizon grows. Accuracy also rises with the number of stored experts, climbing sharply from 1 to 20 and leveling off near 200.
Where the lead fades: larger budgets. DC-BENCH (Cui et al., 2022) tunes the best augmentation per method and adds K-centera coreset method: embed the real images with a network trained on them, then pick images one at a time, each as far as possible from those already picked selection as a stronger real-image baseline. On CIFAR-10 at 10 images per class, trajectory matching still leads clearly at 63.7% against 41.5% for K-center. Above about 200 images per class on CIFAR-10, every synthesis method DC-BENCH runs there, gradient and distribution matching, drops to the level of random selection. DC-BENCH drops trajectory matching past 50 images per class because its memory and runtime do not scale.
Where the lead fades: soft labels. Giving real subsets a teacher's soft labels erases the advantage on harder datasets. Dey et al. (2026) isolate label type on Tiny ImageNet at 10 images per class. With one-hot labels, trajectory matching beats K-center at 20.1% against 11.4%. Giving every image one fixed teacher soft label lifts K-center to 27.1% and random real images to 26.1%, matching trajectory matching's 26.1%. Qin et al. (2024) instead label random real images with an early-stopped expert at 10 images per class. Trajectory matching keeps a 19-point lead on CIFAR-10 while falling behind on Tiny ImageNet.
Resource costs and architecture transfer. Vanilla trajectory matching carries heavy storage and memory costs. The 200 CIFAR experts take about 8 GPU-hours total and 60 MB each. Backpropagation memory grows linearly with times the synthetic batch size, reaching 144 GB across six GPUs in the largest run. Because the images are fitted to one architecture's experts, accuracy also drops on other architectures. On CIFAR-10 at 10 images per class, accuracy falls from 64.3% on the distilling ConvNet to 46.4% on a ResNet.
Constant-memory trajectory matching (TESLA, Cui et al., 2023). Standard backpropagation holds the computation graph of all student steps at once, so memory grows with . Cui et al. remove that growth by rearranging the gradient. Write , the student's gradient on synthetic batch at its current weights for the student's gradient at step , , the sum of the student's gradients over the steps for their sum, and , the expert's displacement over the matched stretch, a constant during the step for the expert's displacement. Because the student ends at , differentiating each through its own batch givesA first pass runs the student forward to accumulate . A second pass recomputes each and backpropagates through one batch at a time, holding only a single step's graph. On ImageNet-1k with batch size 100 and 50 steps, peak memory drops from 79.9 GB to 13.9 GB at roughly the same time per iteration.
TESLA at ImageNet-1k scale. Alongside the constant-memory gradient, Cui et al. give each synthetic image a soft label from the expert at checkpoint . On 64 × 64 ImageNet-1k at 10 images per class with a four-layer ConvNet, TESLA reaches 17.8% with expert soft labels against 4.4% with one-hot labels. Random real images reach 3.6% and the full dataset reaches 33.8%. Once memory stops blocking ImageNet scale, the soft labels carry most of the accuracy.
Terms
- Trajectory matching
- Start a student at an expert checkpoint , take steps on synthetic images, and minimize over the pixels.
- Experts
- Networks trained on the real data with a checkpoint every epoch; trained once, before distillation (about 200 suffice on CIFAR).
- Normalization
- Dividing by the expert's own movement keeps late, slow stretches of training informative.
- One-step case
- , step size optimized: , gradient matching with one cosine over all weights.
- Unrolled objective
- Wang et al.: ; to first order it rewards .
- Where it wins
- Small datasets, 1 to 50 images per class, one-hot labels: CIFAR-10 at 10 per class, 65.3% against 26.0% for random real images.
- Where it does not
- Above about 200 images per class on CIFAR-10 (shown for gradient and distribution matching), and on Tiny ImageNet against real images that also get a teacher's soft labels.
- TESLA
- Constant memory: sum first, then backpropagate one batch at a time (exact to first order in ); plus expert soft labels.
Sources
- George Cazenavette, Tongzhou Wang, Antonio Torralba, Alexei A. Efros, and Jun-Yan Zhu. Dataset Distillation by Matching Training Trajectories. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022.
- Justin Cui, Ruochen Wang, Si Si, and Cho-Jui Hsieh. Scaling Up Dataset Distillation to ImageNet-1K with Constant Memory. International Conference on Machine Learning (ICML), 2023.
- Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset Condensation with Gradient Matching. International Conference on Learning Representations (ICLR), 2021.
- Tongzhou Wang, Jun-Yan Zhu, Antonio Torralba, and Alexei A. Efros. Dataset Distillation. arXiv preprint, 2018.
- Justin Cui, Ruochen Wang, Si Si, and Cho-Jui Hsieh. DC-BENCH: Dataset Condensation Benchmark. Advances in Neural Information Processing Systems, Datasets and Benchmarks Track, 2022.
- Priyam Dey, Aditya Sahdev, Sunny Bhati, Konda Reddy Mopuri, and R. Venkatesh Babu. Rethinking Dataset Distillation: Hard Truths About Soft Labels. IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2026.
- Tian Qin, Zhiwei Deng, and David Alvarez-Melis. A Label is Worth a Thousand Images in Dataset Distillation. Advances in Neural Information Processing Systems, 2024.
Connected notes
- Softmax attention as a sum of RNNsEfficient sequence models · Fixed scales for stable training
Dividing the numerator of softmax attention by its L2 norm, which fixes the output's length, follows the softmax loss curve, while dividing by the sequence length behind a gate, with scores clamped at 5 and gradients clipped, still gives loss spikes.
- Maximal update parametrizationLazy training and feature learning · Fixed scales for stable training
In wide transformers trained with Adam, correlated queries and keys make attention logits grow like by the LLN rather than , so P rescales logits by and hidden learning rates by to keep scales bounded with width.
- Attention residualsUsing depth · Fixed scales for stable training
Because each depth-attention weight reads only the RMS-normalized key , inflating a sublayer's output norm buys it no extra weight; combined with softmax weights summing to 1, Block AttnRes holds output magnitudes below 2 against roughly 12 in the 48B baseline and cuts the gradient ratio across depth from 30x to 8x.
Bounding the moving-average step weight in keeps every centroid inside the convex hull of its assigned points at large batches, where uncapped SGD steps overshoot and collapse.