通过检索上下文样本重定义知识蒸馏,提升模型泛化能力
Rethinking Knowledge in Distillation: An In-context Sample Retrieval Perspective
- 从上下文样本检索视角重构知识蒸馏,捕捉同类别样本间关系
- 在CIFAR-100和ImageNet上均达最优性能,超越传统蒸馏方法
- 适用于离线、在线及无教师等多种蒸馏场景,通用性强
传统知识蒸馏关注学生模型对每个样本的输出与教师模型保持一致,但忽略了相同类别样本之间的关联。本文提出从上下文样本检索角度重新定义蒸馏知识,构建教师模型的特征记忆库,通过检索学习为每个样本寻找相关上下文样本。提出正向上下文蒸馏(PICD)缩小同类别样本间差异,负向上下文蒸馏(NICD)拉开不同类别样本间距离。理论分析表明,上下文知识是训练正则化的重要来源。大量实验显示,IC-KD在多种蒸馏范式下表现优异,在CIFAR-100和ImageNet上持续达到最先进水平。
原文摘要 · Abstract (English)
Conventional knowledge distillation (KD) approaches are designed for the student model to predict similar output as the teacher model for each sample. Unfortunately, the relationship across samples with same class is often neglected. In this paper, we explore to redefine the knowledge in distillation, capturing the relationship between each sample and its corresponding in-context samples (a group of similar samples with the same or different classes), and perform KD from an in-context sample retrieval perspective. As KD is a type of learned label smoothing regularization (LSR), we first conduct a theoretical analysis showing that the teacher's knowledge from the in-context samples is a crucial contributor to regularize the student training with the corresponding samples. Buttressed by the analysis, we propose a novel in-context knowledge distillation (IC-KD) framework that shows its superiority across diverse KD paradigms (offline, online, and teacher-free KD). Firstly, we construct a feature memory bank from the teacher model and retrieve in-context samples for each corresponding sample through retrieval-based learning. We then introduce Positive In-Context Distillation (PICD) to reduce the discrepancy between a sample from the student and the aggregated in-context samples with the same class from the teacher in the logit space. Moreover, Negative In-Context Distillation (NICD) is introduced to separate a sample from the student and the in-context samples with different classes from the teacher in the logit space. Extensive experiments demonstrate that IC-KD is effective across various types of KD, and consistently achieves state-of-the-art performance on CIFAR-100 and ImageNet datasets.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。