TAPR: Enhancing LLM Performance with a Task-Aware Prompt Rewriter
06:00 · August 3, 2026 · arXiv cs.AI RSS

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. 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. 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: https://github.com/OliverSavolainen/task-specific-prompt-rewriter
Summary
TAPR addresses the difficulty non-expert users face when crafting effective prompts for large language models by training a compact rewriter model that converts raw inputs into clearer, task-specific instructions. The system pairs this lightweight model with a frozen downstream LLM that executes the actual task, so the rewriter learns to optimize prompts for measurable improvements in question answering, summarization, and arithmetic reasoning.
Training relies on Group Relative Policy Optimization, an extension of proximal policy optimization that updates the policy from groups of sampled outputs without an explicit value function. Rewards combine an LLM-as-a-judge assessment of both the rewritten prompt and the task output with an additional scalar that scores prompt quality directly. An ablation study confirms that the LLM-based signals improve training stability compared with purely task-performance rewards used in earlier work such as PRewrite.
When Phi-4-mini-instruct is fine-tuned under this regime, the resulting prompts exhibit more explicit instructions and structured language. On benchmarks including Natural Questions and GSM8K the approach raises accuracy over both the base model and prior rewriting baselines. The authors also release the training code, enabling replication and further experimentation with the same reward formulation.
Why it matters
Directly applicable by Dutch AI teams via public code; strong technical depth and novelty in prompt optimization using GRPO and LLM judges; Dutch institutional ties (UvA) and relevance to EU LLM deployment and ethical AI practices.





