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

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 JiangICLR 2026

TL;DR

AgentGym-RL is a new open-source, modular framework designed to train Large Language Model (LLM) agents from scratch using reinforcement learning (RL) across diverse, multi-turn environments. By introducing ScalingInter-RL—a staged training approach that progressively increases the interaction horizon—the authors demonstrate that a 7B-parameter model can match or even outperform massive proprietary models like OpenAI o3 and Gemini 2.5-Pro on complex, long-horizon tasks.

What Problem Does This Paper Address?

While LLMs have excelled at reasoning in "one-shot" or "thinking" tasks, transitioning them into autonomous agents requires them to interact with external environments (such as web browsers, games, or scientific simulators) over many turns.

The authors identify two major roadblocks in this transition:

  1. Lack of Infrastructure: The open-source community currently lacks a unified, scalable framework to train agents across varied, realistic environments using RL.
  2. Training Instability: Directly training an agent on "long-horizon" tasks (tasks requiring many steps) often leads to "training collapse." Agents get stuck in repetitive loops or fail to explore effectively when the task complexity is high from the start.

Methods

The paper introduces two core contributions to solve these challenges:

1. The AgentGym-RL Framework

AgentGym-RL Framework Architecture Source, p. 3

AgentGym-RL Framework Architecture

AgentGym-RL features a modular, decoupled architecture that separates the Environment, the Agent, and the Training modules.

  • Decoupled Design: Components communicate via HTTP/APIs, allowing researchers to easily plug in new environments or LLMs.
  • Algorithm Support: It integrates mainstream RL algorithms like PPO, REINFORCE++, and GRPO (Group Relative Policy Optimization).
  • Optimizations: The framework includes subprocess-based architectures to handle multiple environment instances (like Chromium browsers) in parallel, significantly speeding up data collection.

2. ScalingInter-RL

This is a curriculum-based training strategy. Instead of forcing an agent to solve a 20-turn task immediately, the method starts with a short interaction horizon (e.g., 5 turns).

  • Phase 1: The agent masters fundamental skills on simpler, shorter versions of the task.
  • Phase 2: The horizon is progressively expanded (e.g., to 10, then 15 turns).

This "staged scaling" prevents the model from collapsing into unproductive behaviors early on and encourages deeper, more stable exploration of the environment.

Datasets

The authors evaluated their framework across 27 tasks spanning five diverse scenarios:

  • WebArena: Realistic web navigation (shopping, CMS management, maps).
  • Deep Search: Complex, multi-step information retrieval (using datasets like NQ, TriviaQA, and HotpotQA).
  • TextCraft: A text-based crafting game mirroring Minecraft mechanics.
  • BabyAI: Embodied navigation and object manipulation in a grid world.
  • SciWorld: Complex scientific experiments, such as testing material conductivity or boiling water.

Key Insights and Ideas

  • External vs. Internal Scaling: Much of the current "o1-style" research focuses on scaling internal reasoning (thinking longer before acting). This paper argues that for agents, scaling external interaction (doing more things in the world) is equally critical for intelligence.
  • The "Curriculum" is Essential: The authors found that larger interaction horizons provide more room for exploration but introduce massive instability. Scaling the horizon during training is the key to unlocking long-term performance without the model "breaking."
  • Algorithm Superiority: Experiments showed that GRPO consistently outperformed REINFORCE++. By sampling multiple trajectories for a single query and normalizing the rewards, GRPO reduces the impact of outliers and provides a more robust training signal.
  • Environment Sensitivity: RL gains were most dramatic in "simulated worlds" with clear rules (like SciWorld and TextCraft). In open-ended environments like WebArena, gains were present but more modest due to the "noisy" nature of the feedback.

Key Results

Performance and Parameter Efficiency of ScalingInter-7B Source, p. 2

Performance and Parameter Efficiency of ScalingInter-7B

The results for the ScalingInter-7B model (based on Qwen-2.5-7B) are striking:

  • Outperforming Giants: The 7B model achieved an average success rate of 61.8%, significantly higher than Llama-3.1-70B (46.9%) and Qwen-2.5-72B (42.8%).
  • Competitive with Proprietary Models: On the Deep Search benchmark, ScalingInter-7B scored 38.3, surpassing Gemini-2.5-Pro (36.5) and narrowing the gap with OpenAI o3 (49.5).
  • Massive Gains in Science: In SciWorld, the model’s score jumped from a baseline of 1.5% to 50.5% after RL training.
  • State-of-the-Art in Embodied Tasks: On BabyAI, it reached 96.67% accuracy, beating both OpenAI o3 and GPT-4o.

Limitations and Future Work

  • Procedural Gaps: Despite high scores, agents still occasionally substitute "factual recall" for actual procedural execution (e.g., trying to remember a result instead of performing the experiment to find it).
  • Efficiency vs. Success: In web navigation, agents sometimes reach the goal but perform "superfluous" actions like redundant clicking or excessive scrolling. Future work is needed to reward not just success, but efficiency.
  • Open-Ended Reasoning: The authors note that while the agents are better at reaching states, there is still a gap in "precise, efficient action selection" once they arrive at a target page or state.

Summary updated

BibTeX
@inproceedings{xi2026agentgym,
  author = {Zhiheng Xi and Jixuan Huang and Chenyang Liao and Baodai Huang and Jiaqi Liu and Honglin Guo and yajie yang and Rui Zheng and Junjie Ye and Jiazheng Zhang and Wenxiang Chen and Wei He and Yiwen Ding and Guanyu Li and Zehui Chen and Zhengyin Du and Xuesong Yao and Yufei Xu and Jiecao Chen and Tao Gui and Zuxuan Wu and Qi Zhang and Xuanjing Huang and Yu-Gang Jiang},
  title = {{AgentGym-RL: An Open-Source Framework to Train LLM Agents for Long-Horizon Decision Making via Multi-Turn RL}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=ZgCCDwcGwn},
}
Figure