TAPR: Enhancing LLM Performance with a Task-Aware Prompt Rewriter

Oliver Savolainen, Emanuele Bastianelli, Hosein Azarbonyad
7/17/2026
2 citations
cs.AI
rlrlhf-rlvr-dpo

Official code: OliverSavolainen/task-specific-prompt-rewriter (0 stars, Python, last commit 2025-07-10).

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.

Show full abstract

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

View on arXivView PDF

Code Implementations(1)

00Python, Jupyter NotebookJul 10, 20251 years ago

Similar Papers

Cite this paper

@article{savolainen2026tapr,
  title  = {TAPR: Enhancing LLM Performance with a Task-Aware Prompt Rewriter},
  author = {Oliver Savolainen and Emanuele Bastianelli and Hosein Azarbonyad},
  year   = {2026},
  eprint = {2607.28657},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.28657v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.28657.svg)](https://codeofpaper.com/paper/2607.28657)

Discussion