Abstract
Knowledge Distillation (KD) for structured prediction tasks often suffers from computational intractability due to the exponential growth of label sequences. This paper introduces Efficient Sub-structured Knowledge Distillation, a method that matches local sub-structure scores—specifically emission and transition scores in Conditional Random Fields (CRFs)—rather than global sequence probabilities. This approach eliminates the need for expensive dynamic programming during training, enabling massive parallelization. Experimental results on CoNLL 2003 and CoNLL 2000 benchmarks demonstrate that this method achieves state-of-the-art accuracy while reducing training time by over 50%.
Introduction
Knowledge Distillation (KD) is a standard technique for compressing large "teacher" models into smaller "student" models. While effective for simple classification, KD is challenging for structured prediction tasks like Named Entity Recognition (NER) or part-of-speech tagging. In these tasks, the output space is a sequence of labels where dependencies between neighbors create an exponentially large search space. Calculating full probability distributions for these sequences is often computationally intractable. Existing solutions like K-best decoding or Dynamic Programming (DP) are inherently sequential and slow, failing to leverage the parallel processing power of modern GPUs.
Methods: Sub-structured Score Matching
The proposed method shifts the distillation target from global sequence probabilities to local sub-structure scores. In a standard CRF model, sequence scores are composed of emission scores (word-label likelihood) and transition scores (label-label likelihood).
Instead of matching the normalized probability of an entire sequence, the student model is trained to minimize the $L_2$ distance (mean squared error) between its own sub-structure scores and those of the teacher. This innovation offers two primary advantages:
- Elimination of the Partition Function: There is no need to calculate the normalization term that typically requires the Viterbi algorithm or DP.
- Hardware-Friendly Parallelism: Loss calculation on local pairs and individual emissions can be flattened into matrix operations, allowing for efficient GPU parallelization.
By matching raw scores, the student also learns the "internal logic" of the teacher, preserving nuances in low-probability sequences that might be lost in traditional probability-based KD.
Experimental Results
The method was evaluated on two NLP benchmarks: CoNLL 2003 (NER) and CoNLL 2000 (Chunking). A 12-layer BERT-Base-CRF served as the teacher, while a 3-layer BERT-3L-CRF was used as the student to evaluate knowledge transfer to a significantly smaller architecture.
As shown in the performance table, Efficient KD achieved an F1 score of 89.70 on the CoNLL 2003 NER task, surpassing the previous best structured KD method (89.33) and the baseline student (88.86). Similar improvements were observed in the CoNLL 2000 Chunking task.
Beyond accuracy, the efficiency gains were substantial. Total training time per epoch was reduced to 41 seconds, compared to 83 seconds for K-best decoding and 99 seconds for previous structured KD methods. The student’s forward and backward passes were significantly faster (roughly 6x and 2.5x respectively) than competitors, directly resulting from the removal of sequential DP bottlenecks.
Conclusion
Efficient Sub-structured Knowledge Distillation provides a high-performance, hardware-efficient alternative for structured prediction tasks. By focusing on local sub-structures, the model achieves superior accuracy while drastically cutting training time. Future work may explore extending this local-matching philosophy to more complex graph-based structures or sequence-to-sequence generation tasks.
Summary updated