Comparative Study and Analysis of the Performance of Locally Fine-Tuned DistilBERT and Mainstream Large-Scale Language Models in Text Sentiment Classification Tasks
Abstract
This research compares two commonly used Natural Language Processing (NLP) techniques, enabling each of them to identify the sentiment contained in text and categorize it into one of three categories. One is the DistilBERT model trained on local machines, which is built on the Transformers architecture. The other includes three currently mainstream large language model in China, which are Zhipu GLM-4, Doubao-seed-1.6-Flash and DeepSeek-V3.1. The data used in this research is sourced from a public dataset available on Kaggle. The four models were placed on the same set of experimental corpora, with accuracy values, weighted F1-scores and inference time collected respectively, and the errors they would make were observed. The results show that the lightweight model DistilBERT achieves the highest accuracy and the fastest inference speed. However, it relies heavily on keywords and struggles to handle complex contexts. GLM-4 demonstrates deeper context understanding, but it makes misjudgments in cases of emotional conflicts and implicit expression. The Doubao-seed-1.6-Flash and DeepSeek-V3.1 models exhibit a conservative tendency, which means that when faced with ambiguous information, the two models tend to lean toward neutral judgments. This tendency comes at the cost of recall. Therefore, the selection of models needs to be closely aligned with the specific requirements of application scenarios for speed, cost, precision, and recall, so as to achieve optimal performance.
References
- Das, A., Sharif, O., Hoque, M. M., et al. (2021). Emotion classification in a resource constrained language using transformer-based approach. arXiv preprint arXiv: 2104.08613.
- Li, C., Wang, J., Zhang, Y., et al. (2023). Large language models understand and can be enhanced by emotional stimuli. arXiv preprint arXiv: 2307.11760.
- Wang, Z., Pang, Y., Lin, Y. (2023). Large language models are zero-shot text classifiers. arXiv preprint arXiv: 2312.01044.
- Li, Z., Zhu, H., Lu, Z., et al. (2023). Synthetic data generation with large language models for text classification: Potential and limitations. arXiv preprint arXiv: 2310.07849.
- Almalki, S. S. (2025). Sentiment Analysis and Emotion Detection Using Transformer Models in Multilingual Social Media Data. International Journal of Advanced Computer Science & Applications, 16(3).
- Chen, L., Zaharia, M., Zou, J. (2023). Frugalgpt: How to use large language models while reducing cost and improving performance. arXiv preprint arXiv: 2305.05176.
- Zhu, L., Zhu, Z., Zhang, C., et al. (2023). Multimodal sentiment analysis based on fusion methods: A survey. Information Fusion, 95: 306-325.
- Wankhade, M., Rao, A. C. S., Kulkarni, C. (2022). A survey on sentiment analysis methods, applications, and challenges. Artificial Intelligence Review, 55(7): 5731-5780.
- Schaeffer, R., Miranda, B., Koyejo, S. (2023). Are emergent abilities of large language models a mirage?. Advances in neural information processing systems, 36: 55565-55581.
- Bender, E. M., Gebru, T., McMillan-Major, A., et al. (2021). On the dangers of stochastic parrots: Can language models be too big?//Proceedings of the 2021 ACM conference on fairness, accountability, and transparency. 610-623.