Introduction
Reinforcement Learning with Verifiable Rewards (RLVR) has recently become a standard method for training reasoning models, such as DeepSeek-R1. To enable these models to function as effective agents using external tools (e.g., search engines), they are typically guided by static, hand-engineered system instructions. However, a static instruction that performs well for a base model may become suboptimal as the model's policy evolves and explores new behaviors during reinforcement learning (RL). Traditional Automated Prompt Optimization (APO) typically occurs before or after training, missing the opportunity to adapt instructions to the agent's shifting capabilities. This paper introduces INSPO (INStruction-POlicy co-evolution), a framework that automates instruction design as an online, dynamic component of the RL training loop.
The INSPO Framework
INSPO integrates prompt optimization natively into the RL loop, specifically utilizing Group Relative Policy Optimization (GRPO). The framework consists of three primary mechanisms:
- Dynamic Instruction Population: Instead of a single static prompt, INSPO maintains a pool of instruction candidates. During training, instructions are sampled based on learned importance weights. RL reward signals are used to update both the LLM's policy weights and the importance weights of the instructions.
- Experience-Driven Generation (Self-Reflection): INSPO maintains a "replay buffer" of trajectories where the agent failed or received low rewards. Periodically, an LLM-based optimizer (Gemini 2.5 Pro) analyzes these failure trajectories, diagnoses the cause of failure (e.g., poor adherence to structure), and generates new instructions specifically designed to address these flaws.
- Prune and Verify: To ensure a high-quality population, INSPO periodically prunes the lowest-performing instructions. Newly generated instructions are tested on a small validation set—a low-cost proxy—before being merged into the active training pool.
Experimental Evaluation
The models were trained on a mixture of Natural Questions (NQ) and HotpotQA. Evaluation was conducted on several standard tool-integrated question-answering benchmarks, including multi-hop QA (HotpotQA, 2WikiMQA, MuSiQue, Bamboogle) and general QA (NQ, TriviaQA, PopQA).
Key Results
The experimental results demonstrate that INSPO significantly outperforms static-instruction baselines:
- Performance Gains: On the Qwen-2.5-3B model, INSPO achieved an average Exact Match (EM) score of 38.2% across all benchmarks, outperforming the state-of-the-art Search-R1 baseline by 6%.
- Complex Reasoning: Gains were most pronounced in multi-hop reasoning tasks, with improvements of over 7% on HotpotQA and 2WikiMQA.
- Efficiency: The online automation of instruction optimization adds only a marginal 1.4% to 7% computational overhead compared to standard RL training.
Analysis and Insights
The success of INSPO highlights several critical aspects of agent training:
- Co-evolution vs. Offline Optimization: Tuning prompts before RL begins or after it ends yields minimal gains. The optimal instruction is a moving target that changes as the policy learns; co-evolving them unlocks significantly higher performance.
- Reflection over Paraphrasing: Simple paraphrasing fails to improve RL training. Providing the optimizer with actual agent failures for reflection is crucial for generating instructions that address behavioral bottlenecks.
- Emergent Multi-Turn Tool Usage: While agents trained with static prompts often collapse into single-turn tool use, INSPO's continuous refinement encourages complex, multi-step reasoning paths.
Limitations and Future Work
While effective, INSPO currently relies on a highly capable proprietary LLM (Gemini 2.5 Pro) for instruction optimization, which incurs API costs. Additionally, there is a non-zero compute overhead for the verification phase. Future work will explore using open-source "thinking-style" models as optimizers and extending the framework to broader agentic domains with a wider variety of tools.
Summary updated