Training Compact Models for Low Resource Entity Tagging using Pre-trained Language Models

Peter Izsak, Shira Guskin, Moshe Wasserblat · OpenReview

Introduction

In the world of Natural Language Processing (NLP), bigger is often better for accuracy. Large pre-trained models like BERT have set new records, especially in "low-resource" scenarios where only a handful of labeled examples are available. However, these massive models—often containing hundreds of millions of parameters—create a significant "deployment gap." While a 330-million-parameter BERT model might excel in a research lab, it is often too slow, memory-hungry, and expensive to run on edge devices or in high-traffic production environments.

Researchers at Intel AI Lab have tackled this challenge by developing a method to train tiny, lightning-fast models for Named Entity Recognition (NER) that perform nearly as well as giants like BERT, even when labeled data is scarce. By combining knowledge distillation with pseudo-labeling of unlabeled data, they achieved a 36x reduction in model size and up to a 137x speedup in inference without sacrificing significant accuracy.

Methods: The Teacher-Student Framework

The authors bridge the gap between performance and efficiency using a Teacher-Student architecture:

  1. The Teacher: A large, pre-trained model (BERT-base or BERT-large) is first fine-tuned on the small amount of available labeled data.
  2. The Student: A much simpler "shallow" model (containing only ~3 million parameters) consisting of CNN layers for character features and Bi-LSTM layers for context. Unlike the teacher, the student is not pre-trained on massive text corpora.
Training framework combining knowledge distillation and pseudo-labeling

To effectively train the student, the researchers employ a hybrid loss function:

  • Task Loss: The student learns from the small labeled dataset plus "pseudo-labels" (the teacher’s best guesses) generated on a large pool of unlabeled data.
  • Distillation Loss: Instead of just trying to get the right answer, the student tries to mimic the teacher's entire probability distribution (the "soft targets") using KL-Divergence. This helps the student capture the nuanced ways the teacher evaluates language.

Datasets and Evaluation

The researchers evaluated their approach using the CoNLL 2003 English dataset, a standard benchmark for NER. To simulate a low-resource environment, they randomly sampled tiny subsets of the training data—ranging from just 150 to 3,000 labeled examples (representing 1% to 20% of the original set). The remaining data was treated as unlabeled.

Key Insights

  • The Power of Unlabeled Data: In industrial settings, unlabeled text is usually abundant. By using the teacher to pseudo-label this data, the student gets much more "practice" than it would with just the tiny labeled set.
  • Distillation as a Shortcut: The student model doesn't need to be pre-trained on Wikipedia for weeks. By distilling knowledge from a teacher that was pre-trained, the student inherits complex language features much faster.
  • Classifier Agnosticism: Standard small models usually perform much better with a complex CRF (Conditional Random Field) classifier. Interestingly, the distilled student models performed almost equally well with a simple Softmax layer. This suggests the distillation process makes the underlying representations so robust that the final classification layer matters less.
  • Surpassing the Teacher: In some extreme low-resource cases (under 300 labeled samples), the compact student model actually outperformed the BERT-base teacher. The student's simpler architecture makes it less prone to overfitting on tiny datasets.

Key Results

The resulting compact models demonstrated massive improvements in efficiency while maintaining competitive F1 scores against their much larger counterparts.

  • Compression: The student model is 36x smaller than BERT-base and 110x smaller than BERT-large.
  • Inference Speed: On a standard CPU, the compact model was 3.3x to 10.6x faster for single-request (online) inference.
Inference speedup of the compact model compared to BERT baselines

As shown in the table above, when utilizing batched processing, the compact model reached a staggering 137.8x speedup compared to BERT-large.

Limitations and Future Work

As this research was presented as a work-in-progress, the authors noted several areas for further exploration:

  • Task Variety: The study focused solely on NER. Future work will test if this distillation and pseudo-labeling combination works as effectively for other NLP tasks like sentiment analysis or document classification.
  • Hardware Optimization: While the speedups are impressive, the authors intend to further explore energy efficiency (FLOPs) and memory footprint to ensure these models are truly "edge-ready."
  • Architecture Search: The student model used a standard Bi-LSTM; future iterations could explore even more efficient architectures like LightConv or specialized, scaled-down Transformers.

Summary updated

BibTeX
@misc{izsak2019training,
  author = {Peter Izsak and Shira Guskin and Moshe Wasserblat},
  title = {{Training Compact Models for Low Resource Entity Tagging using Pre-trained Language Models}},
  year = {2019},
  eprint = {1910.06294},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.06294},
}
Figure