Knowledge Distillation Transfer Sets and their Impact on Downstream NLU Tasks

Charith Peris, Lizhen Tan, Thomas Gueudré, Turan Gojayev, Pan Wei, Gokmen Oz

Introduction

The rapid advancement of Large Language Models (LLMs) has significantly enhanced Natural Language Understanding (NLU) capabilities. However, the deployment of these models in latency-sensitive environments, such as on-device virtual assistants, is often hindered by their immense computational requirements. Knowledge Distillation (KD) has emerged as a primary technique for model compression, where a compact "student" model is trained to replicate the behavior of a larger "teacher" model.

A critical yet under-explored aspect of KD is the composition of the "transfer set"—the data used by the student during the distillation process. This paper investigates the trade-off between using high-quality generic corpora (where the teacher is most confident) and task-specific data (which aligns better with the final use case but may result in noisier teacher predictions).

Experimental Framework

The researchers implemented a single-stage distillation pipeline, transferring knowledge from a 170M parameter multilingual teacher model to a 17M parameter student encoder. The core of the investigation centered on three distinct transfer set compositions:

  1. Generic-only: A baseline using Wikipedia, Common Crawl, and mC4.
  2. 7:3 Mix: A hybrid approach combining generic and task-specific data.
  3. Task-specific-only: A focused approach using de-identified voice assistant utterances.

Additionally, the study explored a "Teacher Finetuning" (FT) variant, where the teacher model was finetuned on task-specific data prior to distillation. This aimed to determine if a more specialized teacher could further enhance student performance.

Schematic of the experimental setup illustrating distillation paths from the teacher model to various student baselines and experimental models.

Data and Evaluation Tasks

The task-specific data comprised utterances across 26 distinct domains (e.g., Music, Shopping, Books) from a commercial voice assistant. Evaluation focused on two primary NLU tasks: Domain Classification (DC) and a joint Intent Classification/Named Entity Recognition (ICNER) task. Performance was measured using F1 scores for DC and Semantic Error Rate (SemER) for ICNER, with a particular focus on "tail" test sets containing low-frequency, rarely seen utterances.

The Primacy of Domain Alignment

A central finding of the study is that domain alignment between the transfer set and the downstream task is more important than the teacher's confidence or prediction stability. While generic data like Wikipedia allows the teacher to provide high-quality, low-noise predictions, students trained on "task-specific-only" data consistently outperformed the generic baselines. This suggests that the student benefits more from seeing the actual distribution of target data, even if the teacher's guidance on that data is relatively noisier.

The performance gains were most pronounced on "tail" test sets, where the experiment-task-specific-only-FT model achieved up to a 1.51% improvement in DC F1 score and a significant reduction in SemER (between -0.79% and -1.53%) across multiple languages. Furthermore, the study confirmed that distilling from a large LM is significantly more effective than training a small model from scratch on the target domain.

Analyzing Domain Similarity

The researchers also examined the relationship between a domain's similarity to generic text and the benefit derived from task-specific distillation. Using tf-idf vectors to measure similarity, they discovered a clear correlation: domains that are highly dissimilar to Wikipedia (representing the "long tail" of user requests) see the most substantial performance improvements when task-specific data is prioritized in the transfer set.

Correlation between domain similarity to generic data and improvements in Semantic Error Rate (SemER) across German, French, Italian, and Spanish.

Conclusion and Future Work

This research demonstrates that for downstream NLU tasks, the choice of transfer set data is paramount. Task-specific data, especially when combined with teacher finetuning, consistently yields superior student models compared to generic pre-training data. These findings provide a practical recipe for building high-quality, lightweight models for real-world applications.

Future work will look into more sophisticated similarity metrics beyond tf-idf and explore how these data ratios interact with more complex multi-stage distillation techniques (e.g., TinyBERT). Additionally, expanding the deep-dive evaluation to more diverse language families would further strengthen these conclusions.

Summary updated

BibTeX
@inproceedings{peris2022knowledge,
  author = {Charith Peris and Lizhen Tan and Thomas Gueudré and Turan Gojayev and Pan Wei and Gokmen Oz},
  title = {{Knowledge Distillation Transfer Sets and their Impact on Downstream NLU Tasks}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-industry.12},
}
Figure