Abstract
Large Language Models (LLMs) have become integral components in various autonomous agent systems. In this study, we present an exploration-based trajectory optimization approach, referred to as ETO. This learning method is designed to enhance the performance of open LLM agents. Contrary to previous studies that exclusively train on successful expert trajectories, our method allows agents to learn from their exploration failures. This leads to improved performance through an iterative optimization framework. During the exploration phase, the agent interacts with the environment while completing given tasks, gathering failure trajectories to create contrastive trajectory pairs. In the subsequent training phase, the agent utilizes these trajectory preference pairs to update its policy using contrastive learning methods like DPO. This iterative cycle of exploration and training fosters continued improvement in the agents. Our experiments on three complex tasks demonstrate that ETO consistently surpasses baseline performance by a large margin. Furthermore, an examination of task-solving efficiency and potential in scenarios lacking expert trajectory underscores the effectiveness of our approach.
Introduction
Building autonomous agents with open-source Large Language Models (LLMs) typically relies on Behavioral Cloning (BC). In this paradigm, models are supervised to mimic "expert" trajectories—sequences of actions that lead directly to a goal. However, this approach suffers from a fundamental limitation: the agent never learns what not to do. Because it only observes success, it fails to explore the boundaries of its environment. Consequently, when the agent encounters a novel situation or makes a minor error, it lacks the knowledge to recover, leading to compounding errors. While Reinforcement Learning (RL) methods like PPO can address this through trial and error, they are often unstable and computationally expensive for large-scale models.
Methodology: The ETO Framework
To address these challenges, we introduce Exploration-Based Trajectory Optimization (ETO). ETO is an iterative framework that bridges the gap between simple imitation and complex reinforcement learning through a three-step cycle.
- Behavioral Cloning (Warm-up): The agent is initially trained via standard Supervised Fine-Tuning (SFT) on expert data to establish basic task competence.
- Exploration Phase: The agent interacts with the environment (e.g., a virtual house or web shop), attempting tasks and collecting "failure trajectories"—sequences where it failed to reach the goal or achieved a low reward.
- Training Phase: The agent utilizes Direct Preference Optimization (DPO) to update its policy. By creating contrastive pairs consisting of a successful expert trajectory (the "preferred" path) and the agent’s own failed attempt (the "rejected" path), the model learns to increase the probability of successful actions while specifically decreasing the probability of its own observed mistakes.
Experimental Evaluation
We evaluated ETO across three diverse environments: WebShop (web navigation), ScienceWorld (simulated elementary science experiments), and ALFWorld (embodied household tasks).
ETO consistently outperformed all baselines, including standard SFT and Rejection sampling Fine-Tuning (RFT). In WebShop, ETO achieved an average reward of 67.4, surpassing both the SFT baseline (63.1) and GPT-4 (63.2). In ScienceWorld, ETO demonstrated superior generalization, achieving a score of 65.0 on unseen tasks compared to 53.0 for the SFT model. Similarly, in ALFWorld, ETO reached a success rate of 72.4% on unseen tasks, significantly outperforming SFT (67.2%) and PPO (29.1%).
Key Insights and Discussion
The core finding of this research is that failure is a more effective teacher than perfection. Contrastive signals help the model understand the specific consequences of its actions, leading to better robustness in unfamiliar environments. Furthermore, ETO proved more efficient than traditional RL; agents trained with ETO reached goal states in fewer steps than those trained only on expert data.
However, limitations remain. Currently, ETO employs coarse credit assignment, treating an entire failed trajectory as "bad" even if most steps were correct. Future work will explore more granular error detection and the use of dynamically generated tasks to further enhance agent potential.
Conclusion
ETO provides a stable, scalable, and effective method for optimizing LLM agents by leveraging their own exploration failures. By iteratively refining policies through contrastive learning, ETO enables open-source models to achieve and even exceed the performance of state-of-the-art proprietary models on complex autonomous tasks.
Summary updated