TL;DR
Conventional reinforcement learning (RL) for LLM agents relies on sparse, end-of-episode outcome rewards, completely ignoring the rich environmental feedback generated during intermediate interaction steps. To address this, EnvRL introduces two self-supervised auxiliary objectives—state prediction and inverse dynamics—allowing agents to internalize environment dynamics directly from their own trajectories. This simple addition significantly boosts task success rates and sample efficiency across long-horizon benchmarks with virtually zero computational overhead.
What Problem Does This Paper Address?
When training Large Language Models (LLMs) as autonomous agents using Reinforcement Learning (RL), a major bottleneck is the sparsity of rewards. In complex, multi-turn tasks (like navigating a website or manipulating objects in a house), the environment typically provides a binary reward (success or failure) only at the very end of an episode.
As illustrated in Figure 1, standard outcome-based RL treats all intermediate environmental feedback as "unused" data. This makes credit assignment incredibly difficult, as the agent struggles to figure out which specific action in a long sequence led to the final outcome. The authors argue that these intermediate interaction trajectories contain rich, implicit supervision signals about how the environment transitions from one state to another—signals that are completely wasted in standard RL setups.
Methods
The authors propose EnvRL, a framework that integrates environment dynamics learning directly into agentic RL. Instead of training a separate world model, EnvRL reuses the agent's rollout trajectories to optimize two auxiliary self-supervised objectives alongside the primary RL objective (e.g., GRPO or GiGPO):
- State Prediction (SP) [Forward Dynamics]: Given the current state $s_t$ and the chosen action $a_t$, the agent is trained to predict the next textual observation $s_{t+1}$. This forces the agent to anticipate the consequences of its actions.
- Inverse Dynamics (ID) [Backward Dynamics]: Given two consecutive states $(s_t, s_{t+1})$, the agent must infer the action $a_t$ that caused the transition. This helps the agent filter out environmental noise and focus strictly on agent-controllable factors.
Crucially, optimizing these auxiliary tasks indefinitely can distract the model from its primary goal of maximizing rewards. To solve this, EnvRL introduces a coefficient decay mechanism using a cosine schedule. The auxiliary weights start high to help the agent learn environment dynamics early on, and smoothly decay to zero as training progresses, allowing the model to focus purely on policy optimization in the later stages.
Datasets
The framework was evaluated on three distinct multi-turn agentic benchmarks:
- ALFWorld: A text-based interactive environment simulating multi-step household tasks (e.g., cleaning, heating, or moving objects). It includes both standard and Out-of-Distribution (OOD) test sets with novel room layouts.
- WebShop: A simulated e-commerce platform where agents must navigate webpages, search for products, and select options that match complex user instructions.
- SearchQA: A suite of seven single-hop and multi-hop question-answering datasets (including NQ, TriviaQA, and HotpotQA) framed as multi-turn tool-calling tasks using search engines.
Key Insights and Ideas
- Bidirectional Dynamics are Complementary: Ablation studies revealed that the importance of SP vs. ID depends heavily on the environment. In highly logical environments like ALFWorld, predicting the next state (SP) is critical. In noisy environments like WebShop (filled with complex webpages), inferring the causal action (ID) is more effective because it helps the agent filter out irrelevant visual/textual clutter.
- Perpetual Auxiliary Learning Destabilizes Training: Without the coefficient decay mechanism, the agent's policy entropy remains unstable, preventing it from fully converging on the main task. Cosine decay allows the model to smoothly transition from "learning how the world works" to "learning how to win."
- Dynamics Learning Enhances Generalization: By internalizing the underlying transition mechanics rather than just memorizing successful paths, EnvRL agents perform significantly better on Out-of-Distribution (OOD) tasks with unseen configurations.
Key Results
EnvRL consistently outperforms standard RL baselines across different model scales (1.5B and 7B parameters) and algorithms:
- Performance Boosts: For Qwen-2.5-1.5B-Instruct trained with GRPO, EnvRL lifted the success rate from 72.8% to 77.4% on ALFWorld, and from 56.8% to 67.0% on WebShop. When paired with a stronger baseline (GiGPO), it achieved a peak success rate of 94.5% on ALFWorld (7B model).
- High Sample Efficiency: EnvRL reaches the final performance level of standard RL baselines using only ~68.5% of the total training steps on average.
- Negligible Overhead: Because EnvRL reuses rollout data and requires only a single additional forward pass per update, it adds a mere 1.6 seconds of overhead to a 154.6-second training block—making it practically free to deploy.
Limitations and Future Work
While highly effective, the authors note a few limitations:
- Text-Only State Prediction: The current SP objective is designed strictly for textual observations in LLMs. Adapting EnvRL for Vision-Language Models (VLMs) operating in graphical user interfaces (GUIs) will require more complex, multi-modal state prediction strategies.
- Static Hyperparameters: The initial auxiliary weights ($\lambda_{SP}$ and $\lambda_{ID}$) are currently fixed hyperparameters that require manual tuning based on model size. Future work could explore self-adaptive tuning mechanisms to balance these objectives automatically.
Summary updated