TL;DR
Current self-improving language agents often overfit because their self-generated failure trajectories are "shallow" mistakes that offer weak contrast against expert demonstrations. This paper proposes a co-evolving framework where a target agent trains alongside an auxiliary failure agent whose sole job is to master the spectrum of failure and generate high-reward "hard negatives"—near-success trajectories. By learning to overcome these near-misses via Direct Preference Optimization (DPO), the target agent achieves significantly sharper decision boundaries and stronger generalization across complex environments.
What Problem Does This Paper Address?
Curating expert demonstrations to train specialized AI agents across dynamic environments is expensive and hard to scale. Self-improving frameworks like Exploration-Based Trajectory Optimization (ETO) attempt to bypass this bottleneck by letting an agent generate its own trajectories and using DPO to compare expert demonstrations against its own predicted failures.
However, in complex environments where LLMs lack strong prior knowledge, the agent’s mistakes are often trivial or catastrophic (e.g., getting stuck in loops or issuing invalid actions immediately). These "easy negatives" provide little contrastive signal. Instead of learning a nuanced boundary between success and failure, the agent merely memorizes the small pool of expert trajectories, leading to severe overfitting and poor out-of-domain generalization.
Methods
The authors propose a co-evolving agents framework consisting of two policies initialized via Supervised Fine-Tuning (SFT) on expert data:
[ Environment ]
▲ │
Exploration │ ▼ Trajectories
┌────┴────────┴────┐
│ Target Failure │
│ Agent Agent │
└────┬────────┬────┘
Co-Evolve │ │ Generates Hard Negatives
▼ ▼
[ Preference Optimization ]
- The Auxiliary Failure Agent ($\pi_{\theta_f}$): Rather than trying to solve the task, the failure agent is trained via DPO purely on pairs of failure trajectories ($D_{\text{fail}}$) generated by both agents. Given two failed attempts, the one with the higher partial reward is treated as preferred ($\text{reward} < 1.0$). This teaches the agent the subtle gradient of the "failure landscape," enabling it to generate hard negatives—trajectories that execute multiple required sub-skills and get tantalizingly close to success before failing.
- The Target Agent ($\pi_{\theta_t}$): Optimizes a preference dataset ($D_{\text{tgt}}$) consisting of three pair types:
- Expert vs. target-predicted failures
- Expert vs. failure-agent trajectories (hard negatives)
- Target failures vs. failure-agent failures
- Training Loss: To prevent instability and avoid over-penalizing rejected trajectories, the target agent uses DPO combined with an auxiliary SFT loss on chosen trajectories ($\lambda_{\text{DPO}} = 1.0, \lambda_{\text{SFT}} = 0.1$). Failure-versus-failure comparisons use pure DPO ($\lambda_{\text{SFT}} = 0$).
- Co-Evolution Loop: The two agents train in alternating phases. The failure agent continuously produces tougher, more realistic failure modes, forcing the target agent into an implicit arms race that sharpens its decision boundaries.
Datasets
The framework is evaluated across three interactive multi-step benchmarks featuring continuous final rewards normalized to $[0, 1]$:
- WebShop: Goal-driven web navigation and e-commerce shopping (1,624 train / 200 test seen).
- ScienceWorld: Text-based embodied environment for complex elementary science experiments (1,483 train / 194 test seen / 241 test unseen).
- InterCodeSQL: Multi-turn interactive database querying (1,500 train / 200 test seen).
Key Insights and Ideas
- Failure is a continuous spectrum, not a binary label: Typical preference optimization treats all non-successes as equally bad. Training an agent on failure-versus-failure preferences extracts valuable structure from intermediate progress (e.g., correctly preparing soil and planting seeds, even if pollination ultimately fails).
- Failure agents do not mode-collapse: Although trained only on failures, the failure agent avoids degenerating into trivial mistakes because it trains on the target agent's partial successes, keeping its capabilities grounded.
- Hard negatives drive generalization, not just raw parameters: A parameter-matched ablation—substituting the failure agent with a second standard positive agent—achieved a score of only 62.8 on WebShop (virtually identical to ETO's 63.0), whereas the co-evolving failure setup scored 66.7. The gains stem directly from the contrastive quality of hard negatives.
Key Results
The framework was evaluated with Llama-2-7B-Chat and Qwen3-4B-Instruct-2507:
- Consistent Performance Gains:
- On Llama-2-7B, the proposed method achieved an average reward of 64.1, outperforming SFT (44.8), PPO (56.9), RFT (55.7), and ETO (58.3).
- Improvements were especially stark on out-of-distribution reasoning: on ScienceWorld Unseen, reward improved from 55.5 (ETO) to 62.0 (+6.5%).
- On Qwen3-4B, the method reached an average reward of 66.3 vs. ETO's 59.5, including a +10.3% boost on InterCodeSQL (69.1 vs. 58.8).
- Higher Yield of Informative Failures: Using a partial reward threshold of $\ge 0.6$ to define hard negatives, the failure agent boosted the fraction of hard negatives from 5.4% to 14.1% on ScienceWorld and expanded overall failure trajectory diversity (measured by LLM2Vec pairwise embedding distance).
Limitations and Future Work
- Reliance on Granular Reward Signals: The method requires an environment reward function that provides partial credit (continuous values in $[0, 1]$) to rank failure trajectories against one another; it may struggle in strictly binary, sparse-reward environments.
- Scarcity of Near-Optimal Failures: The authors note that trajectories achieving very high failure rewards (e.g., $0.7$–$0.8$) remain rare ($<1\%$ of samples), requiring the hard-negative cutoff to be set at $0.6$.
- Sampling Constraints: Due to the computational overhead of multi-turn agent rollouts, exploration was limited to a single rollout per instruction during training.
Summary updated