Abstract
The training paradigm for large language models (LLMs) is moving from static datasets to experience-based learning, where agents acquire skills via interacting with complex environments. To facilitate this transition we introduce GEM (General Experience Maker), an open-source environment simulator designed for the age of LLMs. Analogous to OpenAI-Gym for traditional reinforcement learning (RL), GEM provides a standardized framework for the environment-agent interface, including asynchronous vectorized execution for high throughput, and flexible wrappers for easy extensibility. GEM also features a diverse suite of environments, robust integrated tools, and single-file example scripts demonstrating using GEM with five popular RL training frameworks. Along with this, we also provide a set of baselines across 24 environments using REINFORCE with Return Batch Normalization (ReBN), which—unlike GRPO—is compatible with the full RL setting of dense per-turn rewards and offers better credit assignment. We further conduct apple-to-apple benchmarking of PPO, GRPO and REINFORCE in both single- and multi-turn settings using GEM to shed light on the algorithmic designs. Lastly, GEM also functions as a convenient evaluation toolkit besides a training environment. We hope this framework can help accelerate future agentic LLM research.
Introduction
While Large Language Models (LLMs) have become remarkably capable, most current reinforcement learning (RL) research for LLMs focuses on "single-turn" tasks—like answering a math question or a single prompt. Popular algorithms like GRPO (Group Relative Policy Optimization) are optimized for these scenarios but struggle with "agentic" behavior, where an agent must interact with an environment over many steps (e.g., debugging code, playing a game, or using a search engine).
The field lacks a standardized, high-throughput infrastructure for these multi-turn interactions. GEM (General Experience Maker) addresses this by providing a unified interface for environment-agent interaction, analogous to what OpenAI Gym did for traditional robotics and Atari RL.
The GEM Framework
GEM is designed to transition LLM training from static datasets to interactive, multi-turn reinforcement learning. The framework features:
- Standardized API: Uses the familiar
reset()andstep()functions, making it easy for RL practitioners to adapt existing workflows. - Asynchronous Vectorization: Allows for high-throughput data collection by running multiple environments in parallel, significantly reducing training time.
- Flexible Wrappers: Modular components that can modify observations (e.g., summarizing history) or actions (e.g., parsing code blocks).
- Tool Integration: Native support for Python interpreters, web search, and the Model Context Protocol (MCP) for external tool use.
Algorithmic Innovation: ReBN
On the algorithmic side, the authors propose REINFORCE with Return Batch Normalization (ReBN). Unlike GRPO, which normalizes rewards at the trajectory level, ReBN normalizes per-transition returns across a batch. This allows the use of dense rewards (feedback at every step) and discount factors ($\gamma < 1$), which are essential for teaching agents to solve problems efficiently rather than just eventually.
By setting a discount factor less than 1, the framework introduces a "speed incentive." For example, in a "Guess the Number" game, an agent trained with $\gamma=1$ might eventually find the answer through trial and error, but an agent with $\gamma=0.9$ learns to use binary search to minimize the number of turns.
Experimental Results
GEM includes a diverse suite of over 100 tasks across categories including Math, Code, Games, QA, and Terminal-based reasoning. Benchmarking across these tasks revealed several key insights:
- ReBN Superiority: ReBN consistently outperformed vanilla REINFORCE and GRPO in multi-turn environments like Sudoku and Minesweeper. It provided the strongest baseline without the high computational cost of learning a "critic" model as required by PPO.
- Efficiency Gains: By using asynchronous rollouts within GEM, the authors achieved a 2x gain in wall-clock efficiency during training.
- GRPO’s Multi-turn Struggle: The results highlight that GRPO is effectively a "contextual bandit" approach. Because it treats a whole interaction as one action, it loses the ability to perform fine-grained credit assignment, making it less effective for long-horizon tasks compared to ReBN or PPO.
Conclusion
GEM provides the necessary infrastructure to move LLM research toward complex, multi-turn agentic behavior. By standardizing the environment interface and providing robust baselines like ReBN, GEM enables researchers to focus on algorithmic improvements rather than bespoke environment engineering. Future work will focus on more sophisticated credit assignment and the co-evolution of multi-agent systems within the GEM ecosystem.
Summary updated