Abstract
This study investigates the use of prompt engineering to enhance large language models (LLMs), specifically GPT-4o-mini and gemini-1.5-flash, in sentiment analysis tasks. It evaluates advanced prompting techniques like few-shot learning, chain-of-thought prompting, and self-consistency against a baseline. Key tasks include sentiment classification, aspect-based sentiment analysis, and detecting subtle nuances such as irony. The research details the theoretical background, datasets, and methods used, assessing performance of LLMs as measured by accuracy, recall, precision, and F1 score. Findings reveal that advanced prompting significantly improves sentiment analysis, with the few-shot approach excelling in GPT-4o-mini and chain-of-thought prompting boosting irony detection in gemini-1.5-flash by up to 46%. Thus, while advanced prompting techniques overall improve performance, the fact that few-shot prompting works best for GPT-4o-mini and chain-of-thought excels in gemini-1.5-flash for irony detection suggests that prompting strategies must be tailored to both the model and the task. This highlights the importance of aligning prompt design with both the LLM's architecture and the semantic complexity of the task.
Abstract (translated)
这项研究探讨了利用提示工程来增强大型语言模型(LLM)在情感分析任务中的性能,具体针对GPT-4o-mini和gemini-1.5-flash这两款模型。研究评估了诸如少量样本学习、链式思维提示以及自一致性等先进的提示技术,并与基线进行比较。关键任务包括情感分类、基于方面的的情感分析,以及检测讽刺等细微差别。该研究详细介绍了理论背景、所用数据集及方法,通过准确率、召回率、精确度和F1分数来评估LLM的性能。 研究结果表明,先进的提示技术显著提高了情感分析的效果,在GPT-4o-mini中少量样本学习表现尤为突出;而在gemini-1.5-flash中,链式思维提示在检测讽刺方面提升了高达46%。因此,尽管高级别提示策略总体上能够提升模型性能,但针对不同模型和任务定制最佳的提示策略显得尤为重要:例如,对于GPT-4o-mini来说,少量样本学习效果最好;而对于gemini-1.5-flash而言,在检测讽刺时链式思维提示表现更佳。这表明,为了最大程度地发挥大型语言模型的效果,提示设计应当与LLM架构及其处理任务的语义复杂度相匹配。
URL
https://arxiv.org/abs/2601.08302