Structural Knowledge Distillation: Tractably Distilling Information for Structured Predictor

Xinyu Wang, Yong Jiang, Zhaohui Yan, Zixia Jia, Nguyen Bach, Tao Wang, Zhongqiang Huang, Fei Huang, Kewei Tu

TL;DR

This paper introduces "Structural Knowledge Distillation" (Struct. KD), a novel method for efficiently transferring knowledge from large "teacher" models to smaller "student" models in structured prediction tasks. By deriving a tractable, factorized objective function, Struct. KD overcomes the computational intractability of traditional knowledge distillation for complex output structures, achieving significant performance improvements for student models across various scenarios.

What Problem Does This Paper Address?

Knowledge distillation (KD) is a powerful technique for compressing large, computationally expensive neural networks into smaller, more efficient models. The standard KD approach typically involves minimizing the cross-entropy between the output probability distributions of the teacher and student models. However, for structured prediction tasks (like sequence labeling or dependency parsing), the output space can grow exponentially with the input size, making direct cross-entropy computation intractable. Existing methods often resort to approximations or distilling only local decisions, which can lead to suboptimal knowledge transfer. This paper addresses this fundamental challenge by proposing a method that makes the KD objective tractable for structured prediction by leveraging the inherent factorization of scoring functions in these models.

Methods

The core contribution of this paper is the derivation of a factorized form of the structural KD objective. The authors observe that most structured prediction models compute the score of an entire output structure by summing scores of its constituent substructures. They leverage this factorization to derive a new objective function that can be tractably computed and optimized, provided that the substructure space is polynomial and the substructure marginals can be estimated.

The paper then explores four scenarios based on the relationship between the teacher's and student's factorization forms:

  1. Shared Factorization: Teacher and student use the same factorization.
  2. Finer-grained Student: Student's substructures are more granular than the teacher's.
  3. Finer-grained Teacher: Teacher's substructures are more granular than the student's.
  4. Incompatible Factorizations: Teacher and student use fundamentally different factorization structures.

They demonstrate the tractability and effectiveness of their approach across these scenarios, particularly for sequence labeling and dependency parsing tasks.

Datasets

The experiments were conducted on several standard datasets:

  • CoNLL 2002/2003 datasets: Used for Named Entity Recognition (NER) tasks.
  • WikiAnn datasets: Also used for NER tasks, providing data for both in-domain and cross-lingual transfer experiments.
  • Penn Treebank (PTB) 3.0: Used for dependency parsing tasks.

The paper also utilizes unlabeled data from these sources for experiments involving semi-supervised learning.

Key Insights and Ideas

  • Tractability through Factorization: The key insight is that by exploiting the factored nature of structured prediction scoring functions, the intractable cross-entropy objective can be transformed into a tractable one. This is a significant theoretical advancement for applying KD to complex structured outputs.
  • Flexibility across Factorization Mismatches: The proposed Struct. KD method is shown to be effective even when the teacher and student models have different factorization structures (Cases 2, 3, and 4). This broad applicability is crucial, as it doesn't require identical model architectures.
  • Outperforming Approximations: Struct. KD consistently outperforms previous approximate KD methods (like Top-K KD or Posterior KD) by enabling exact knowledge transfer.
  • Unlabeled Data Boost: The method effectively leverages unlabeled data to further improve student model performance, sometimes even allowing students to surpass teacher models in zero-shot cross-lingual settings.
  • Local Temperature Application: Empirically, applying the temperature parameter locally to substructure logits yields better results than a global application.

Key Results

  • Improved Accuracy: In all tested scenarios (NER and dependency parsing), Struct. KD consistently outperformed baselines trained without KD and existing approximate KD methods. For instance, in NER tasks, Struct. KD achieved significant improvements over baselines.
  • Speed and Size Reduction: In Case 2a (CRF teacher to MaxEnt student), the student model was found to be approximately 24 times faster and 25 times smaller than the teacher model, demonstrating the practical benefits of KD.
  • Zero-Shot Cross-Lingual Transfer: For multilingual NER, Struct. KD enabled student models to achieve competitive or even superior performance compared to teacher models, especially when leveraging unlabeled data.
  • Significance: The improvements achieved by Struct. KD were statistically significant, as validated by the Almost Stochastic Dominance (ASD) test.

Limitations and Future Work

  • Computational Cost of Teacher Marginals: While the KD objective is made tractable, computing the teacher's substructure marginals can still be computationally intensive, especially for complex factorization structures. The paper mentions using dynamic programming for this in Case 4, suggesting that efficient marginal computation is key.
  • Factorization Assumptions: The method relies on the assumption that the scoring function can be factorized into substructures and that these substructure marginals can be tractably estimated. This might not hold for all structured prediction models.
  • Future Work: The paper suggests exploring more complex factorization forms and applying Struct. KD to other structured prediction tasks. The effectiveness of unlabeled data also points towards further research in semi-supervised KD for structured prediction.

Summary updated

BibTeX
@inproceedings{wang2021structural,
  author = {Xinyu Wang and Yong Jiang and Zhaohui Yan and Zixia Jia and Nguyen Bach and Tao Wang and Zhongqiang Huang and Fei Huang and Kewei Tu},
  title = {{Structural Knowledge Distillation: Tractably Distilling Information for Structured Predictor}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2021},
  url = {https://openreview.net/forum?id=HrxZ6JHsae5},
}
Figure