← Latest papers
🤖 AI

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

This paper introduces TAPR, a Task-Aware Prompt Rewriter trained via Group Relative Policy Optimization that reformulates user inputs into optimized prompts, significantly enhancing downstream LLM performance on tasks like question answering and arithmetic reasoning.

Original authors: Oliver Savolainen, Emanuele Bastianelli, Hosein Azarbonyad

Published 2026-08-03
📖 6 min read🧠 Deep dive

Original authors: Oliver Savolainen, Emanuele Bastianelli, Hosein Azarbonyad

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to talk to a super-smart robot that knows almost everything in the world. This robot is called a Large Language Model (LLM). It's like a genius librarian who has read every book ever written, but it has a quirky personality: it only works its absolute best when you ask it questions in a very specific, perfect way. If you ask it a vague question like "Tell me about space," it might give you a boring, generic answer. But if you ask, "Explain the lifecycle of a star to a 10-year-old using a metaphor about baking," it might unlock its full potential and give you something magical.

The problem is that figuring out those perfect questions is hard. It's like trying to tune a radio to find a clear station; if you turn the dial just a tiny bit wrong, you only get static. Most people aren't experts at "prompt engineering" (the art of writing perfect instructions for AI), so they often get stuck with the static. Scientists have been trying to build a helper that can automatically fix your questions, turning your rough, messy requests into the perfect, polished instructions that the robot loves. This paper dives into that exact challenge: Can we teach a small AI to be a "prompt editor" that makes our big AI friends perform better?


Meet TAPR: The AI Editor That Hacks Your Questions

In this paper, the authors introduce a new tool called TAPR (Task-Aware Prompt Rewriter). Think of TAPR as a tiny, specialized editor sitting between you and the giant AI. When you type a question, TAPR doesn't just pass it along; it rewrites it first. It takes your simple "Answer the question" and transforms it into a detailed, super-clear instruction that tells the big AI exactly how to think, what format to use, and what to avoid.

But how does TAPR learn to be such a good editor? The authors didn't just teach it by showing examples. Instead, they used a method called Reinforcement Learning, which is like training a dog with treats. Here's how the training loop works:

  1. The Rewrite: TAPR takes your original question and rewrites it.
  2. The Test: The big AI (the "Task LLM") tries to answer the rewritten question.
  3. The Judge: A special "Judge AI" looks at the answer and the rewritten question to decide: "Did this new question help the big AI get the right answer? Is the question itself clear and well-written?"
  4. The Reward: If the Judge says "Great job!", TAPR gets a digital treat (a reward). If the answer was wrong or the question was confusing, TAPR gets no treat.

Over time, TAPR learns to write better and better questions because it wants those treats. The authors used a specific training technique called GRPO (Group Relative Policy Optimization), which they found to be much more stable and effective than older methods like PPO.

What Did They Find?

The team tested TAPR on three very different types of tasks:

  • Question Answering: Like asking "Who was the first US President?"
  • Summarization: Like asking an AI to summarize a long news article.
  • Math Reasoning: Like solving a tricky word problem about mixing sugar and water.

The results were promising, though not a magic wand for every situation.

  • The Good News: When TAPR (specifically the version based on a model called Phi-4-mini-instruct) was trained, it consistently improved the performance of the big AI. For example, on a math test called GSM8K, the accuracy jumped from a low 11.91% (when using the untrained base model to rewrite) to 83.60% after TAPR was trained. On a question-answering test called Natural Questions, accuracy went from 48.80% to 59.20%.
  • The "Secret Sauce": The authors discovered that TAPR learned to write prompts that were clearer, more structured, and often included "chain-of-thought" instructions (telling the AI to "think step-by-step"). This made the big AI much smarter at solving problems.
  • The "Judge" Factor: A key part of their success was using an LLM-as-a-Judge. Instead of just checking if the answer matched a textbook word-for-word (which can be unfair if the answer is correct but phrased differently), they used another AI to judge the quality and meaning of the answer. This helped TAPR learn to write prompts that produced genuinely better answers, not just ones that looked right on a checklist.

The Catch: It's Not Perfect Yet

The authors are careful to point out that this isn't a solved problem.

  • Inconsistency: Sometimes, TAPR made things better, but other times, the results were mixed or even slightly worse. For instance, on some summarization tasks, the untrained "base model" actually did a decent job, and TAPR didn't always beat it.
  • The "Selection" Idea: The authors tried a trick where TAPR would generate five different rewritten questions and then pick the best one. While this helped sometimes, it didn't consistently lead to better results, and it cost more computer power. They found no strong evidence that TAPR became a better "judge" of its own work just by being trained to write.
  • The Cost: Training TAPR takes time and computing power. The authors suggest that while it works, the extra cost might not always be worth it for every single task, especially since simple, generic prompts sometimes work just fine.

The Bottom Line

This paper suggests that we can indeed teach a small AI to be a prompt editor that helps big AIs perform better. By using reinforcement learning and a smart "Judge AI," TAPR learned to turn vague questions into clear, powerful instructions. While it's not a perfect solution that works 100% of the time, it shows a clear path forward: if we can automate the art of asking the right questions, we might be able to unlock the full potential of AI for everyone, not just the experts. The authors conclude that this is a viable and effective technique, but it still needs more refinement to be reliable in every real-world scenario.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →