Prompt-R1: Collaborative Automatic Prompting Framework via End-to-end Reinforcement Learning

Wenjin Liu, Haoran Luo, Xueyuan Lin, Haoming Liu, Tiesunlong Shen, Jiapu Wang, Rui Mao, Erik Cambria · OpenReview

TL;DR

This paper introduces Prompt-R1, a novel framework that uses a small LLM to automatically generate prompts for a larger LLM, enabling more effective interaction and problem-solving. By framing this as a multi-turn reinforcement learning task with a dual-constrained reward, Prompt-R1 significantly boosts the performance of large LLMs on complex reasoning tasks, outperforming existing methods.

What Problem Does This Paper Address?

Large Language Models (LLMs) have become incredibly powerful, but their full potential is often hindered by the user's ability to craft effective prompts. For complex tasks, especially those requiring deep reasoning or multi-turn interactions, users struggle to provide prompts that elicit the best performance from LLMs. This limitation restricts LLMs' applicability in real-world scenarios. Existing solutions like prompt engineering and fine-tuning have their own drawbacks, such as high costs, complexity, or limited adaptability. The authors aim to bridge this gap by creating an automated system that can intelligently prompt LLMs, effectively acting as a "smart intermediary" between the user and the LLM.

Methods

Prompt-R1 employs an end-to-end reinforcement learning (RL) approach. The core idea is to use a small-scale LLM (the "agent") to interact with a large-scale LLM (the "environment"). The agent's role is to generate a sequence of prompts over multiple turns, guiding the large LLM to perform complex reasoning and arrive at the correct answer.

Key components of the framework include:

  • Multi-Turn Prompt Interaction: The agent and environment engage in a dialogue. The agent "thinks" about the problem, generates a prompt, and the environment (large LLM) provides a response. This cycle repeats, with the agent learning to refine its prompts based on the environment's feedback.
  • Double-Constrained Reward: To ensure both the quality and correctness of the LLM's output, a novel reward function is introduced. It comprises a "format reward" (ensuring reasoning steps and answers are well-formed) and an "answer reward" (measuring the accuracy of the final answer). This dual constraint helps the agent learn to generate not just correct answers but also coherent and well-structured reasoning processes.
  • Reinforcement Learning Optimization: The agent's prompting policy is optimized using RL, specifically a Group Relative Policy Optimization (GRPO) objective. This allows the agent to learn an optimal strategy for interacting with the LLM environment to maximize the reward.
  • Plug-and-Play Framework: Prompt-R1 is designed to be flexible, supporting various large-scale LLMs as the environment without requiring task-specific fine-tuning of the LLMs themselves.

Datasets

The paper utilizes a variety of datasets for training and evaluation, covering different task types:

  • Training & Evaluation Datasets (8):
    • Multi-hop Reasoning: 2WikiMultihopQA, HotpotQA
    • Mathematical Computation: GSM8K, DAPO Math
    • Common Sense QA: MusiQue, PopQA
    • Text Generation: BookSum, WritingPrompts
  • Out-of-Distribution (OOD) Datasets (4) for Generalization Testing:
    • MathQA
    • SQUAD v2
    • TriviaQA
    • XSum

Key Insights and Ideas

  • LLM as an "Agent" for LLM: The most striking insight is the use of one LLM (small-scale) to intelligently control and prompt another (large-scale) LLM. This shifts the paradigm from direct user prompting to an automated, learned prompting strategy.
  • Multi-turn Interaction is Crucial for Complex Reasoning: The framework's success hinges on the iterative, multi-turn nature of the interaction. This allows the LLM to break down complex problems, refine its understanding, and build up to a final answer, mimicking human problem-solving strategies.
  • Dual-Constrained Reward for Holistic Improvement: Simply rewarding correctness isn't enough. The dual reward (format + correctness) encourages the LLM to not only be right but also to show its work, leading to more robust and interpretable reasoning.
  • Transferability of Learned Prompting Strategies: The paper suggests that the learned prompting policy can be effective across different LLM environments, indicating a degree of generalization in the learned interaction strategy.

Key Results

Prompt-R1 consistently outperforms baseline methods, including supervised fine-tuning (SFT), chain-of-thought (CoT) prompting, and automatic prompt optimization (APO) techniques, across various tasks.

  • Significant Performance Gains: On average, Prompt-R1 shows substantial improvements. For instance, on the combined average of EM, F1, and SSim scores across multiple datasets, Prompt-R1 achieved an average gain of +8.09% over the baseline GPT-40-mini (Table 2).
  • Strong Generalization: Prompt-R1 demonstrates robust performance on out-of-distribution datasets, indicating its ability to adapt to unseen tasks and data distributions (Table 3).
  • Enhanced Reasoning: The framework particularly excels in multi-hop reasoning and complex tasks, significantly boosting the baseline LLM's capabilities in these areas.
  • Improved Stability: Prompt-R1 shows greater stability compared to other methods, preventing performance collapse in challenging scenarios.
  • Case Study Success: In a challenging case study involving entity linking and nationality verification, Prompt-R1 correctly answered a question that all baseline methods failed to solve.

Limitations and Future Work

  • Reliance on Historical Context: Prompt-R1's performance is sensitive to the quality of initial prompts and responses. Errors or ambiguities early on can propagate and affect the final output.
  • Dynamic Updates: The method relies on continuous and dynamic updates to the historical context. If these updates fail to capture new information promptly, it can lead to information loss.
  • Future Work: The authors suggest several avenues for future research:
  • Scalability and Efficiency: Optimizing the multi-turn interaction process through context compression or selective summarization to reduce computational overhead and improve inference speed.
  • Reward Function Refinement: Further improving the reward mechanism for greater learning efficiency and dynamic adaptability.
  • Domain Adaptation: Incorporating domain adaptation and transfer learning to broaden applicability across diverse fields.
  • Long-Range Dependencies: Exploring advanced memory mechanisms to better handle long-range dependencies in multi-turn reasoning.
  • Reward Functions and Feedback: Investigating more sophisticated reward functions and diverse feedback mechanisms to enhance performance on complex tasks.

Summary updated

BibTeX
@inproceedings{liu2026prompt,
  author = {Wenjin Liu and Haoran Luo and Xueyuan Lin and Haoming Liu and Tiesunlong Shen and Jiapu Wang and Rui Mao and Erik Cambria},
  title = {{Prompt-R1: Collaborative Automatic Prompting Framework via End-to-end Reinforcement Learning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.799},
}
Figure