Research & Papers

TAPR prompt rewriter lifts LLM accuracy via task-aware reinforcement learning

Training a tiny Phi-4-mini rewriter with GRPO boosts scores on Natural Questions and GSM8K.

Deep Dive

Crafting effective prompts remains a major bottleneck for non-expert LLM users, often requiring trial-and-error to unlock a model's full capability. To address this, researchers Oliver Savolainen, Emanuele Bastianelli, and Hosein Azarbonyad developed TAPR (Task-Aware Prompt Rewriter), a dedicated model that automatically converts raw user prompts into task-optimized prompts. TAPR is trained using reinforcement learning with Group Relative Policy Optimization (GRPO), where the reward signal comes from LLM-as-judge evaluations of both the rewritten prompt and the final task output. This dual evaluation ensures the rewriter learns to produce prompts that are not only clearer but also more effective for the specific task at hand.

Experiments across diverse tasks—question answering, summarization, and arithmetic reasoning—show TAPR delivers consistent gains over base models in prompt rewriting ability. The team fine-tuned Phi-4-mini-instruct as the base model, and the resulting prompts exhibited clearer, more instructive language. This translated into higher accuracy on established benchmarks, including Natural Questions and GSM8K. The approach offers a practical path to improving LLM performance without changing the underlying model, potentially lowering the barrier for non-experts. The authors have released their code for further exploration.

Key Points
  • TAPR is a Task-Aware Prompt Rewriter trained with GRPO reinforcement learning, where rewards come from LLM-as-judge evaluations of both prompt and output.
  • Fine-tuning Phi-4-mini-instruct as the base model, TAPR produces clearer, more instructive prompts.
  • Consistent gains were observed on question answering, summarization, and arithmetic reasoning, including higher accuracy on Natural Questions and GSM8K.
  • Authors released code to enable further research and adoption.

Why It Matters

TAPR automates prompt engineering, making powerful LLMs more accessible while boosting performance on key benchmarks like NQ and GSM8K.

📬 Get the top 10 AI stories daily