Augmenting Sentiment Analysis with a Hierarchical Pre-Attention Framework and Strategic LLM Fine-Tuning
Source abstract
Abstract
Sentiment analysis is significant for exploiting countless opinion-rich data from social media. However, it faces known challenges, such as informal expression and data sparsity. While large language models (LLMs) excel at dynamic contextual disambiguation, such deep learning models neglect to leverage prior knowledge calculated statistically and globally based on dataset-wide category tendencies to guide the encoding process. To overcome these challenges, this study proposes a pre-attention framework that includes a modified gated recurrent unit hierarchically integrated with a dual-level pre-attention mechanism (PA-GRU) and an LLM-PA-GRU model equipped with a strategic LLM fine-tuning method. The pre-attention mechanism extracts inter-category and intra-text statistical priors from the training set. Trainable coefficient matrices are proposed to adaptively fuse these priors within a unified formulation, enabling flexible allocation of global and local statistical signals. The proposed PA-GRU cell features a modified gating structure and a computation flow that integrates these extracted priors as explicit statistical anchors during sequence encoding. Moreover, we implement an LLM-PA-GRU model that connects the LLM’s deep feature representations to the PA-GRU. This strategic LLM fine-tuning approach is intended to mitigate gradient instability frequently encountered in models with heterogeneous architectures. Finally, a prototype-based alignment loss is employed to enforce feature consistency across modules. Extensive experiments on benchmark datasets demonstrate that the proposed approach achieves competitive performance compared with recent literature-reported models.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Sentiment Analysis and Opinion Mining · Mental Health via Writing · Computational and Text Analysis Methods
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
School of Computer and Information Engineering, Shanghai Polytechnic University, Shanghai 201209, China
Academy of Basic Education Development, Shanghai Normal University, Shanghai 200233, China
Funding
Research Base of Online Education for Shanghai Middle and Primary Schools
References (40)
Show source-provided references
1. Lee, Y., Chen, A.S., Tajwar, F., Kumar, A., Yao, H., Liang, P., and Finn, C. (2023, January 1–5). Surgical Fine-Tuning Improves Adaptation to Distribution Shifts. Proceedings of the 10th International Conference on Learning Representations (ICLR), Kigali, Rwanda.
2. Topic Modeling of Short Texts: A Pseudo-Document View With Word Embedding Enhancement
3. A Machine Learning-Based Technique with Intelligent WordNet Lemmatizer for Twitter Sentiment Analysis10.32604/iasc.2023.031987 ↗
4. Kim, H., and Jeong, Y.S. (2019). Sentiment classification using convolutional neural networks. Appl. Sci., 9.10.3390/app9112347 ↗
5. Sentiment classification using a single-layered bilstm model10.1109/ACCESS.2020.2988550 ↗
6. Sentiment analysis using stacked gated recurrent unit for arabic tweets10.1109/ACCESS.2021.3114313 ↗
7. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A., Kaiser, L., and Polosukhin, I. (2017, January 4–9). Attention is all you need. Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA.
8. Enhancing sentiment analysis of online comments: A novel approach integrating topic modeling and deep learning10.7717/peerj-cs.2542 ↗
9. Patil, R., Khot, P., and Gudivada, V. (2025). Analyzing LLAMA3 performance on classification task using LoRA and QLoRA techniques. Appl. Sci., 15.10.3390/app15063087 ↗
10. Parameter-efficient transfer learning for medical visual question answering10.1109/TETCI.2023.3311333 ↗
11. Zhang, X., Wu, Z., Liu, K., Zhao, Z., Wang, J., and Wu, C. (2023). Text sentiment classification based on BERT embedding and sliced multi-head self-attention Bi-GRU. Sensors, 23.10.3390/s23031481 ↗
12. Su, B., and Peng, J. (2023). Sentiment analysis of comment texts on online courses based on hierarchical attention mechanism. Appl. Sci., 13.10.3390/app13074204 ↗
13. Attention-based convolution bidirectional recurrent neural network for sentiment analysis10.4018/IJDSST.300368 ↗
14. Hierarchical neural network with serial attention mechanism for review sentiment classification10.1007/s11063-023-11308-y ↗
15. Feng, Y., and Wei, R. (2024). Method of multi-label visual emotion recognition fusing fore-background features. Appl. Sci., 14.10.21203/rs.3.rs-4752870/v1 ↗
16. A text sentiment classification model using double word embedding methods10.1007/s11042-020-09846-x ↗
17. Suicide ideation detection based on documents dimensionality expansion10.1016/j.compbiomed.2025.110266 ↗
18. Degife, W.A., and Lin, B.S. (2024). A multi-aspect informed GRU: A hybrid model of flight fare forecasting with sentiment analysis. Appl. Sci., 14.10.3390/app14104221 ↗
19. Decoding violence against women: Analysing harassment in middle eastern literature with machine learning and sentiment analysis10.1057/s41599-024-02908-7 ↗
20. A CTO-based GRU model for identifying emotions from textual data10.1007/s10115-025-02354-0 ↗
21. Rusyn, V., Boichuk, A., and Mochurad, L. (2025). Cross-language transfer-learning approach via a pretrained Preact ResNet-18 architecture for improving kanji recognition accuracy and enhancing a number of recognizable kanji. Appl. Sci., 15.10.3390/app15094894 ↗
22. DeepSeek-AI (2026, April 13). DeepSeek-LLM-7B-Base. Available online: https://huggingface.co/deepseek-ai/deepseek-llm-7b-base.
23. Almeida, T., Hidalgo, J., and Yamakami, A. (2011, January 19–22). Contributions to the study of SMS spam filtering: New collection and results. Proceedings of the 11th ACM Symposium on Document Engineering, Mountain View, CA, USA.10.1145/2034691.2034742 ↗
24. Pang, B., and Lee, L. (2005, January 25–30). Seeing stars: Exploiting class relationships for sentiment categorization with respect to rating scales. Proceedings of the 43rd Annual Meeting on Association for Computational Linguistics, Ann Arbor, MI, USA.10.3115/1219840.1219855 ↗
25. Hu, M., and Liu, B. (2004, January 22–25). Mining and summarizing customer reviews. Proceedings of the Tenth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, Seattle, WA, USA.10.1145/1014052.1014073 ↗
26. Pang, B., and Lee, L. (2004, January 21–26). A sentimental education: Sentiment analysis using subjectivity summarization based on minimum cuts. Proceedings of the 42nd Annual Meeting of the Association for Computational Linguistics (ACL-04), Barcelona, Spain.10.3115/1218955.1218990 ↗
27. Challenges and Issues in Sentiment Analysis: A Comprehensive Survey10.1109/ACCESS.2023.3293041 ↗
28. Hossain, S., Sumon, J., Sen, A., Alam, M., Kamal, K., Alqahtani, H., and Sarker, I. (2021). Spam filtering of mobile SMS using CNN-LSTM based deep learning model. Proceedings of the International Conference on Hybrid Intelligent Systems, Springer.10.1007/978-3-030-96305-7_10 ↗
29. Wei, F., and Nguyen, T. (2020). A lightweight deep neural model for sms spam detection. Proceedings of the 2020 International Symposium on Networks, Computers and Communications (ISNCC), IEEE.10.1109/ISNCC49221.2020.9297350 ↗
30. Kumar, A., and Rastogi, R. (2019). Attentional recurrent neural networks for sentence classification. Proceedings of the Innovations in Infrastructure: Proceedings of ICIIF 2018, Springer.10.1007/978-981-13-1966-2_49 ↗
31. Altunay, H., and Albayrak, Z. (2024). SMS spam detection system based on deep learning architectures for Turkish and English messages. Appl. Sci., 14.10.3390/app142411804 ↗
32. Modified genetic algorithm for feature selection and hyper-parameter optimization: Case of XGBoost in spam prediction10.1109/ACCESS.2022.3196905 ↗
33. Ghourabi, A., and Alohaly, M. (2023). Enhancing spam message classification and detection using transformer-based embedding and ensemble learning. Sensors, 23.10.3390/s23083861 ↗
34. Bidirectional convolutional recurrent neural network architecture with group-wise enhancement mechanism for text sentiment classification10.1016/j.jksuci.2022.02.025 ↗
35. Klein, T., and Nabi, M. (2022). SCD: Self-contrastive decorrelation for sentence embeddings. Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), Association for Computational Linguistics.10.18653/v1/2022.acl-short.44 ↗
36. High performing sentiment analysis based on fast Fourier transform over temporal intuitionistic fuzzy value10.1007/s00500-021-06444-3 ↗
37. Khan, J., Ahmad, N., Lee, Y., Khalid, S., and Hussain, D. (2025). Hybrid Deep Neural Network with Domain Knowledge for Text Sentiment Analysis. Mathematics, 13.10.3390/math13091456 ↗
38. Gong, J., Zhang, J., Guo, W., Ma, Z., and Lv, X. (2023). Short text classification based on explicit and implicit multiscale weighted semantic information. Symmetry, 15.10.3390/sym15112008 ↗
39. Two end-to-end quantum-inspired deep neural networks for text classification10.1109/TKDE.2021.3130598 ↗
40. Pretrained quantum-inspired deep neural network for natural language processing10.1109/TCYB.2024.3398692 ↗