Back to search

Nanyang Technological University

Demonstration example selection in large language model-based sentiment analysis

Abstract

dc:description.abstract

In-context learning (ICL) introduced a new paradigm for sentiment analysis, where models perform tasks not by parameter updates, but by conditioning on carefully crafted prompts with demonstration examples. This dissertation addresses the critical challenge of demonstration example selection for ICL in sentiment analysis tasks by proposing a novel selection framework named BSR-Cluster. This framework integrates BSR-based semantic similarity scoring with clustering-based diversity promotion to construct prompts that are both relevant and varied, thereby improving model performance. To verify the advantages of the new approach, we did some experiments on two benchmark datasets (SST-2 and IMDb) and three advanced LLMs (LLaMA, DeepSeek and Qwen). Comparative evaluations show that BSR-Cluster consistently outperforms traditional methods under few-shot prompting. Furthermore, ablation studies highlight the importance of label correctness and prompt coherence in ensuring stable model performance. The results of our research provide not only a practical solution for improving sentiment analysis tasks using ICL but also theoretical insights into the general principles of prompt design.

Degree

thesis:*
College dc:contributor.school
School of Electrical and Electronic Engineering
Grantor dc:publisher
Nanyang Technological University
Year dc:date.issued
2025

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Wang, Binyu
Advisor dc:contributor.supervisor
  • Mao Kezhi

Subjects

dc:subject × 1

Rights

Language dc:language.iso
en

Identifiers

dc:identifier.*
Handle dc:identifier.uri
https://hdl.handle.net/10356/200781

Chain of custody

source
Harvested from
Nanyang Technological University
Base URL
dr.ntu.edu.sg/oai/request
Last updated
2026-11-27
Source record
OAI-PMH GetRecord
related terms
citation

Wang, Binyu. Demonstration example selection in large language model-based sentiment analysis. Nanyang Technological University, 2025. https://hdl.handle.net/10356/200781