Less is More: Adaptive Prompt Compression and Exemplar Selection for Efficient Few-Shot Sentiment Analysis

Abstract

Few-shot sentiment analysis remains challenging due to limited labeled data and inefficient prompt design for large language models (LLMs). Existing prompting methods often rely on static exemplars and verbose inputs, leading to redundant tokens, higher inference cost, and limited generalization. Moreover, prior work typically improves exemplar selection or prompt compression in isolation, without explicitly balancing predictive accuracy and token efficiency under resource constraints. This study addresses two key challenges:(1) how to adaptively select semantically diverse and task-relevant exemplars, and (2) how to compress prompts while preserving sentiment-critical information under realistic resource constraints. We propose SRC3, a unified closed-loop prompt optimization framework that integrates Semantic embedding clustering, Reward-guided adaptive exemplar memory, and ClarityCore Compression prompting into a cost-aware inference-time policy for black-box LLMs. The semantic clustering module selects diverse exemplars by reweighting embeddings via uncertainty and novelty. The rewardguided exemplar mechanism updates exemplar utility through temporally smoothed feedback. ClarityCore applies deterministic TF-IDFbased compression to preserve sentiment-relevant cues while exposing a measurable compression ratio, which is incorporated into a reinforcement-inspired cost-aware objective. This coupling forms a feedback loop linking exemplar diversity, compression control, and reward optimization. Experiments on six benchmark sentiment datasets show that SR-C3 consistently improves accuracy while reducing latency and token cost, achieving superior performance–efficiency trade-offs over existing prompting baselines. These results position SR-C3 as a scalable and adaptive framework for resource-constrained few-shot sentiment analysis.

Publication
Expert Systems With Applications
Yongkang Li
Yongkang Li
PhD Student

I am currently a PhD student in IR LAB, the University of Amsterdam, working with Prof. Evangelos Kanoulas. Before that, I got my master degree at Southern University of Science and Technology, Department of Computer Science and Engineering, SUSTech-UTokyo Joint Research Center on Super Smart City Lab, where I am supervised by Prof. Xuan Song in SUSTech and Prof. Zipei Fan at the University of Tokyo. What’s more, I received a B.E. degree in the School of Information and Communication Engineering, Beijing University of Posts and Telecommunications in 2020.