Evaluating Large Language Models for Sentiment Analysis: A Comparative Study of Accuracy and Scalability
Sentiment analysis plays a crucial role in natural language processing (NLP) by enabling machines to interpret human emotions from text. With the advent of Large Language Models (LLMs), sentiment classification has gained renewed interest, as these models exhibit advanced contextual understanding and reasoning capabilities. This study evaluates the sentiment classification performance of state-of-the-art LLMs, including GPT-4o, GPT-3.5, DeepSeek R1-Reasoning, Llama 2-7B, and a taskspecific fine-tuned DistilBERT model. Using the IMDB dataset, we assess model accuracy across varying sample sizes (50 to 300) and compare their results to humanlabeled data. Our findings reveal that DeepSeek R1Reasoning outperforms all models, achieving an accuracy of 96%, while GPT-4o and GPT-3.5 closely follow with 93% accuracy. The fine-tuned DistilBERT model, despite being lightweight, delivers competitive performance (88%), making it a viable alternative for resource-constrained environments. In contrast, Llama 2-7B struggles with increasing dataset sizes, highlighting its limitations in generalization for sentiment classification. The comparison with human-labeled data (91% accuracy) further underscores the reliability of top-tier LLMs in replicating human judgment. These results demonstrate that reasoning-based LLMs like DeepSeek R1 can surpass conventional models in sentiment analysis, highlighting the value of integrating reasoning mechanisms into future NLP advancements.
Authors
- Rabab Alomairy (ORCID: https://orcid.org/0000-0001-9911-6094)
- Nouf Almontashry
- Siba Ziadi
- Khadeja Njaai
Institutions
- University of Jeddah (SA)
- Massachusetts Institute of Technology (US)
Publication Details
- Published
- 2025-05-26
- DOI
- https://doi.org/10.1109/ichms65439.2025.11154211
- Primary Topic
- Sentiment Analysis and Opinion Mining
- Type
- article
- Field-Weighted Citation Impact
- 0.00