Trial and Error: Exploration-Based Trajectory Optimization of LLM Agents (2024)

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 large language models (llms) have demonstrated impressive capabilities in addressing complex interactive tasks through action planning for interactions with environments and tools @xcite . systems using chatgpt @xcite and @xcite as principal controllers have been developed for a range of applications. these include web browsing @xcite , embodied tasks @xcite , multi-modal reasoning @xcite , and complex question ## method our method, eto, starts by training a base agent through behavioral cloning. based on the base agent, our framework continually enhances the policy from trial and error in an iterative manner. ## experiments in this section, we conduct extensive experiments to validate the effectiveness of eto. our method demonstrates superior performance compared to baselines across three datasets, and it exhibits enhanced advantages when dealing with out-ofdomain unseen tasks. the analysis further showcases the efficiency of our method. furthermore, our method also holds promise in scenarios where expert trajectories are unavailable. ## conclusion in this work, we present eto, a method aimed at enhancing the capabilities of llm agents. our approach allows the agent to learn by trial and error, thereby improving the performance of the base agent acquired through behavioral cloning. eto uses an exploration-training iteration framework. during the exploration phase, the agent explores the environment, gathering failure trajectories and constructing trajectory preference pairs. subsequently, in the training phase, the agent learns from the preference information using dpo loss. this iterative process of exploration and training enables further improvement in the agent's performance. extensive experiments on three agent datasets demonstrate our method outperforms behavioral cloning and strong baselines by a large margin. moreover, our method exhibits remarkable efficiency and shows great potential in scenarios where expert trajectories are unavailable.