[Paper Review] Transformer to CNN: Label-scarce distillation for efficient text classification
This paper proposes a knowledge distillation framework that trains a lightweight, efficient Convolutional Neural Network (BlendCNN) as a student model using logits from a large pre-trained Transformer (OpenAI GPT) as a teacher. Despite having 39× fewer parameters and 300× faster inference, the student model surpasses the teacher on multiple text classification benchmarks under label-scarce conditions, demonstrating that distilled CNNs can outperform large attention-based models when properly designed for hierarchical representation learning.
Significant advances have been made in Natural Language Processing (NLP) modelling since the beginning of 2018. The new approaches allow for accurate results, even when there is little labelled data, because these NLP models can benefit from training on both task-agnostic and task-specific unlabelled data. However, these advantages come with significant size and computational costs. This workshop paper outlines how our proposed convolutional student architecture, having been trained by a distillation process from a large-scale model, can achieve 300x inference speedup and 39x reduction in parameter count. In some cases, the student model performance surpasses its teacher on the studied tasks.
Motivation & Objective
- To address the high computational and memory costs of large pre-trained Transformer models in industrial NLP applications.
- To explore whether a lightweight CNN-based student model can match or exceed the performance of a large, pre-trained Transformer teacher under label-scarce conditions.
- To investigate the effectiveness of distillation using pseudo-labeled unlabelled data to improve student model generalization with limited annotated examples.
- To design a novel CNN architecture (BlendCNN) that effectively captures hierarchical representations from distilled logits for improved text classification.
Proposed method
- A pre-trained OpenAI Transformer model serves as the teacher, fine-tuned on task-specific data and used to generate soft labels (logits) for both labeled and unlabelled data.
- A novel CNN architecture, BlendCNN, is designed with multiple parallel convolutional branches, each pooling from different layers, followed by concatenation and a dense blending layer.
- The student model is trained via knowledge distillation using Mean Absolute Error (MAE) loss between the student's and teacher's logits on both labeled and pseudo-labeled unlabelled examples.
- Transfer learning is applied using 100-dimensional trainable GloVe embeddings as input features to the student model.
- Distillation is performed with 100 labeled examples per class and 1,000 unlabelled examples, using pseudo-labelling to generate additional training signals.
- Model training uses Adam optimization with a fixed initial learning rate of 10⁻³ across all experiments.
Experimental results
Research questions
- RQ1Can a lightweight CNN-based student model achieve performance comparable to or better than a large pre-trained Transformer under label-scarce conditions?
- RQ2To what extent does knowledge distillation from a powerful teacher model improve the accuracy of a small student network when only a few labeled examples are available?
- RQ3How effective is the use of pseudo-labeled unlabelled data in enhancing the distillation process for low-resource text classification?
- RQ4Can a specially designed CNN architecture like BlendCNN effectively leverage hierarchical representations from distilled logits to surpass larger models?
Key findings
- The 3-layer BlendCNN student model achieved 91.2% accuracy on AG News, outperforming the OpenAI Transformer teacher (88.7%) when trained via distillation.
- On the DBpedia dataset, the 8-layer BlendCNN reached 98.5% accuracy, surpassing the teacher's 97.5% under the same distillation protocol.
- The 3-layer BlendCNN achieved 71.0% accuracy on Yahoo Answers, slightly exceeding the teacher's 70.4% performance.
- Despite outperforming the teacher, the 3-layer BlendCNN model has 39× fewer parameters (2.98M vs. 116.5M) and 300× faster inference (3,676 sentences/sec vs. 11.76 sentences/sec).
- The performance gain from distillation is significant: without distillation, the BlendCNN model scored only 87.6% on AG News, indicating that distillation is critical for high performance.
- Including unlabelled data in the distillation process significantly improves student performance, as shown by the higher scores when pseudo-labelling is used compared to training only on labeled data.
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.