通过两阶段优化提示词,提升大模型跨任务适应能力。
Transfer-Prompting: Enhancing Cross-Task Adaptation in Large Language Models via Dual-Stage Prompts Optimization
- 分两阶段优化提示:先在源任务精炼提示,再在目标任务微调。
- 在9个数据集上测试,显著提升25个模型的任务性能。
- 适合需要快速适配新任务的大模型应用开发者。
大语言模型在平衡生成连贯、相关且高质量回应的同时,实现高效跨任务适应面临挑战。为此,我们提出Transfer-Prompting,一种新型两阶段框架,旨在增强提示生成中的跨任务适应性。该框架包含两个核心组件:(1) 源提示构建,对源任务数据集上的原始提示进行优化,生成具备更强泛化能力的源提示;(2) 目标提示生成,通过在特定任务数据集上微调高分源提示,提升目标提示的跨任务适应性。每个优化周期中,参考LLM基于历史提示-评分对与任务描述生成候选提示,经迭代优化后由评分LLM使用多维度指标评估其效果——这是本文的新贡献,提供对提示质量与任务表现的全面评估。此反馈循环推动持续优化,同时提升提示质量与任务特定结果。我们在25个模型(包括7个基础模型和18个专用模型)上进行了广泛实验,涵盖9个不同数据集。结果表明,Transfer-Prompting显著提升了任务特定性能,展现出增强大模型跨任务适应性的潜力。代码已开源:https://github.com/llm172/Transfer-Prompting。
原文摘要 · Abstract (English)
Large language models (LLMs) face significant challenges when balancing multiple high-level objectives, such as generating coherent, relevant, and high-quality responses while maintaining efficient task adaptation across diverse tasks. To address these challenges, we introduce Transfer-Prompting, a novel two-stage framework designed to enhance cross-task adaptation in prompt generation. The framework comprises two key components: (1) source prompt construction, which refines the original prompts on source task datasets to generate source prompts with enhanced generalization ability, and (2) target prompt generation, which enhances cross-task adaptation of target prompts by fine-tuning a set of high-scored source prompts on task-specific datasets. In each optimization cycle, a reference LLM generates candidate prompts based on historical prompt-score pairs and task descriptions in our designed reference prompt. These candidate prompts are refined iteratively, while a scorer LLM evaluates their effectiveness using the multi-dimensional metrics designed in the objective prompts evaluator-a novel contribution in this work that provides a holistic evaluation of prompt quality and task performance. This feedback loop facilitates continuous refinement, optimizing both prompt quality and task-specific outcomes. We validate Transfer-Prompting through extensive experiments across 25 LLMs, including 7 foundational models and 18 specialized models, evaluated on 9 diverse datasets. The results demonstrate that Transfer-Prompting significantly improves task-specific performance, highlighting its potential for enhancing cross-task adaptation in LLMs. The code is available at https://github.com/llm172/Transfer-Prompting.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。