Distilling Lightweight Domain Experts from Large ML Models by Identifying Relevant Subspaces
Pattarawat Chormai, Ali Hashemi, Klaus-Robert Müller, Grégoire Montavon
TL;DR
SubDistill addresses subtask distillation by identifying task-relevant subspaces at each layer and transferring only this information from a large teacher to a smaller student. It introduces an orthogonal subspace matching loss $\mathcal{E}_l(a_T, a_\theta) = \mathbb{E}\left[\| V(a_\theta - \mu_\theta) - U^\top (a_T - \mu_T)\|_2^2\right]$ with $V^\top V = I_K$ and an orthogonal $U$, plus a layer-wise weight $\alpha_l$ scaled by $\mathbb{E}\left[\|(U^{(l)})^\top (a_T^{(l)} - \mu_T^{(l)})\|_2^2\right]$. Subspace $U$ is chosen via an adapted PRCA objective that maximizes a task-relevant margin, formulated as $\max_U \{ \mathbb{E}[ \langle \tilde{a}_T, c_T \rangle_U] + \beta^{-1} \mathbb{E}[ \langle \tilde{a}_T, \tilde{a}_T \rangle_U] + \beta \mathbb{E}[ \langle c_T,c_T \rangle_U] \}$ under $U^\top U = I_K$. Empirically, SubDistill yields substantial accuracy gains over baselines on CIFAR-100 and ImageNet subtasks for both CNN and ViT teachers and, via Explainable AI analyses (e.g., pixel-wise heatmaps), better preserves the teacher’s decision strategy, particularly in low-data regimes. A decoupled training variant further suggests subtask-aware distillation can reduce hyperparameter tuning while remaining competitive, pointing to improved reproducibility and practical deployment in resource-constrained settings.
Abstract
Knowledge distillation involves transferring the predictive capabilities of large, high-performing AI models (teachers) to smaller models (students) that can operate in environments with limited computing power. In this paper, we address the scenario in which only a few classes and their associated intermediate concepts are relevant to distill. This scenario is common in practice, yet few existing distillation methods explicitly focus on the relevant subtask. To address this gap, we introduce 'SubDistill', a new distillation algorithm with improved numerical properties that only distills the relevant components of the teacher model at each layer. Experiments on CIFAR-100 and ImageNet with Convolutional and Transformer models demonstrate that SubDistill outperforms existing layer-wise distillation techniques on a representative set of subtasks. Our benchmark evaluations are complemented by Explainable AI analyses showing that our distilled student models more closely match the decision structure of the original teacher model.
