TAPR: Enhancing LLM Performance with a Task-Aware Prompt Rewriter
TAPR: Enhancing LLM Performance with a Task-Aware Prompt Rewriter
TAPR:通过任务感知提示词重写器提升大语言模型性能
Abstract: Large Language Models (LLMs) often require carefully crafted prompts to unlock their full potential, which can be a barrier for non-expert users. This work addresses the challenge by introducing a Task-Aware Prompt Rewriter (TAPR), a model that reformulates user prompts into task-optimized prompts with the explicit goal of improving downstream LLM performance.
摘要: 大语言模型(LLM)通常需要精心设计的提示词才能充分发挥其潜力,这对非专业用户来说可能是一道门槛。本研究通过引入“任务感知提示词重写器”(Task-Aware Prompt Rewriter, TAPR)来解决这一挑战。该模型旨在将用户提示词重构为针对任务优化的提示词,其明确目标是提升下游大语言模型的性能。
We train TAPR using reinforcement learning with Group Relative Policy Optimization (GRPO), where rewards are derived from LLM-as-judge evaluations of both the reformulated prompt and the corresponding task output. Experimental results on diverse tasks, such as question answering, summarization, and arithmetic reasoning, show that our method yields consistent gains over base models in prompt rewriting ability.
我们使用基于组相对策略优化(GRPO)的强化学习方法来训练 TAPR,其中奖励机制源自“大模型作为裁判”(LLM-as-judge)对重构后的提示词及其对应任务输出的评估。在问答、摘要生成和算术推理等多种任务上的实验结果表明,与基础模型相比,我们的方法在提示词重写能力上取得了持续的性能提升。
Fine-tuning Phi-4-mini-instruct (as the base model for TAPR) produces prompts that contain clearer and more instructive language, leading to higher accuracy on established benchmarks such as Natural Questions and GSM8K. Our code is available at: this https URL.
通过对 Phi-4-mini-instruct(作为 TAPR 的基础模型)进行微调,生成的提示词语言更加清晰且具有指导性,从而在 Natural Questions 和 GSM8K 等权威基准测试中实现了更高的准确率。我们的代码已开源,访问地址:点击此处。