Investigating the Impact of Parameter Variations of Transformer Models on Sentiment Classification

Authors

  • Peng Chen

DOI:

https://doi.org/10.54097/qah1rn94

Keywords:

Transformer, Sentiment classification, deep learning.

Abstract

With the development of the Internet, an increasing number of applications and websites appearing on the Internet allow movie viewers to add comments for movies. If people want to know what per cent of comments are positive or negative, it will cost a large amount human resources and time to check each comment. However, with the help of the transformer model, it will save a large number of human resources and time to finish sentiment classification for long movie comments. The dataset ‘IMDb’ used to train the transformer model is a large Movie Review Dataset for binary sentiment classification of movie reviews. Furthermore, since sentiment classification for movie comments does not require the decoder in the transformer model to predict the next token, the transformer model only need to preserve the part of Positional Encoding, Encoder and Multi-head self-attention mechanism. This paper will investigate how three parameters (the number of layers in encoder, the amount of heads in multi-head self-attention, expansion factor in position-wise fully connected feed-forward network) affect the performance of the transformer model and which set of parameters could allow the transformer to have the best performance. After researching on three parameters, the transformer model used to do sentiment classification for movie comments has the best performance when there are sixteen heads in multi-head self-attention mechanism, four layers in Encoder, and expansion factor in feed-forward network which is position-wise fully connected is four.

Downloads

Download data is not yet available.

References

[1] Yuhang Qiu, Yunze Hui, Pengxiang Zhao, Cheng-Hao Cai, Baiqian Dai, Jinxiao Dou, Sankar Bhattacharya, Jianglong Yu. 2024. A novel image expression-driven modeling strategy for coke quality prediction in the smart cokemaking process. Energy, 294: 130866.

[2] Binyang Song, Rui Zhou, Faez Ahmed. 2024. Multi-modal machine learning in engineering design: A review and future directions. Journal of Computing and Information Science in Engineering, 24(1): 010801.

[3] Kashif Shaheed, Piotr Szczuko, Munish Kumar, Imran Qureshi, Qaisar Abbas, Ihsan Ullah. 2024. Deep learning techniques for biometric security: A systematic review of presentation attack detection systems. Engineering Applications of Artificial Intelligence, 129: 107569.

[4] Yuhang Qiu, Jiping Wang, Zhe Jin, Honghui Chen, Mingliang Zhang, Liquan Guo. 2022. Pose-guided matching based on deep learning for assessing quality of action on rehabilitation training. Biomedical Signal Processing and Control, 72: 103323.

[5] Allard W. Olthof, Peter M.A. van Ooijen, Ludo J. Cornelissen. 2021. Deep learning-based natural language processing in radiology: the impact of report complexity, disease prevalence, dataset size, and algorithm type on model performance. Journal of Medical Systems, 45(10): 91.

[6] Qianzi Shen, Zijian Wang, Yaoru Sun. 2017. Sentiment analysis of movie reviews based on CNN-BLSTM. In Intelligence Science I: Second IFIP TC 12 International Conference, ICIS 2017, Shanghai, China, October 25-28, 2017, Proceedings 2, Springer International Publishing, 164-171.

[7] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, Illia Polosukhin. 2017. Attention is all you need. Advances in Neural Information Processing Systems, 30.

[8] Stanford NLP. 2024. STANFORDNLP/Imdb Datasets at Hugging Face. Available: https://huggingface.co/datasets/stanfordnlp/imdb

[9] Kwangjun Ahn, Zhiyu Zhang, Yunbum Kook, Yan Dai. 2024. Understanding Adam optimizer via online learning of updates: Adam is FTRL in disguise. arXiv preprint arXiv:2402.01567.

[10] Sebastian Bock, Martin Weiß. 2019. A proof of local convergence for the Adam optimizer. In 2019 International Joint Conference on Neural Networks (IJCNN), IEEE, 1-8.

Downloads

Published

18-02-2025

How to Cite

Chen, P. (2025). Investigating the Impact of Parameter Variations of Transformer Models on Sentiment Classification. Highlights in Science, Engineering and Technology, 124, 176-182. https://doi.org/10.54097/qah1rn94