An experimental investigation into the relationship between labeled training data availability and pretrained transformer performance in sentiment classification.
Acquiring large quantities of labeled data is expensive and time-consuming. This project investigates how effectively pretrained language models can adapt to downstream classification tasks under limited training-data conditions.
How does the availability of labeled training data affect the classification performance and computational efficiency of DistilBERT?
- Model: DistilBERT Base Uncased
- Dataset: Stanford IMDb Movie Reviews
- Task: Binary sentiment classification
- Training sizes: 250, 1,000 and 3,000 samples
- Testing samples: 1,000
- Training epochs: 1
- Learning rate: 2e-5
- Batch size: 32
- Random seed: 42
- Maximum sequence length: 128 tokens
- Evaluation metrics: Accuracy, F1 score and execution time
| Training Samples | Accuracy | F1 Score | Execution Time |
|---|---|---|---|
| 250 | 51.50% | 1.62% | 6.12s |
| 1,000 | 64.90% | 52.11% | 7.83s |
| 3,000 | 82.80% | 82.90% | 16.26s |
- Increasing the training dataset from 250 to 3,000 samples improved accuracy by 31.3 percentage points.
- DistilBERT achieved 82.8% accuracy and an F1 score of 82.9% using 3,000 training examples.
- Extremely limited training data resulted in poor positive-class F1 performance.
- Increasing training data improved classification performance while increasing computational execution time.
The project includes a confusion matrix and misclassified review examples from the model trained on 3,000 samples to support qualitative investigation of model weaknesses.
- Python
- PyTorch
- Hugging Face Transformers
- Hugging Face Datasets
- Scikit-learn
- NumPy
- Pandas
- Matplotlib
- Google Colab
- Low-resource natural language processing
- Customer feedback classification
- Automated sentiment analysis
- Resource-efficient machine learning
- Social media opinion analysis
- Experiments use a single random seed.
- Models are trained for only one epoch.
- Evaluation uses a subset of the original IMDb test dataset.
- Input reviews are truncated to 128 tokens.
- Larger training datasets receive more optimization steps.
- Investigate performance across multiple random seeds.
- Compare DistilBERT with BERT and RoBERTa.
- Evaluate class-specific precision and recall.
- Investigate active learning for efficient sample selection.
- Compare models under equal computational budgets.
- Evaluate generalization across different datasets.
The experimental results demonstrate that labeled training data availability substantially influences DistilBERT's downstream classification performance. Although pretrained transformers provide a strong foundation for transfer learning, extremely limited training data can lead to poor classification performance. The findings motivate further investigation into data-efficient learning strategies.


