Abstract
Training language agents typically requires expensive data from human annotators or proprietary models like GPT-4. We introduce Reflection-Reinforced Self-Training (Re-ReST), a method that allows open-source agents to autonomously improve by using a "reflector" model to fix their own mistakes during training. By leveraging environmental feedback to correct failed attempts, Re-ReST enriches the training dataset, boosting agent performance across diverse tasks without relying on closed-source models.
Introduction
To build effective "language agents"—LLMs that can reason, use tools, and interact with environments—researchers typically fine-tune models on high-quality reasoning-action trajectories. However, acquiring this data is a significant bottleneck. Current approaches often rely on distillation from powerful, closed-source models like GPT-4 or costly human intervention.
An appealing alternative is self-training: having the agent attempt tasks, keeping the successful trajectories, and fine-tuning the agent on its own successes. However, for complex, multi-step tasks, a base model will fail most of the time. Discarding all failed attempts results in a tiny, inefficient training dataset. Re-ReST addresses this by efficiently generating high-quality self-training data through automated error correction.
Methodology
The core of Reflection-Reinforced Self-Training (Re-ReST) is the introduction of a Reflector model into the self-training loop. The process follows these steps:
- Initial Generation: The base Agent attempts a task multiple times. Successful attempts (verified by an external environment, such as a unit test) are added directly to the training set.
- Reflection with Feedback: Failed attempts are passed to the Reflector model along with environmental feedback (e.g., "unit test failed on line 4"). The Reflector acts as a debugger to generate a corrected trajectory.
- Data Enrichment: If the Reflector's corrected trajectory passes the environment's check, it is added to the training dataset.
- Reflector Training: The Reflector is initially fine-tuned on a dataset of the agent's failures paired with successful corrections to ensure its efficacy.
During inference, the Reflector is discarded. The Agent operates solo, ensuring no added computational overhead or need for environmental feedback at test time.
Experimental Evaluation
Re-ReST was evaluated across several agentic benchmarks, including ALFWorld (decision-making), HotpotQA (multi-hop QA), and MBPP (coding).
Key Results
Re-ReST significantly outperformed standard self-training across all tasks:
- ALFWorld: Success rates jumped from a Llama-2 baseline of 8.9% to 51.4%, a 14.1% absolute improvement over standard self-training (37.3%).
- HotpotQA: Re-ReST improved the Llama-2 baseline from 20.0% to 29.6% Exact Match, matching or exceeding models distilled from GPT-4.
- MBPP: Pass@1 improved from 48.6% to 56.4%.
Discussion and Insights
The success of Re-ReST highlights that efficiency beats brute force. Simply sampling more attempts from a base agent yields diminishing returns as the model repeats the same errors. The Reflector actively fixes these mistakes, providing a faster path to a high-quality dataset. Furthermore, by leveraging deterministic environmental feedback (like Python interpreters), open-source models can bootstrap themselves to competitive levels independently of proprietary APIs.
Limitations
Re-ReST requires an environment capable of providing clear, ground-truth feedback during training (e.g., unit tests or simulator states). This makes it less applicable to purely subjective generative tasks. Additionally, like all self-training methods, there is a risk of amplifying inherent model biases during the bootstrapping process.
Conclusion
Re-ReST demonstrates a powerful path forward for open-source language agents. By transforming failures into learning opportunities through automated reflection, models can achieve high performance without the need for expensive external supervision.
Summary updated