Enhancing Sentiment Classification and Irony Detection in Large Language Models through Advanced Prompt Engineering Techniques

📄 arXiv: 2601.08302v1 📥 PDF

作者: Marvin Schmitt, Anne Schwerk, Sebastian Lempert

分类: cs.CL, cs.AI

发布日期: 2026-01-13

备注: 21 pages, 4 figures, 13 tables


💡 一句话要点

通过高级Prompt工程提升大语言模型在情感分类和反讽检测中的性能

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 情感分类 反讽检测 Prompt工程 大型语言模型 Few-shot学习

📋 核心要点

  1. 现有情感分析方法难以捕捉细微情感和反讽,Prompt工程为提升LLM在此类任务中的表现提供了新途径。
  2. 论文探索Few-shot学习、思维链等Prompting技术,旨在提高LLM在情感分类和反讽检测中的准确性。
  3. 实验表明,高级Prompting能显著提升情感分析性能,不同模型需定制Prompt策略以达最佳效果。

📝 摘要(中文)

本研究探讨了利用Prompt工程来增强大型语言模型(LLMs),特别是GPT-4o-mini和gemini-1.5-flash,在情感分析任务中的表现。它评估了诸如Few-shot学习、思维链Prompting和自洽性等高级Prompting技术,并与基线方法进行比较。关键任务包括情感分类、基于方面的情感分析以及检测细微的语义差别,例如反讽。研究详细介绍了理论背景、数据集和使用的方法,并通过准确率、召回率、精确率和F1分数来评估LLM的性能。研究结果表明,高级Prompting显著提高了情感分析的性能,其中Few-shot方法在GPT-4o-mini中表现出色,而思维链Prompting使gemini-1.5-flash在反讽检测方面的性能提高了高达46%。因此,虽然高级Prompting技术总体上提高了性能,但Few-shot Prompting最适合GPT-4o-mini,而思维链Prompting在gemini-1.5-flash中擅长反讽检测,这表明Prompting策略必须根据模型和任务进行定制。这突出了使Prompt设计与LLM的架构和任务的语义复杂性相一致的重要性。

🔬 方法详解

问题定义:论文旨在解决大型语言模型在情感分类和反讽检测任务中,对于细微情感和复杂语义理解不足的问题。现有方法在处理反讽、隐晦情感表达等方面存在局限性,导致准确率不高。

核心思路:论文的核心思路是通过Prompt工程,引导LLM更好地理解和执行情感分析任务。通过精心设计的Prompt,例如Few-shot学习和思维链Prompting,为LLM提供上下文信息和推理步骤,从而提高其性能。这种方法旨在利用LLM的预训练知识,使其能够更好地适应特定的情感分析任务。

技术框架:研究采用了一种实验性的评估框架,包括以下主要阶段:1) 选择LLM模型(GPT-4o-mini和gemini-1.5-flash);2) 设计不同的Prompting策略(基线、Few-shot、思维链、自洽性);3) 在情感分类、基于方面的情感分析和反讽检测等任务上进行评估;4) 使用准确率、召回率、精确率和F1分数等指标评估模型性能。

关键创新:论文的关键创新在于系统性地研究了不同Prompting策略对不同LLM在情感分析任务中的影响。它揭示了Prompting策略的选择需要根据模型和任务进行定制,例如Few-shot Prompting更适合GPT-4o-mini,而思维链Prompting更适合gemini-1.5-flash在反讽检测中的应用。这种针对性Prompt设计是与现有方法的本质区别。

关键设计:论文的关键设计包括:1) Few-shot Prompting中,选择具有代表性的示例,以提供清晰的上下文信息;2) 思维链Prompting中,设计逐步推理的Prompt,引导LLM逐步分析情感和反讽;3) 自洽性Prompting中,生成多个答案并选择最一致的答案。具体参数设置和网络结构取决于所使用的LLM模型(GPT-4o-mini和gemini-1.5-flash)的默认配置。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,高级Prompting技术显著提高了情感分析的性能。具体而言,Few-shot Prompting在GPT-4o-mini上表现最佳,而思维链Prompting使gemini-1.5-flash在反讽检测方面的性能提高了高达46%。这些结果强调了Prompt工程在提升LLM性能方面的潜力,并揭示了不同Prompting策略对不同模型的适用性。

🎯 应用场景

该研究成果可应用于舆情监控、客户服务、社交媒体分析等领域。通过提升LLM的情感分析能力,可以更准确地理解用户的情感倾向,从而为企业决策提供支持,改善用户体验,并及时发现潜在的社会风险。未来,该技术可进一步扩展到其他自然语言处理任务,例如文本摘要、机器翻译等。

📄 摘要(原文)

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.