Agentic RL: Environments, Trajectories, and the Training

· Source: Daily Dose of Data Science · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Robotics & Autonomous Systems · Depth: Advanced, medium

Summary

This content details the process of assembling a full training loop for multi-step LLM agents, building on prior work that used an LLM-as-a-judge for relative scoring in single-response tasks. It addresses the challenge of generating rewards for non-verifiable, multi-step agent interactions where environments provide no explicit feedback. The article defines the agentic setting, mapping actions to model outputs or tool calls, observations to tool results, and state to the interaction history within a partially observable Markov decision process (POMDP). The core training unit becomes a complete "trajectory," encompassing the goal, all actions, observations, and the final answer. The objective is to maximize the expected reward over these entire trajectories, with the GRPO optimizer adapted to score these multi-step sequences. The OpenPipe ART framework and its RULER reward function are introduced for implementing this complete rollout, score, and update cycle.

Key takeaway

For AI Engineers developing multi-step LLM agents, understanding how to generate effective rewards is crucial. You should transition from single-response evaluation to scoring complete interaction trajectories, leveraging an LLM-as-a-judge for reliable relative comparisons. This approach, integrated with optimizers like GRPO, enables robust policy updates even in partially observable environments. Consider utilizing frameworks such as OpenPipe ART with its RULER reward function to streamline the implementation of this agentic RL training loop.

Key insights

Training multi-step LLM agents requires scoring full interaction trajectories using an LLM-as-a-judge within a GRPO framework.

Principles

Method

Define agent actions, observations, and state as interaction history. Generate full trajectories, then use an LLM-as-a-judge for relative scoring. GRPO updates the policy based on these trajectory scores.

In practice

Topics

Code references

Best for: Machine Learning Engineer, AI Engineer, AI Scientist

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Daily Dose of Data Science.