Learning with Less: Knowledge Distillation from Large Language Models via Unlabeled Data

Juanhui Li, Sreyashi Nag, Hui Liu, Xianfeng Tang, Sheikh Muhammad Sarwar, Limeng Cui, Hansu Gu, Suhang Wang, Qi He, Jiliang Tang

Introduction

While Large Language Models (LLMs) like GPT-4 or LLaMA-3 exhibit remarkable capabilities, their deployment in real-world applications is often hindered by significant memory requirements and high latency. A common strategy to mitigate these issues is to use smaller, more efficient models (e.g., RoBERTa). However, these smaller models typically require vast amounts of high-quality, human-labeled data to achieve competitive performance on specific tasks.

Obtaining human labels is both expensive and time-consuming. Knowledge Distillation (KD) offers an alternative by using an LLM "teacher" to label unlabeled data for a "student" model. Yet, traditional KD faces two primary challenges: noise (LLMs can generate incorrect pseudo-labels) and efficiency (training on redundant or overly simple samples wastes computational resources). The LLKD framework addresses these by identifying the "Goldilocks" zone of data selection: samples that are reliable enough to trust but difficult enough for the student to learn from.

The LLKD Framework

The authors propose LLKD, an adaptive sample selection method designed to optimize the distillation process. The framework operates through a synergy between three components:

  1. The Teacher (LLaMA-3-8B): A fixed LLM that generates pseudo-labels and provides a confidence score for each input.
  2. The Student (RoBERTa-base): A smaller model that actively learns from selected data. It provides an "uncertainty" score (entropy) for each sample, indicating its current difficulty with that input.
  3. Adaptive Dual-Threshold Selection: This core innovation uses dynamic thresholds that evolve during training. A Teacher Threshold ($\tau^T$) filters out low-quality labels, while a Student Threshold ($\tau^S$) prioritizes "hard" samples where the student is confused.
Overview of the LLKD framework for adaptive sample selection.

Rationale for Data Selection

The effectiveness of LLKD stems from its ability to balance label quality with sample informativeness. The researchers empirically demonstrated that teacher confidence is a strong proxy for label accuracy, while student uncertainty effectively identifies samples that offer the most learning potential.

Correlation between model accuracy and (a) teacher confidence and (b) student uncertainty.

As shown in the figures above, accuracy increases with teacher confidence, justifying its use as a quality filter. Conversely, accuracy decreases as student uncertainty increases, confirming that high-uncertainty samples represent the "frontier" of the student's knowledge where training is most impactful.

Key Results and Efficiency

LLKD was evaluated across five diverse text classification benchmarks, including PubMed-RCT-20k and Yahoo! Answers. The results highlight several key advantages:

  • Superior Accuracy: LLKD consistently outperformed popular semi-supervised baselines like FreeMatch and SoftMatch. For instance, it achieved a 5.82% relative improvement in F1 score on the PubMed-RCT-20k dataset.
  • Extreme Data Efficiency: On the same dataset, LLKD reached its peak performance using only 3.7% of the total available training samples, proving that training on less but better data can yield superior results.
  • Model Agnostic Nature: The framework's success is not tied to a specific teacher; switching from LLaMA-3 to Gemma-2-9b yielded similar performance gains.

Conclusion

LLKD demonstrates that adaptive, uncertainty-aware data selection can significantly enhance the efficiency of knowledge distillation from LLMs. By focusing on high-quality, informative samples, the framework allows small models to achieve high performance with minimal data and compute. Future work may explore extending this logic to generative tasks like summarization and scaling the teacher models to even larger parameters.

Summary updated

BibTeX
@inproceedings{li2025learning,
  author = {Juanhui Li and Sreyashi Nag and Hui Liu and Xianfeng Tang and Sheikh Muhammad Sarwar and Limeng Cui and Hansu Gu and Suhang Wang and Qi He and Jiliang Tang},
  title = {{Learning with Less: Knowledge Distillation from Large Language Models via Unlabeled Data}},
  booktitle = {Conference of the North American Chapter of the Association for Computational Linguistics},
  year = {2025},
  doi = {10.18653/v1/2025.findings-naacl.142},
}
Figure