Gap Preserving Distillation by Building Bidirectional Mappings with A Dynamic Teacher
Yong Guo, Shulian Zhang, Haolin Pan, Jing Liu, Yulun Zhang, Jian Chen
TL;DR
Gap Preserving Distillation (GPD) tackles the problem of diminishing knowledge transfer when a fixed, powerful teacher becomes too far ahead of a compact student. It introduces a trainable dynamic teacher (DT) constructed from the student via Inverse Reparameterization (IR) and strengthens transfer through Channel-Branch Reparameterization (CBR) and a hard parameter-sharing strategy. The method optimizes a gap-preserving objective in which the dynamic teacher guides the student while being guided by the static teacher, enabling bidirectional knowledge flow and direct parameter inheritance. Experiments on ImageNet demonstrate consistent improvements across CNNs and ViTs in both training-from-scratch and fine-tuning settings, with notable gains in scenarios lacking a pre-trained teacher and modest overhead relative to traditional KD.
Abstract
Knowledge distillation aims to transfer knowledge from a large teacher model to a compact student counterpart, often coming with a significant performance gap between them. We find that a too-large performance gap can hamper the training process, which is also verified in recent studies. To address this, we propose a Gap Preserving Distillation (GPD) method that trains an additional dynamic teacher model from scratch along with training the student to bridge this gap. In this way, it becomes possible to maintain a reasonable performance gap between teacher and student during the whole distillation process. To further strengthen distillation from the dynamic teacher to the student, we develop a hard strategy by enforcing them to share parameters and encouraging parameter inheritance. Besides hard strategy, we also build the soft bidirectional mappings between them which are built on an Inverse Reparameterization (IR) method and a Channel-Branch Reparameterization (CBR) strategy. We highlight that our IR is able to initialize a larger dynamic teacher with an arbitrary expansion ratio, while preserving exactly the same accuracy as the given student model. In this way, it guarantees that the dynamic teacher and student start from the same point and avoid a too large gap in early stage of training. As for our CBR, with parameter-sharing, it directly extracts an effective student model from the well-learned dynamic teacher without any post-training, making our method highly flexible for model deployment. In the experiments, GPD significantly outperforms existing distillation methods on top of both CNNs and transformers architectures, achieving up to 1.58% accuracy improvement. Interestingly, GPD also generalizes well to the scenarios without a pre-trained teacher, including training from scratch and fine-tuning, yielding a large improvement of 1.80% and 0.89% on ResNet18, respectively.
