通过对比正负提示,自动优化并适配大模型提示词。
Learning from Contrastive Prompts: Automated Optimization and Adaptation
- 用对比学习分析好坏提示模式,自动生成有效提示。
- 在Big-Bench Hard上优化成功率超76%且跨模型/语言表现稳定。
- 适合需要快速部署大模型的工程团队,减少人工调参负担。
随着大语言模型的发展,提示词的构造耗费大量人力。现有自动化提示优化方法仅基于错误样本学习,效果受限。此外,已有提示在新模型或不同语言下可能失效,这一问题尚未被充分研究。本文提出学习对比提示(LCP)框架,通过对比学习分析优质与劣质提示的模式,实现提示的自动优化与跨模型适应。在Big-Bench Hard数据集上的评估表明,LCP在提示优化上胜过现有方法超过76%的胜率,并展现出对不同模型版本、家族及语言的强大适应能力。LCP为提示工程提供系统化方案,显著降低在多样化场景中部署大模型的人力成本。
原文摘要 · Abstract (English)
As LLMs evolve, significant effort is spent on manually crafting prompts. While existing prompt optimization methods automate this process, they rely solely on learning from incorrect samples, leading to a sub-optimal performance. Additionally, an unexplored challenge in the literature is prompts effective for prior models may not perform well on newer versions or different languages. We propose the Learning from Contrastive Prompts (LCP) framework to address these gaps, enhancing both prompt optimization and adaptation. LCP employs contrastive learning to generate effective prompts by analyzing patterns in good and bad prompt examples. Our evaluation on the Big-Bench Hard dataset shows that LCP has a win rate of over 76% over existing methods in prompt optimization and demonstrates strong adaptability across different model versions, families, and languages. LCP offers a systematic approach to prompt engineering, reducing manual effort in deploying LLMs across varied contexts.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。