arXiv:2509.23501cs.CLcs.AI2025-09

角色设定能提升大模型零样本和少样本学习效果,值得在提示工程中重视。

The Impact of Role Design in In-Context Learning for Large Language Models

  • 通过设计不同角色来组织提示,探索其对模型表现的影响。
  • 多模型多任务测试表明角色设定可显著提升性能,尤其在复杂推理任务中。
  • 适合想优化提示结构的研究者与应用开发者参考。

上下文学习(ICL)使大型语言模型(LLMs)能在不进行额外微调的情况下,基于提示生成预测。尽管提示工程已广泛研究,但提示中角色设定的影响仍被忽视。本研究使用 OpenAI 的 GPT-3.5 与 GPT-4o,以及 Meta 的 Llama2-7b 与 Llama2-13b 模型,在零样本和少样本场景下评估角色配置对性能的影响。实验覆盖情感分析、文本分类、问答和数学推理等任务。结果表明,基于角色的提示结构具有提升大模型表现的潜力。

原文摘要 · Abstract (English)

In-context learning (ICL) enables Large Language Models (LLMs) to generate predictions based on prompts without additional fine-tuning. While prompt engineering has been widely studied, the impact of role design within prompts remains underexplored. This study examines the influence of role configurations in zero-shot and few-shot learning scenarios using GPT-3.5 and GPT-4o from OpenAI and Llama2-7b and Llama2-13b from Meta. We evaluate the models' performance across datasets, focusing on tasks like sentiment analysis, text classification, question answering, and math reasoning. Our findings suggest the potential of role-based prompt structuring to enhance LLM performance.

提示工程角色设定大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。