[Paper Review] Distilling the Knowledge of Romanian BERTs Using Multiple Teachers
This paper introduces three distilled BERT models for Romanian—Distil-BERT-base-ro, Distil-RoBERT-base, and DistilMulti-BERT-base-ro—created via knowledge distillation from single and ensemble teachers. The distilled models achieve comparable performance to their teachers on five NLP tasks while being 35% smaller and nearly twice as fast on GPU, with high prediction loyalty across label, probability, and regression metrics.
Running large-scale pre-trained language models in computationally constrained environments remains a challenging problem yet to be addressed, while transfer learning from these models has become prevalent in Natural Language Processing tasks. Several solutions, including knowledge distillation, network quantization, or network pruning have been previously proposed; however, these approaches focus mostly on the English language, thus widening the gap when considering low-resource languages. In this work, we introduce three light and fast versions of distilled BERT models for the Romanian language: Distil-BERT-base-ro, Distil-RoBERT-base, and DistilMulti-BERT-base-ro. The first two models resulted from the individual distillation of knowledge from two base versions of Romanian BERTs available in literature, while the last one was obtained by distilling their ensemble. To our knowledge, this is the first attempt to create publicly available Romanian distilled BERT models, which were thoroughly evaluated on five tasks: part-of-speech tagging, named entity recognition, sentiment analysis, semantic textual similarity, and dialect identification. Our experimental results argue that the three distilled models offer performance comparable to their teachers, while being twice as fast on a GPU and ~35% smaller. In addition, we further test the similarity between the predictions of our students versus their teachers by measuring their label and probability loyalty, together with regression loyalty - a new metric introduced in this work.
Motivation & Objective
- To address the lack of efficient, lightweight BERT models for low-resource languages like Romanian.
- To reduce computational and environmental costs of large pre-trained models in real-world NLP applications.
- To evaluate distilled models on diverse Romanian NLP tasks, including low-resource scenarios like dialect identification.
- To introduce and validate new loyalty metrics—label, probability, and regression loyalty—to measure prediction similarity between teacher and student models.
- To open-source the distilled models and training scripts to improve reproducibility and community adoption.
Proposed method
- Knowledge distillation is applied to train smaller student models using soft labels from larger teacher models (BERT-base-ro and RoBERT-base).
- Three student models are created: one from each teacher individually, and a third from an ensemble of both teachers using a combined training corpus and BERT-base-ro tokenizer.
- The distillation process minimizes cross-entropy loss between teacher and student logits, using temperature scaling to improve soft label transfer.
- Prediction fidelity is evaluated using three loyalty metrics: label loyalty (accuracy of student predictions matching teacher labels), probability loyalty (Kullback-Leibler divergence between output distributions), and regression loyalty (Pearson correlation for regression tasks).
- Inference speed is measured on CPU and GPU across sequence lengths from 16 to 512 tokens, comparing distilled models to base, small, and large variants.
- All models are evaluated on five Romanian NLP tasks: POS tagging, NER, sentiment analysis, dialect identification, and semantic textual similarity.
Experimental results
Research questions
- RQ1Can knowledge distillation effectively compress Romanian BERT models while preserving performance on diverse NLP tasks?
- RQ2How does ensemble distillation from multiple Romanian BERT teachers compare to single-teacher distillation in terms of student performance and generalization?
- RQ3To what extent do distilled models maintain prediction consistency with their teachers, as measured by label, probability, and regression loyalty?
- RQ4How much faster are the distilled models compared to their teachers in inference speed, especially on GPU?
- RQ5Can distilled models outperform their teachers on specific low-resource NLP tasks, such as dialect identification?
Key findings
- Distil-BERT-base-ro achieved 74.76% F1 on dialect identification, outperforming the distilled ensemble model by 1.5%.
- The DistilMulti-BERT-base-ro model achieved the highest regression loyalty (94.64%) with its teachers, indicating strong output similarity in regression tasks.
- All distilled models were approximately 35% smaller and twice as fast as their teacher models on a GPU, with significant speedups on longer sequences.
- On average, distilled models maintained over 90% of the teacher model’s performance across all five evaluated tasks, with some tasks showing slight improvements.
- The distilled models outperformed both their teachers and other baseline models on several tasks, including sentiment analysis and semantic textual similarity.
- The inference speed on GPU was nearly double that of the base models, with the distilled models showing the best performance among all model sizes, especially for longer sequences.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.