Skip to main content
QUICK REVIEW

[Paper Review] Revisiting Sentiment Analysis for Software Engineering in the Era of Large Language Models

Ting Zhang, Ivana Clairine Irsan|arXiv (Cornell University)|Oct 17, 2023
Topic ModelingComputer Science3 citations
TL;DR

This paper investigates the use of few-shot and zero-shot prompting with large language models (bLLMs) for sentiment analysis in software engineering, demonstrating that bLLMs outperform fine-tuned small language models (sLLMs) on low-resource, imbalanced datasets, while sLLMs remain superior when ample, balanced training data is available. The study evaluates three open-source bLLMs across five benchmark datasets, establishing bLLMs as a viable alternative for low-data SA4SE scenarios.

ABSTRACT

Software development involves collaborative interactions where stakeholders express opinions across various platforms. Recognizing the sentiments conveyed in these interactions is crucial for the effective development and ongoing maintenance of software systems. For software products, analyzing the sentiment of user feedback, e.g., reviews, comments, and forum posts can provide valuable insights into user satisfaction and areas for improvement. This can guide the development of future updates and features. However, accurately identifying sentiments in software engineering datasets remains challenging. This study investigates bigger large language models (bLLMs) in addressing the labeled data shortage that hampers fine-tuned smaller large language models (sLLMs) in software engineering tasks. We conduct a comprehensive empirical study using five established datasets to assess three open-source bLLMs in zero-shot and few-shot scenarios. Additionally, we compare them with fine-tuned sLLMs, using sLLMs to learn contextual embeddings of text from software platforms. Our experimental findings demonstrate that bLLMs exhibit state-of-the-art performance on datasets marked by limited training data and imbalanced distributions. bLLMs can also achieve excellent performance under a zero-shot setting. However, when ample training data is available or the dataset exhibits a more balanced distribution, fine-tuned sLLMs can still achieve superior results.

Motivation & Objective

  • To evaluate the effectiveness of large language models (bLLMs) in sentiment analysis for software engineering (SA4SE) under low-resource and imbalanced data conditions.
  • To compare the performance of few-shot and zero-shot prompting with bLLMs against fine-tuned small language models (sLLMs) in SA4SE tasks.
  • To investigate the generalization capability of bLLMs across different SE datasets, especially in cross-platform settings.
  • To determine the conditions under which bLLMs outperform sLLMs in SA4SE, particularly regarding data availability and class distribution.
  • To provide empirical evidence on the viability of in-context learning with bLLMs as an alternative to fine-tuning sLLMs in SA4SE.

Proposed method

  • The study employs three open-source bLLMs in both zero-shot and few-shot prompting configurations for sentiment classification on five benchmark SE datasets.
  • For zero-shot, the models are prompted with natural language instructions describing the sentiment classification task without any labeled examples.
  • For few-shot, the models are provided with a few labeled examples (few-shot demonstrations) in the prompt to guide classification.
  • The performance of bLLMs is compared against fine-tuned sLLMs, which are fine-tuned on the same training data using standard fine-tuning procedures.
  • The evaluation uses standard metrics such as macro-F1 and micro-F1 across multiple datasets with varying data scarcity and class imbalance.
  • The study conducts ablation studies to analyze the impact of prompt design, few-shot example selection, and dataset characteristics on model performance.

Experimental results

Research questions

  • RQ1Can large language models (bLLMs) achieve state-of-the-art performance in sentiment analysis for software engineering (SA4SE) without fine-tuning, particularly in low-resource settings?
  • RQ2How does the performance of bLLMs compare to fine-tuned small language models (sLLMs) when training data is limited or class-imbalanced?
  • RQ3Does in-context learning via prompting with bLLMs generalize effectively across different SE datasets and platforms?
  • RQ4Under what data conditions (e.g., data scarcity, class imbalance) do bLLMs outperform sLLMs in SA4SE tasks?
  • RQ5Can zero-shot prompting with bLLMs serve as a viable alternative to fine-tuning sLLMs in SA4SE, especially when labeled data is scarce?

Key findings

  • bLLMs achieve state-of-the-art performance on datasets with limited training data and imbalanced class distributions, outperforming fine-tuned sLLMs in such settings.
  • In zero-shot scenarios, bLLMs demonstrate strong generalization, achieving high performance without any labeled examples, indicating the effectiveness of in-context learning.
  • When sufficient and balanced training data is available, fine-tuned sLLMs still achieve superior performance compared to prompting bLLMs.
  • The performance of bLLMs is sensitive to prompt design and few-shot example selection, with optimal examples significantly improving results.
  • bLLMs show better cross-platform generalization than sLLMs, suggesting their robustness across diverse SE text sources.
  • The study confirms that in-context learning with bLLMs is a viable, data-efficient alternative to fine-tuning sLLMs, especially in low-data regimes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.