Practical Insights into Knowledge Distillation for Pre-Trained Models

Norah Alballa, Marco CaniniarXiv 2024 · DOI

TL;DR

This paper provides a comprehensive empirical analysis of knowledge distillation (KD) techniques for pre-trained models in collaborative and federated learning settings. It reveals that "Tuned KD," which optimizes hyperparameters like temperature and weight, consistently outperforms other methods, especially in heterogeneous data scenarios, and significantly reduces communication overhead in federated learning.

What Problem Does This Paper Address?

Collaborative learning, especially in decentralized and federated settings, faces challenges like data privacy, computational heterogeneity, and communication efficiency. Knowledge Distillation (KD) has emerged as a promising solution to transfer knowledge between pre-trained models, reducing communication costs and enabling diverse architectures. However, existing research lacks a systematic empirical analysis of KD's effectiveness across various data distributions and system configurations, particularly concerning hyperparameter tuning. This paper aims to fill this gap by providing practical insights and guidelines for applying KD in these complex environments.

Methods

The authors evaluate several KD methodologies:

  • Vanilla KD: The standard KD approach for transferring knowledge from a teacher to a student model.
  • Tuned KD: An extension of Vanilla KD where hyperparameters like temperature ($T$) and weight ($\alpha$) are systematically optimized through grid search.
  • Deep Mutual Learning (DML): A peer-to-peer approach where two models learn from each other.
  • Data Partitioning KD (DP-KD): A method that partitions transfer data to leverage teacher feedback while preserving student's existing knowledge.

They also explore:

  • Transfer Set Options: Using the student's own data, public unlabeled data, or public labeled data as the transfer set.
  • Data Partitioning Strategies: Uniform, Quantity Skew, Specialized Non-IID, Label Skew Random Chunks, and Label Skew Dirichlet distributions.
  • Model Pre-consolidation for FL: A novel approach where multiple pre-trained models are consolidated using KD before initiating federated learning, aiming to reduce communication rounds.

Datasets

The primary dataset used for experiments is CIFAR-10. The CINIC-10 dataset is also used for validation of findings. For transfer sets, they utilize:

  • Student's own training dataset.
  • Public unlabeled datasets.
  • Public labeled datasets.

Key Insights and Ideas

  • Hyperparameter Tuning is Crucial: Optimizing KD hyperparameters ($T$ and $\alpha$) significantly boosts performance, especially when there's a large performance disparity between the teacher and student.
  • Tuned KD is the Champion: Tuned KD consistently outperforms Vanilla KD, DML, and DP-KD across various data distributions and transfer set scenarios, even with weaker teachers.
  • Teacher Strength Matters: The choice between DML and Vanilla KD depends on teacher strength; DML is better with weaker teachers, while Vanilla KD excels with stronger ones.
  • Transfer Set Size Impacts Effectiveness: Larger transfer sets generally lead to more pronounced positive knowledge transfers, providing better data representation.
  • DML Struggles with Unsupervised Transfer: DML performs poorly when only unsupervised transfer sets are available, as it can reinforce existing biases without ground truth.
  • DP-KD's Weakness in Skewed Data: DP-KD underperforms in highly imbalanced (Specialized Non-IID) scenarios, suggesting the importance of class balance in the teacher's training data.
  • Pre-consolidation Accelerates FL: Using KD to pre-consolidate models before federated learning significantly reduces communication rounds and speeds up convergence.

Key Results

  • Tuned KD achieved accuracy gains of 16% in uniform distributions and an average improvement of 139% across non-IID scenarios compared to the best non-tuned approach.
  • The proposed KD pre-consolidation approach for FL achieved an average reduction of 60.6% in total communication rounds.
  • Tuned KD consistently outperformed other methods across all data partitioning strategies, demonstrating its robustness.
  • The paper provides a decision tree to guide the selection of appropriate KD methods based on data distribution and tuning availability.

Limitations and Future Work

  • Multi-teacher Complexity: While the paper touches upon combining multiple models, the extensive exploration of multi-teacher setups is reserved for future work due to complexity.
  • Automated Tuning: The authors suggest future research into developing efficient and automated methods for tuning KD hyperparameters, tailored to specific settings and learning objectives.
  • Implicit Factors in Teacher Selection: The DML approach's teacher selection suggests it might value attributes beyond accuracy, indicating an opportunity to develop KD algorithms that incorporate more complex criteria.
  • Generalizability of Findings: While experiments were conducted on CIFAR-10 and CINIC-10, further validation on larger and more diverse datasets would be beneficial.

Summary updated

BibTeX
@misc{alballa2024practical,
  author = {Norah Alballa and Marco Canini},
  title = {{Practical Insights into Knowledge Distillation for Pre-Trained Models}},
  year = {2024},
  eprint = {2402.14922},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.14922},
}
Figure