Comparing Transformer Architectures for Sentiment Analysis: A Study of BERT, GPT, and T5

  • Unique Paper ID: 167124
  • PageNo: 394-399
  • Abstract:
  • In recent years, the transformer models have restructured the natural language processing (NLP) field, setting some new benchmarks in various fields, including sentiment analysis. This study provides a complete comparison of three transformer architectures: BERT (Bidirectional Encoder Representations from Transformers), GPT (Generative Pre-trained Transformer), and T5 (Text-To-Text Transfer Transformer), specifically in the context of sentiment analysis. I have Used the IMDb movie reviews dataset to fine-tuned and evaluated each of the model based on the key performance metrics such as accuracy, training time, inference time, and memory usage. My findings show that while BERT achieves the highest accuracy of 90%, it also requires very significant computational resources, a training time of 3 hours and memory usage of 10 GB. T5, despite its competitive accuracy of 87%, demands the most extensive resources, which includes 4 hours of training time and 12 GB of memory. While the GPT offers a balanced result with the fastest training time of 2.5 hours and lowest memory consumption of 8 GB, with a slightly lower accuracy of 85%. This comparative analysis provides us valuable insights for selecting appropriate transformer models for sentiment analysis tasks, considering the comparison between accuracy, efficiency, and resource requirements.

Copyright & License

Copyright © 2026 Authors retain the copyright of this article. This article is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

BibTeX

@article{167124,
        author = {Utkarsh Singh and Paridhi },
        title = {Comparing Transformer Architectures for Sentiment Analysis: A Study of BERT, GPT, and T5},
        journal = {International Journal of Innovative Research in Technology},
        year = {2024},
        volume = {11},
        number = {3},
        pages = {394-399},
        issn = {2349-6002},
        url = {https://ijirt.org/article?manuscript=167124},
        abstract = {In recent years, the transformer models have restructured the natural language processing (NLP) field, setting some new benchmarks in various fields, including sentiment analysis. This study provides a complete comparison of three transformer architectures: BERT (Bidirectional Encoder Representations from Transformers), GPT (Generative Pre-trained Transformer), and T5 (Text-To-Text Transfer Transformer), specifically in the context of sentiment analysis. I have Used the IMDb movie reviews dataset to fine-tuned and evaluated each of the  model based on the  key performance metrics such as accuracy, training time, inference time, and memory usage. My findings show that while BERT achieves the highest accuracy of 90%, it also requires very significant computational resources, a training time of 3 hours and memory usage of 10 GB. T5, despite its competitive accuracy of 87%, demands the most extensive resources, which includes 4 hours of training time and 12 GB of memory. While the  GPT offers a balanced result with the fastest training time of 2.5 hours and lowest memory consumption of 8 GB, with a slightly lower accuracy of 85%. This comparative analysis provides us valuable insights for selecting appropriate transformer models for sentiment analysis tasks, considering the comparison between accuracy, efficiency, and resource requirements.},
        keywords = {},
        month = {August},
        }

Cite This Article

Singh, U., & Paridhi, (2024). Comparing Transformer Architectures for Sentiment Analysis: A Study of BERT, GPT, and T5. International Journal of Innovative Research in Technology (IJIRT), 11(3), 394–399.

Related Articles