Sentiment Analysis with Deep Learning: Benchmarking CNNs vs. Prompt-Tuned BERT Models

Bo Huang, Fei SongJournal of Advances in Information Technology 2025

Abstract

This paper presents a comprehensive benchmarking study comparing traditional Convolutional Neural Networks (CNNs) against modern prompt-tuned Transformer models, specifically BERT and RoBERTa, for sentiment analysis tasks. The researchers investigate whether prompt-based learning—reframing classification as a "fill-in-the-blank" task—can more effectively leverage the pre-trained linguistic knowledge of Large Language Models (LLMs) compared to standard fine-tuning. The study demonstrates that hybrid prompting strategies, which combine human-designed templates with adaptive, machine-learned "soft" prompts, consistently outperform both standard CNNs and basic BERT fine-tuning across diverse datasets ranging from short tweets to long-form reviews.

Introduction

While Deep Learning has fundamentally transformed sentiment analysis, practitioners often face a trade-off between "lightweight" architectures like CNNs and "heavyweight" Transformers like BERT. Standard approaches to using BERT typically involve adding a classification head and fine-tuning the entire model. However, this method often fails to fully capture the model's latent pre-trained knowledge.

This research addresses this gap by exploring prompt-based learning. By converting a sentiment classification task into a natural language prompt (e.g., "The movie was [MASK]"), the model can utilize its original pre-training objective to predict the sentiment. The authors specifically examine how dataset characteristics—such as text length, class imbalance, and linguistic complexity—influence the performance of various model architectures and prompting strategies.

Methodology

The study evaluates ten distinct model configurations to identify the most effective approach for sentiment classification. These include:

  • CNN Variants: Three versions (Random, Static, and Non-Static) based on the Kim (2014) architecture. The "Non-Static" version is notable for allowing word embeddings to be fine-tuned during the training process.
  • BERT/RoBERTa Baselines: Standard Transformer models utilized without any prompting mechanisms.
  • Hand-crafted Prompts: Manual templates such as "It is [MASK]" or "The sentiment is [MASK]."
  • Adaptive Prompting: A novel approach where a separate module (either an LSTM or a GRU with Attention) dynamically generates "soft" prompt tokens based on the semantic content of the input text.
  • Hybrid Prompting: The most sophisticated approach in the study, which prepends a fixed manual template to the input and then injects adaptive soft tokens generated by a GRU-Attention (GRU_ATT) module.
Mapping of prompt generation methods to BERT/RoBERTa variants.

The core mechanism of prompt-based learning involves passing the input through a word embedding layer, incorporating the prompt tokens, and then utilizing a pre-trained LLM to predict the most likely word for the [MASK] token, which is then mapped to a sentiment class.

Workflow of prompt-based learning using a masked language model.

Experimental Setup and Datasets

To ensure a robust comparison, the models were benchmarked across five datasets representing different linguistic styles and complexities:

  1. SST2: Formal, single-sentence movie reviews.
  2. Sentiment140 (Tweets): Short, informal, and noisy social media text.
  3. IMDB: Long, multi-sentence movie reviews (averaging 233 words).
  4. Amazon Subscription Boxes: Mid-sized, moderately imbalanced product reviews.
  5. Amazon Digital Music: Highly imbalanced (92.5% positive) and long reviews.

Key Insights and Results

The Power of Adaptivity

The study found that static prompts are often too rigid to capture the nuances of diverse text. The "aha moment" of the research was the effectiveness of the GRU with Attention mechanism. By "learning" a unique prompt for each specific sentence, the model can focus on critical sentiment cues—such as negations or specific adjectives—that a fixed template might overlook.

Performance Benchmarks

  • Top Performer: The Hybrid GRU_ATT BERT/RoBERTa models consistently achieved the highest scores. On the SST2 dataset, the Hybrid GRU_ATT RoBERTa reached an accuracy of 94.23%.
  • CNN vs. BERT: Even the most optimized CNN variant (Non-Static) generally trailed the hybrid BERT models by a wide margin, typically scoring around 86% on datasets where hybrid Transformers exceeded 92%.
  • Context and Length: On long-form text like the IMDB dataset, adaptive prompting boosted BERT's accuracy by over 12% compared to the no-prompt baseline, suggesting that adaptive modules are particularly effective at navigating complex, multi-sentence sentiment.

Sample Efficiency and Rigor

Prompt-based BERT models demonstrated significantly higher sample efficiency than CNNs. While CNNs required large amounts of data to improve, prompt-tuned Transformers achieved near-peak performance even with smaller data subsets. Furthermore, the study utilized 95% Confidence Intervals to confirm that the performance gains of the hybrid models were statistically significant.

Conclusion and Future Work

The research concludes that hybrid prompt-based learning is a superior method for sentiment analysis, offering a robust balance between the structural guidance of human templates and the flexibility of machine-learned tokens. While these models involve higher computational overhead than simple CNNs, their accuracy and sample efficiency make them ideal for complex NLP tasks.

Future research directions include extending this benchmarking to even larger models such as GPT-4 and LLaMA, exploring multilingual settings, and investigating multimodal sentiment analysis that combines text with visual or auditory data.

Summary updated

BibTeX
@article{huang2025sentiment,
  author = {Bo Huang and Fei Song},
  title = {{Sentiment Analysis with Deep Learning: Benchmarking CNNs vs. Prompt-Tuned BERT Models}},
  journal = {Journal of Advances in Information Technology},
  year = {2025},
  doi = {10.12720/jait.16.12.1793-1808},
}
Figure