AgentGym-RL: An Open-Source Framework to Train LLM Agents for Long-Horizon Decision Making via Multi-Turn RL

Zhiheng Xi (Fudan University), Jixuan Huang, Chenyang Liao, Baodai Huang, Jiaqi Liu, Honglin Guo, yajie yang, Rui Zheng, Junjie Ye, Jiazheng Zhang, Wenxiang Chen, Wei He, Yiwen Ding, Guanyu Li, Zehui Chen, Zhengyin Du, Xuesong Yao, Yufei Xu, Jiecao Chen, Tao Gui, Zuxuan Wu, Qi Zhang, Xuanjing Huang, Yu-Gang Jiang

International Conference on Learning Representations 2026 · Oral

Overview

This talk introduces AgentGym-RL, an innovative open-source framework designed to train Large Language Model (LLM) agents for complex, long-horizon decision-making tasks through multi-turn reinforcement learning (RL). Presented by Zhiheng Xi from Fudan University, whose work was conducted during an internship at ByteDance, AgentGym-RL addresses a critical challenge in the development of robust LLM agents: their struggle to generalize and perform effectively in diverse, realistic environments beyond simplified, toy domains. The framework emphasizes the necessity of environmental diversity and scalable interaction as prerequisites for achieving true generalization in agentic capabilities.

Watch on SlidesLive

Visual summary for AgentGym-RL: An Open-Source Framework to Train LLM Agents for Long-Horizon Decision Making via Multi-Turn RL by Zhiheng Xi, Jixuan Huang, Chenyang Liao, Baodai Huang, Jiaqi Liu, Honglin Guo, yajie yang, Rui Zheng, Junjie Ye, Jiazheng Zhang, Wenxiang Chen, Wei He, Yiwen Ding, Guanyu Li, Zehui Chen, Zhengyin Du, Xuesong Yao, Yufei Xu, Jiecao Chen, Tao Gui, Zuxuan Wu, Qi Zhang, Xuanjing Huang, Yu-Gang Jiang
Visual summary for AgentGym-RL: An Open-Source Framework to Train LLM Agents for Long-Horizon Decision Making via Multi-Turn RL by Zhiheng Xi, Jixuan Huang, Chenyang Liao, Baodai Huang, Jiaqi Liu, Honglin Guo, yajie yang, Rui Zheng, Junjie Ye, Jiazheng Zhang, Wenxiang Chen, Wei He, Yiwen Ding, Guanyu Li, Zehui Chen, Zhengyin Du, Xuesong Yao, Yufei Xu, Jiecao Chen, Tao Gui, Zuxuan Wu, Qi Zhang, Xuanjing Huang, Yu-Gang Jiang

Key moments

  1. 0:00 Motivation: LLM agents need RL for multi-turn tasks
  2. 1:45 AgentGym-RL: Decoupled, modular framework architecture
  3. 2:45 Framework capabilities: RL algorithms, environments, engineering
  4. 3:35 Scaling Interaction RL: Staged curriculum for stability
  5. 4:45 Demonstrated results: RL improves agent performance
  6. 5:15 Conclusion: Framework, scaling insight, research ecosystem
  7. 6:20 Q&A: Importance of diversity in training and actions

AgentGym-RL: An Open-Source Framework to Train LLM Agents for Long-Horizon Decision Making via Multi-Turn RL

Speakers: Zhiheng Xi (Fudan University); Jixuan Huang; Chenyang Liao; Baodai Huang; Jiaqi Liu; Honglin Guo; yajie yang; Rui Zheng; Junjie Ye; Jiazheng Zhang; Wenxiang Chen; Wei He; Yiwen Ding; Guanyu Li; Zehui Chen; Zhengyin Du; Xuesong Yao; Yufei Xu; Jiecao Chen; Tao Gui; Zuxuan Wu; Qi Zhang; Xuanjing Huang; Yu-Gang Jiang

Conference: ICLR 2026

YouTube: https://slideslive.com/39062147

Overview

This talk introduces AgentGym-RL, an innovative open-source framework designed to train Large Language Model (LLM) agents for complex, long-horizon decision-making tasks through multi-turn reinforcement learning (RL). Presented by Zhiheng Xi from Fudan University, whose work was conducted during an internship at ByteDance, AgentGym-RL addresses a critical challenge in the development of robust LLM agents: their struggle to generalize and perform effectively in diverse, realistic environments beyond simplified, toy domains. The framework emphasizes the necessity of environmental diversity and scalable interaction as prerequisites for achieving true generalization in agentic capabilities.

The core motivation behind AgentGym-RL stems from the observation that many real-world agentic tasks are inherently multi-turn, requiring agents to observe, act, receive feedback, and adapt their behavior over extended periods. Drawing inspiration from Richard Sutton's emphasis on experience as the driving force for agent progress, AgentGym-RL posits that reinforcement learning is a promising avenue for training such agents. The framework builds upon prior work, AgentGym, which focused on scaling environments and data, extending it with a comprehensive RL pipeline. Its significance lies in providing a unified, modular, and extensible platform for the research community to advance the state-of-the-art in LLM agent training, particularly for scenarios demanding deep exploration and stable learning over long interaction horizons.

Background

▶ Watch: Motivation: LLM agents need RL for multi-turn tasks (0:00)

The burgeoning field of LLM agents holds immense promise for tackling complex real-world problems, from intricate coding challenges like CloudCode to dynamic, open-ended environments like OpenCloud. However, realizing this potential has been hampered by significant limitations in current agent training methodologies. A primary challenge is the insufficient task complexity and environmental diversity present in existing training setups. Many contemporary agent training works rely on simplified domains, leading to agents that, while performing strongly in these constrained settings, fail to transfer their capabilities to more realistic or complex scenarios. This lack of generalization is a critical bottleneck, as environmental diversity is deemed not merely optional but a fundamental prerequisite for developing truly capable and adaptable agents.

The speaker highlights the philosophical underpinning that "experience" is what truly drives an agent forward, echoing the principles of reinforcement learning. While internal reasoning within LLMs has seen significant advancements, the talk argues that effective progress on challenging real-world tasks necessitates expanding external interactions with the environment. Existing approaches often struggle with stability when attempting to train agents with long interaction horizons from the outset, leading to unstable training dynamics and suboptimal performance. This gap underscores the urgent need for a unified training framework that can simultaneously support multiple types of environments and feedback signals, enabling the scalable agent-environment interactions necessary for robust RL training. AgentGym-RL directly addresses this by building on the foundation of AgentGym, a previous work focused on environment and data scaling, to integrate a comprehensive RL framework designed for long-horizon decision-making.

Key Findings

▶ Watch: Framework capabilities: RL algorithms, environments, engineering (2:45)

AgentGym-RL presents several pivotal findings that advance the field of LLM agent training, particularly for long-horizon decision-making tasks:

  1. Substantial Improvement in Agentic Capability through RL: The framework demonstrates that reinforcement learning significantly enhances the agentic capabilities of open-source language models. Across an evaluation suite of 27 tasks spanning five distinct scenarios, agents trained with AgentGym-RL consistently outperform other open-source baselines and exhibit competitive performance even when benchmarked against commercial models such as GPT. This underscores the effectiveness of multi-turn RL in fostering sophisticated agent behaviors.
  1. The Necessity of "Scaling Interaction RL" for Stability and Exploration: A critical insight is the discovery that while increasing the number of available interactions at test time initially improves performance, these gains eventually plateau. Furthermore, directly training with a large interaction horizon from the beginning leads to unstable learning. AgentGym-RL introduces Scaling Interaction RL, a novel staged curriculum approach that addresses this instability. By starting RL training with a short interaction horizon to learn basic tasks (exploitation) and then gradually increasing the maximum number of interaction turns, the method ensures training stability while simultaneously encouraging deeper exploration necessary for complex, long-horizon problems.
  1. Environmental Diversity as a Prerequisite for Generalization: The work strongly emphasizes that environmental diversity is not merely a beneficial feature but a prerequisite for an agent's ability to generalize. The framework's design, supporting over 500 diverse environmental scenarios with varying state spaces, action spaces, and reward structures, directly facilitates the training of agents that are robust and transferable across different domains. This diversity is crucial for moving beyond toy examples to real-world applicability.
  1. Unified and Modular Framework for Open-Source Development: AgentGym-RL provides a unified, open-source framework that decouples and modularizes key components of agent training. This design principle allows for flexible integration of new environments, various prompting/action formats, and different RL algorithms into a single training loop. This engineering quality makes the framework highly extensible, scalable, and reliable, addressing practical issues like memory leaks and fragile implementations common in complex ML systems.

Technical Deep Dive

▶ Watch: Scaling Interaction RL: Staged curriculum for stability (3:35)

AgentGym-RL is engineered as a highly flexible and extensible open-source framework, underpinned by a decoupled and modular architecture designed for the complexities of training LLM agents in long-horizon, multi-turn tasks. Its core design principle allows for a "plug-and-play" structure, enabling researchers and practitioners to easily integrate new environments, experiment with different prompting and action formats, and incorporate various RL algorithms.

The framework is logically divided into three primary modules, each handling a distinct part of the agent-environment interaction and learning pipeline:

  1. Environment Module: This module is responsible for wrapping each individual environment as an independent service. It exposes standardized HTTP interfaces for fundamental interactions such as receiving observations, executing actions, and managing environment resets. A key strength here is the framework's breadth in supporting over 500 diverse environmental scenarios. These environments are not homogenous; they differ significantly in their state spaces, action spaces, and reward structures, providing the essential diversity required for robust agent generalization. The module's design ensures that environments can be easily added or swapped out without disrupting the core training loop.
  1. Action Module: The Action Module is the interface between the LLM agent and its environment. It orchestrates the crucial reasoning-action loop of language model agents. Upon receiving observations from the environment module, it processes them, facilitates the agent's internal reasoning (which can involve various prompting strategies or reasoning patterns like reflection or forward reasoning), and ultimately produces the agent's actions over multiple turns. This module's flexibility allows for the application of different prompting strategies and action formats, enabling exploration of various agent architectures and interaction paradigms.
  1. Training Module: This module constitutes the heart of the reinforcement learning pipeline. It manages the entire RL process, including trajectory collection (gathering sequences of states, actions, and rewards), advantage estimation (calculating the relative value of actions), and policy optimization (updating the agent's policy based on collected data). The framework also supports mechanisms for reward shaping, which can be crucial for guiding agents in sparse reward environments. Critically, the training module is designed to integrate a wide array of RL algorithms. It supports major online RL methods such as Generalized Advantage Estimation (GAE) with Proximal Policy Optimization (PPO), Trust Region Policy Optimization (TRPO) (implied by GRPO as a common variant/predecessor), and REINFORCE. Furthermore, it accommodates offline paradigms, including Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO), offering a comprehensive toolkit for different learning strategies.

Beyond its modular structure, AgentGym-RL introduces a crucial methodological innovation: Scaling Interaction RL. This insight addresses the instability encountered when attempting to train agents with very long interaction horizons from the outset. The approach is a staged curriculum designed to progressively increase the complexity of interaction:

  • Initial Stage (Short Horizon): RL training commences with a relatively short interaction horizon. During this phase, the agent focuses on learning basic tasks and developing foundational skills, primarily emphasizing exploitation of learned policies to solve simpler problems efficiently. This stable initial learning prevents early-stage instability.
  • Progressive Expansion (Gradual Horizon Increase): As training progresses and the agent gains proficiency, the maximum number of interaction turns is gradually increased according to a predefined schedule. This expansion of the horizon encourages deeper exploration of the environment, allowing the agent to tackle more complex, multi-step problems without compromising training stability. This method effectively creates a smooth transition from short-horizon exploitation to long-horizon exploration and mastery.

The engineering quality of AgentGym-RL is also a significant highlight. It is built for extensibility through its plug-and-play structure, scalability via support for parallel rollouts and distributed training, and reliability by proactively addressing common practical issues such as memory leaks and fragile implementations that often plague complex, large-scale ML systems. This robust engineering foundation ensures that the framework is not only theoretically sound but also practically usable for cutting-edge research.

Experimental Setup & Results

▶ Watch: Conclusion: Framework, scaling insight, research ecosystem (5:15)

The effectiveness of AgentGym-RL and its core methodology, Scaling Interaction RL, was rigorously evaluated across a diverse and challenging set of agentic tasks. The experimental setup was designed to showcase the framework's ability to handle complexity and promote generalization, moving beyond the limitations of simplified environments.

Evaluation Scope: The research evaluated agent performance on a comprehensive suite comprising 27 distinct tasks. These tasks were drawn from five significantly different scenarios, reflecting a broad range of challenges in terms of state space, action space, and reward structures. While specific dataset names or environment types (beyond general mentions like OpenCloud or CloudCode) were not detailed in the transcript, the emphasis on "500+ scenarios" for the framework's support indicates the potential for vast environmental diversity in experimentation.

Baselines: The performance of agents trained with AgentGym-RL was benchmarked against existing open-source baselines. This comparison aimed to demonstrate the quantitative improvements brought about by the unified RL framework and the Scaling Interaction RL curriculum.

Key Findings and Performance:

The results unequivocally showed that reinforcement learning, when applied through AgentGym-RL, substantially improves the agentic capability of open-source models.

  • Superior Open-Source Performance: Agents trained using AgentGym-RL consistently outperformed other open-source baselines across the evaluated 27 tasks and 5 scenarios. This indicates that the framework's modular design, comprehensive RL pipeline, and particularly the Scaling Interaction RL curriculum, are highly effective in fostering more capable and robust LLM agents.
  • Competitiveness with Commercial Models: A significant headline result is that the agents trained with AgentGym-RL were able to remain competitive even against some commercial models like GPT. This suggests that the framework and its insights are pushing the frontier of open-source agent capabilities to levels previously dominated by proprietary, large-scale systems. The mention of other related works from the same team, which achieved results competitive with SOTA models like Claude and Gemini, further reinforces this claim of high performance.
  • Impact of Scaling Interaction RL: The experiments implicitly validated the Scaling Interaction RL methodology. The talk highlighted that while test-time scaling of interactions initially boosts performance, it eventually plateaus. More critically, direct training with long interaction horizons leads to instability. The successful competitive performance of AgentGym-RL agents suggests that the staged curriculum effectively mitigated these issues, enabling stable and effective training for long-horizon decision-making.

While the talk did not delve into specific quantitative metrics such as exact throughput numbers, parameter counts of the LLMs used, or the specific hardware (e.g., GPU types) employed for training, the qualitative results strongly support the framework's efficacy. The paper itself is stated to contain more detailed results and insights, which would likely include these specific quantitative benchmarks and ablation studies illustrating the contribution of individual components or the staged curriculum.

Practical Implications

▶ Watch: Q&A: Importance of diversity in training and actions (6:20)

AgentGym-RL offers profound practical implications for a wide range of stakeholders in the AI/ML ecosystem, from researchers and model builders to infrastructure teams and deployers of LLM agents.

For practitioners and model builders, AgentGym-RL provides a robust, open-source platform that directly addresses the challenges of training LLM agents for real-world, complex tasks. Instead of grappling with limited environmental diversity or unstable training dynamics for long-horizon problems, they now have access to a unified framework. This framework simplifies the process of integrating diverse environments (supporting 500+ scenarios), experimenting with various RL algorithms (PPO, REINFORCE, DPO, SFT), and refining prompting strategies. This significantly lowers the barrier to entry for developing highly capable agents that can generalize beyond narrow, synthetic benchmarks.

Infrastructure teams stand to benefit from the framework's strong emphasis on engineering quality. Its decoupled and modular architecture, coupled with support for parallel rollouts and distributed training, makes it inherently scalable. The proactive addressing of practical issues like memory leaks and fragile implementations ensures that the framework is not just theoretically sound but also reliable for large-scale, long-running training jobs. This translates to more efficient resource utilization and reduced operational overhead when deploying agent training pipelines.

For deployers of LLM agents, the insights from Scaling Interaction RL are particularly valuable. This methodology provides a clear path to training agents that can stably learn and perform over extended interaction horizons, which is crucial for real-world applications requiring persistent engagement and adaptation. The ability of AgentGym-RL-trained agents to outperform open-source baselines and compete with commercial models suggests that deploying such agents could lead to superior performance in complex decision-making scenarios, from automated customer service to complex scientific discovery.

Tradeoffs and Limitations: While highly promising, the framework does present certain considerations. The effectiveness of Scaling Interaction RL hinges on a carefully designed curriculum, requiring expertise in defining appropriate schedules for increasing interaction horizons. Furthermore, fully leveraging the framework's emphasis on environmental diversity necessitates the availability or construction of a rich and varied set of environments, which can be resource-intensive. The talk, while highlighting competitiveness with commercial models, does not explicitly detail the remaining gaps or specific scenarios where commercial models might still hold an advantage. Researchers will need to continue exploring the optimal balance between internal reasoning and external interaction, as well as the nuances of reward shaping in highly complex environments. Nevertheless, AgentGym-RL provides a powerful foundation for navigating these challenges, pushing the boundaries of what open-source LLM agents can achieve.

Key Takeaways

  • Environmental Diversity is Key: Generalization for LLM agents in complex, multi-turn tasks requires training across a vast and diverse range of environments, not just simple toy domains.
  • AgentGym-RL: A Unified Open-Source Framework: It provides a modular, flexible, and extensible framework for training LLM agents using multi-turn reinforcement learning, supporting a wide array of online and offline RL algorithms.
  • Scaling Interaction RL for Stability: A novel staged curriculum, Scaling Interaction RL, is crucial for stable and effective training of agents over long interaction horizons, preventing instability encountered with direct long-horizon training.
  • Significant Performance Gains: Agents trained with AgentGym-RL substantially improve agentic capabilities, outperforming open-source baselines and achieving competitive performance against leading commercial models like GPT.
  • Robust Engineering for Scalability: The framework is designed for high engineering quality, supporting parallel rollouts, distributed training, and addressing practical issues for reliable, large-scale agent development.
  • Comprehensive Ecosystem for Agent Research: AgentGym-RL is part of a broader research ecosystem that explores environment and data scaling (AgentGym), reward shaping (Agent-PRM, Agentic-Verifier), and cross-environment generalization, aiming for more capable and general agents.

About the Speaker(s)

Zhiheng Xi is a researcher from Fudan University. The work presented on AgentGym-RL was conducted during his internship at ByteDance, highlighting a collaboration between academia and industry in advancing the field of large language model agents. His research focuses on developing more capable and general agents, particularly through scalable environment interactions and reinforcement learning techniques. He and his team are actively involved in building a unified ecosystem for large-scale environment construction and agent training, with several related works contributing to this vision.

Reviews

→ Top-rated talks at International Conference on Learning Representations 2026

All talks from International Conference on Learning Representations 2026