Continual Distillation Learning

Qifan Zhang, Yunhui Guo, Yu XiangarXiv 2024 · DOI

Abstract

Continual Learning (CL) aims to enable models to learn new tasks sequentially without losing previously acquired knowledge. While prompt-based CL using large Vision Transformers (ViTs) has shown promise, the computational cost of these models limits their deployment on edge devices. This paper introduces Continual Distillation Learning (CDL) and a specific implementation called Knowledge Distillation based on Prompts (KDP). By utilizing globally shared "KD prompts," the framework successfully transfers knowledge from large teacher models to smaller student models, overcoming the "distillation information forgetting" inherent in standard prompt-based methods.

Introduction

The primary challenge in Continual Learning is catastrophic forgetting. Recent state-of-the-art methods utilize prompt-based learning, where a large, pre-trained backbone (like a ViT) remains frozen, and only a small set of learnable tokens (prompts) are optimized for each task. However, a significant performance gap exists between large-scale models (e.g., ViT-Large) and their lightweight counterparts (e.g., ViT-Small).

Comparison between standard Knowledge Distillation and the proposed Continual Knowledge Distillation framework.

While Knowledge Distillation (KD) is a natural candidate to bridge this gap, applying it to prompt-based CL is non-trivial. Standard KD assumes an offline dataset, whereas CL requires learning from a stream of tasks sequentially.

The Challenge: Distillation Information Forgetting

The authors identify a critical phenomenon termed Distillation Information Forgetting. In prompt-based CL, the student model selects specific prompts from a pool based on the input query. Because the selection mechanism is task-dependent, the knowledge distilled from a teacher into the prompts for Task A is effectively "hidden" or lost when the model transitions to Task B and selects a different set of prompts. Consequently, standard feature or logit distillation fails to provide a persistent global memory of the teacher's expertise.

Proposed Method: Knowledge Distillation based on Prompts (KDP)

To address these issues, the researchers propose Knowledge Distillation based on Prompts (KDP). This method introduces two primary architectural innovations designed to preserve distilled knowledge across tasks.

Architecture of the Knowledge Distillation based on Prompts (KDP) method.

1. KD Prompts

Unlike standard CL prompts that are retrieved via a query-key mechanism, KD prompts are globally shared tokens inserted into the student's frozen backbone. These prompts are accessible during every task, ensuring that the structural knowledge transferred from the teacher is maintained throughout the entire learning sequence.

2. KD Token and Classifier

Inspired by the DeiT architecture, the framework incorporates a dedicated distillation token at the input layer. The final representation of this token is passed to a specialized KD classifier. This classifier is trained to minimize the KL divergence between the student's output and the teacher's "soft labels," effectively capturing the teacher's probability distribution.

The total loss function integrates the classification loss for the current task, the distillation loss from the teacher, and the standard prompt-pool optimization loss.

Experimental Evaluation

The KDP framework was evaluated on two benchmark datasets for class-incremental learning:

  • CIFAR-100: 10 tasks, 10 classes per task.
  • ImageNet-R: 10 tasks, featuring diverse artistic renditions of ImageNet classes.

The method was integrated into three leading prompt-based CL baselines: L2P, DualPrompt, and CODA-Prompt.

Key Results and Insights

The experiments yielded several significant findings:

  • Performance Gains: On the ImageNet-R benchmark using CODA-Prompt, KDP increased the average accuracy of a ViT-Small student from 67.44% to 71.92%.
  • Mitigating Forgetting: KDP improved knowledge retention, reducing the forgetting rate on ImageNet-R from 8.52% to 5.61%.
  • Efficiency: A ViT-Small enhanced with KDP achieves performance levels near a ViT-Base teacher while maintaining the low inference latency and memory footprint required for edge deployment.
  • The "Frozen" Backbone Paradox: Traditional feature distillation is often ineffective in prompt-based CL because the backbone is frozen. KDP solves this by adding learnable "plug-in" parameters (the KD prompts) that can be updated without altering the core pre-trained weights.

Conclusion

Continual Distillation Learning via KDP provides a robust pathway for deploying high-performance AI on resource-constrained devices. By decoupling task-specific diversity (handled by the prompt pool) from global structural knowledge (handled by KD prompts), the framework ensures that the "wisdom" of large models is successfully and permanently transferred to smaller students in a sequential learning environment.

Summary updated

BibTeX
@misc{zhang2024continual,
  author = {Qifan Zhang and Yunhui Guo and Yu Xiang},
  title = {{Continual Distillation Learning}},
  year = {2024},
  eprint = {2407.13911},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.13911},
}
Figure