Abstract
Knowledge Distillation (KD) typically focuses on matching teacher and student outputs on training data, often failing to transfer the teacher's robustness to out-of-distribution (OOD) scenarios. We present HARD (Hard Augmentations for Robust Distillation), a task-agnostic framework that employs a generative augmentor to identify synthetic data points where the student and teacher disagree. By forcing the student to resolve these discrepancies, HARD effectively transfers the teacher's inductive biases and invariant properties, leading to significant improvements in OOD robustness and convergence speed.
Introduction
Knowledge Distillation is a cornerstone of model compression, yet it suffers from a persistent "generalization gap." While a student model might achieve high accuracy on a standard training set, it frequently lacks the teacher's "common sense"—the internal inductive biases that provide robustness to shifts, rotations, or stylistic changes. Current KD methods often converge slowly because standard datasets do not sufficiently challenge the student in regions where the teacher is most proficient.
Methodology: The Adversarial Loop
The HARD framework introduces a parameterized augmentor as a third player in the distillation process. The system operates through an adversarial loop designed to hunt for the student's blind spots.
Training Phases
The process switches between two distinct modes based on the student's performance:
- Student Training: When the student's loss exceeds a threshold ($\ell_{max}$), the augmentor is frozen, and the student is trained to match the teacher's output on augmented samples.
- Augmentor Training: If the student begins to match the teacher too closely (loss < $\ell_{min}$), the system switches to training the augmentor. The augmentor aims to maximize the Teacher-Student Loss (finding disagreements) while minimizing the Teacher-Teacher Loss (ensuring the teacher's prediction remains stable and valid).
Augmentor Variants
The authors explored three specialized augmentor architectures:
- HARD-Affine: Utilizes spatial transformers to learn optimal geometric transformations like rotation and scaling.
- HARD-Mix: An adaptive version of Mixup/Cutmix that learns which specific image patches to combine to challenge the student.
- HARD-VAE: Employs a Variational Autoencoder to generate complex, stylistic manipulations.
Key Insights: Why Data Matters
A core finding of this work is that the quality of training data often outweighs architectural constraints. Using a toy $cos(x)$ regression task, the authors demonstrate that even if a student model has the capacity to represent a function, it will not learn to extrapolate correctly unless the training data forces it to explore edge regions.
By penalizing the augmentor when the teacher's output changes, HARD ensures the student learns what the teacher is invariant to. This "invariance transfer" allows the student to inherit robustness—for instance, recognizing an object regardless of extreme crops or rotations that standard KD would ignore.
Experimental Results
The framework was rigorously tested across MNIST, CIFAR-10, and ImageNet, with a heavy focus on OOD benchmarks like ImageNet-C (corruptions) and ImageNet-A (adversarial).
- Equivariance Transfer: On shifted MNIST, HARD-Affine improved student accuracy from ~40% to 84.1%, nearly reaching the teacher's performance.
- Architecture Agnosticism: In ResNet18 to ViT transfers on CIFAR-10, HARD-VAE-Affine achieved 87.6% accuracy, significantly outperforming standard data augmentation (80.9%).
- Large-Scale Robustness: On ImageNet-C, HARD-Mix substantially reduced error rates compared to standalone students, often outperforming manually-designed strategies like AugMix or Cutmix by dynamically adapting to the student's specific weaknesses.
Conclusion and Future Work
HARD demonstrates that adversarial data augmentation is a powerful tool for robust knowledge distillation. By focusing optimization on the most informative samples, it achieves higher accuracy faster than standard methods. While currently computationally intensive, future iterations could leverage more efficient generative models, such as Diffusion Models, to produce even more semantically rich "hard" samples for real-time training.
Summary updated