A story: the one-question exam versus the chess game
Picture two ways of assessing someone.
First case: a one-question exam. You ask a question, the candidate writes an answer, a grader gives it a mark. Done. If the mark is bad, you know exactly what was bad: that answer. Nothing else happened between the question and the mark.
Second case: a game of chess. The player makes a move, the opponent replies, another move follows, and so on for forty moves. At the end, a single verdict: won or lost. And now the question becomes brutal: which move won the game? Maybe the twelfth, a sacrifice that looked absurd at the time. Maybe the third. Maybe thirty-five of the forty moves were irrelevant and two decided everything. The final verdict does not say.
Training a plain LLM (large language model) with reinforcement learning (RL) learning from trials, scores and corrections rather than by copying examples, is the first case. Training an agent is the second. This is not a difference of degree, it is a difference in kind, and that is why the algorithms change.
This course already has a page on the plumbing of agentic RL: Training LLM agents with RL: rollouts, environments, off-policyness. It deals with asynchronous generators, the gap between the policy that generated the data and the one being trained (off-policyness), sandboxes, observability. All of that is engineering around the algorithm. Here we discuss something else: what changes inside the algorithm itself. The two pages are complementary and can be read in either order.
One word recurs throughout: a rollout is one complete run of the agent in its environment, from its first action to the final verdict.
1. The problem changes in kind
The minimal vocabulary
RL describes its problems with a mathematical object called a Markov Decision Process (MDP) "Markov" after the mathematician, and meaning here that the future depends only on the present state, not on the entire history. Three ingredients: a state (the current situation), an action (what the agent decides to do), a reward (a number saying whether that was good). The agent picks actions according to a policy, its strategy, which for an LLM means the set of its weights. These basics are laid out in Reinforcement learning: core principles.
Classic LLM RL: a degenerate MDP
In classic RL applied to an LLM, the setting of RLHF (Reinforcement Learning from Human Feedback), RLVR (Reinforcement Learning with Verifiable Rewards) and GRPO (Group Relative Policy Optimization) on maths problems, the structure is this:
- The state is the prompt.
- The action is the complete answer.
- The reward arrives immediately afterwards.
- And it's over. The world does not respond, there is no next move.
Technically, this is a single-step MDP. Specialists call it a "degenerate" MDP: the RL formalism was kept, but the thing that made RL historically hard (the sequence) was removed. One prompt, one answer, one mark.
Agentic RL: long horizon and partial observability
An agent, by contrast, acts inside an environment that reacts. It runs a command, reads the output, opens a file, discovers it was wrong, backtracks. Two new properties appear:
The horizon is long. An agent trajectory (its whole session, from the first tool call to the verdict) can run to dozens of actions. The reward, meanwhile, usually arrives only at the end: the tests pass, or they don't. The reward is said to be sparse and delayed.
Observation is partial. The agent never sees the full state of the world. It sees what its tools return: a file's contents, a command's output, a web page. The entire repository, the true cause of the bug, the user's actual intent, all hidden from it. The right formalism is a POMDP (Partially Observable MDP). The name is intimidating; the idea is plain: you decide without seeing the whole situation.
The Landscape of Agentic Reinforcement Learning for LLMs: A Survey (2025)This survey, which consolidates over five hundred recent works, formalises exactly this shift: it explicitly contrasts the degenerate single-step MDPs of LLM RL with the temporally extended, partially observable MDPs that define agentic RL. It is the most solid conceptual framing available today for reading this field, with the caveat that a survey organises a landscape, it does not settle the debates running through it.
Moving from "one answer, one mark" to "forty actions, one mark at the end" blows up a difficulty that LLM RL had almost sidestepped: knowing whom to credit. That is the subject of the whole next section.
2. Credit assignment: the heart of the problem
In one sentence: the flaw in applying classic RL as-is to an agent is that it hands out a single score for the whole trajectory, and therefore rewards all forty actions in it indiscriminately; the three families below fix exactly that, by manufacturing a per-action signal.
Credit assignment is the chess question: the trajectory succeeded, which action deserved the reward?
The problem is not academic. If you hand the same reward to every action in a successful trajectory, you also reinforce the mistakes that were later fixed, the pointless detours, the tool calls that did nothing. Conversely, in a failed trajectory, you also punish the good early actions. Learning becomes noisy, slow, and sometimes actively misleading.
Three families of answers stand out today. These are three trade-offs, not three stages of progress: none has won, and the choice depends on the kind of environment and the resources available.
Family A, Retroactively group actions taken from identical states
The intuition: if, across several different games, the player ended up in exactly the same board position, then you can compare what was played from there. Moves followed by a good outcome were better than moves followed by a bad one. You need no theory of what a move is worth: it is enough to compare, against each other, the moves played from the same situation.
That is the principle of GiGPO (Group-in-Group Policy Optimization), which builds two levels of comparison:
- at the level of the whole trajectory: complete trajectories are compared against each other, as GRPO does;
- at the level of the action: it sweeps back through all the generated trajectories, spots identical environment states that recur across them, and groups together every action taken from those states so they can be compared.
The appeal is its economy: it requires no auxiliary model and no extra rollouts, it reuses trajectories already generated. The authors report gains above 12 % on the ALFWorld benchmark (a text simulator of household chores) and above 9 % on WebShop (a simulated shopping site) compared with GRPO, without spending one extra byte of graphics-card memory.
The limitation is visible in the statement itself: identical states must recur. That holds in a discrete, repetitive environment (a simulated household, a simulated shopping site). In a real code repository, two situations are never quite the same.
Family B, An asymmetric critic that sees more than the agent
A very different idea. A critic, in RL, is a second model whose only job is to estimate "how well things are going" at a given moment. The trick here is to make it asymmetric: during training only, it is given access to information the agent does not have when acting, typically the reference solution, or the interlocutor's actual intent.
The analogy: a teacher marking with the answer key in front of them. They can say "at that move, you drifted off the right plan" with a precision the student never had. But the answer key stays on the teacher's desk: the student sits the exam without it. At inference time the critic disappears, only the trained policy remains.
This is the mechanism of SWEET-RL, whose acronym literally stands for RL with Step-WisE Evaluation from Training-time information: a critic trained with information available only during training, which then supplies step-level rewards to improve the policy.
Here too, not everything has the same status, and that is what to take away from the arrangement:
| Item | Role | Status |
|---|---|---|
| The policy | the agent we want to improve | trained, and the only thing shipped |
| The critic | scores each step during training | also trained, then discarded before deployment |
| The privileged information (reference solution, true intent) | what makes the critic clear-sighted | fixed data, never visible to the policy |
The full count of models to hold in memory during a run of this kind (trained policy, trained critic, frozen reference, frozen reward model) is already worked out in RLHF in practice.
SWEET-RL: Training Multi-Turn LLM Agents on Collaborative Reasoning Tasks (2025)The price: you must train and run a second model, and you must actually have that privileged information, which is not always the case. The authors report an absolute improvement of around 6 points on their own benchmark (ColBench), which they built for the purpose; that is an encouraging result on ground of their choosing, not a demonstrated general superiority.
Family C, Process reward models estimated by temporal difference
A Process Reward Model (PRM) scores every step instead of scoring only the final outcome, as opposed to an Outcome Reward Model (ORM), which judges only the end. The course has a dedicated page: Process Reward Models (PRM) vs Outcome Reward Models (ORM). The idea is well established in mathematical reasoning, where each line of a derivation is either true or false.
Transposing it to agents hits two obstacles.
First obstacle, practical: you cannot label steps one by one. In maths, you can have a proof re-read. For an agent, knowing whether a given action was good would require replaying the environment from that point, several times, to see what would have happened otherwise. That is ruinously expensive. The proposed answer is to estimate these scores rather than measure them, via temporal difference (TD): a classic RL technique that propagates the information from the final reward backwards, step by step, each step being evaluated by comparison with the next. Nothing is annotated: it is inferred.
Second obstacle, conceptual, and the single most important point on this page. An agent action is not "correct" or "wrong" the way a line of arithmetic is. Opening the wrong file is not a mistake: it is an exploration that returned nothing. The authors of this work state it explicitly: unlike LLM reasoning, where each step is scored on correctness, agent actions have no clear-cut correctness and must instead be evaluated on their proximity to the goal and the progress they made.
AgentPRM: Process Reward Models for LLM Agents via Step-Wise Promise and Progress (2025)In reasoning, a step is true or false. In agentic settings, an action moves you closer to or further from the goal. This is not a shade of vocabulary: it changes what can be annotated, what can be verified, and what the reward must measure. An agent that explores a lead and closes it has not made a mistake, it paid a cost to acquire information.
The menu at a glance
| Family | How credit is assigned | What it costs | Where it works best |
|---|---|---|---|
| Grouping by identical states (GiGPO) | Compare against each other the actions taken from the same state | Almost nothing: no extra model, no extra rollouts | Environments where the same states recur |
| Asymmetric critic (SWEET-RL) | A second model that sees, at training time, what the agent cannot | Training a critic + having privileged information available | Tasks where a reference or hidden intent exists |
| TD-estimated PRMs (AgentPRM) | Propagate the final reward backwards, step by step | Indirect estimation, therefore noisy | Long tasks where human labelling is out of reach |
None of these three families is "the" solution today. They are recent, evaluated on different benchmarks, often by their own authors. This is an open area.
3. The harness is part of what gets trained
Here is a counter-intuitive idea, and probably the most useful one to take away for anyone looking at this field from outside.
An agent is never "the model on its own". It is wrapped in a harness, the scaffolding that decides:
- which tools are exposed to it (may it write files? run the tests? search the web?);
- how those tools are described (the very wording of the documentation it is given);
- what information accompanies each observation (is it reminded of the objective? the remaining budget? a summarised history?).
The common intuition is that this harness is an engineering detail external to the model: you train the model, then you wrap it. That is wrong. An agent trained with a given harness actually learns a policy conditioned on that harness. Change the tools, change the observation format, and its behaviour degrades, sometimes sharply.
A recent piece of work made this dimension measurable, by extending the ALFWorld environment so that the harness becomes a controllable design dimension, and so that agents can be evaluated under shifts in task and tool environment (what is called out-of-distribution, OOD: different from what was seen during training).
The Interplay of Harness Design and Post-Training in LLM Agents (2026)Two findings emerge: harness-aware post-training improves performance in-distribution as well, and above all lets the agent adapt more robustly to new situations; conversely, under a harness designed with minimal effort, post-training collapses as soon as the tool environment shifts substantially.
This work is very recent and concerns a research environment (extended ALFWorld), not a production agent. Read it as a convincing demonstration that the question exists and can be measured, not as a general law already validated at every scale. The principle it illustrates (the harness is not neutral with respect to training) is nonetheless consistent with what teams deploying agents report empirically.
For anyone interested in what is actually produced during an agent training run, the consequence is stark: the trained object is not the model alone, it is the model + harness pair. Separating the two is like separating a musician from their instrument.
4. Context becomes a resource to manage
On a long task a very concrete problem appears: the trajectory no longer fits in the context window, the amount of text the model can have in front of it at once, covered in Context window extension. Forty tool calls, each returning pages of output, and the agent is saturated long before it is done.
The usual remedies sit outside the model: truncate the history, summarise it automatically, offload part of it to external memory. They work, but they are imposed: the model has no say in what is taken away from it.
A different answer is to make context management a skill learned through RL. The idea, called Context-Folding: let the agent branch into a sub-trajectory to handle a subtask, then fold it once complete, that is, collapse all the intermediate steps while retaining a concise summary of the outcome.
The analogy is a researcher with a notebook. They go off to explore a lead across ten pages, reach a three-line conclusion, tear out the ten pages and keep only the three lines. The active notebook stays thin, but nothing useful was lost.
For this behaviour to be learned rather than imposed, the authors train the agent end to end with an RL framework called FoldGRPO, equipped with specific process rewards that encourage sound task decomposition and good context management.
Scaling Long-Horizon LLM Agent via Context-Folding (2025)On long-horizon deep-research and software-engineering tasks, the authors report performance matching or exceeding a standard ReAct agent (the most common arrangement, where the agent alternates a written thought and an action and never removes anything from its history) while using an active context roughly ten times smaller. The figure comes from their own experiments; what matters most is the principle: deciding what to forget becomes a learned action, just like calling a tool.
5. The curriculum applies to the horizon itself
A last shift, and a subtle one. The course has a page on curriculum learning, Curriculum learning and data ordering: ordering examples from easiest to hardest. In LLM RL, "harder" means a harder problem. In agentic RL a new dimension appears: the number of interactions allowed.
Why this matters. If you turn an untrained agent loose from the outset with a very long horizon, it produces long trajectories that mostly fail, in which nothing can be attributed to anything. The learning signal drowns and behaviour can collapse, the agent starts going in circles, repeating the same tool call, generating filler.
The remedy proposed by ScalingInter-RL, within the AgentGym-RL framework: widen the horizon progressively. Early on, restrict the number of allowed interactions, which pushes the agent to exploit what it already does well over short sequences it can handle. Then relax the constraint in stages, which leads it to explore longer and more varied strategies.
AgentGym-RL: Training LLM Agents for Long-Horizon Decision Making through Multi-Turn Reinforcement Learning (2025)The authors present this as a way to balance exploration and exploitation and to stabilise optimisation: in their account, the agent develops more diverse behaviours and is less prone to collapse under long horizons. They report agents matching or surpassing commercial models on 27 tasks across several environments.
Here, on a new axis, we recover a principle already stated on the infrastructure side: concentrate training where there is signal. There, we filtered tasks that were neither too easy nor too hard. Here, we adjust the length of the leash. Same logic, different resource.
Comparison table: classic LLM RL / agentic RL
| Classic LLM RL | Agentic RL | |
|---|---|---|
| Nature of the problem | Single-step ("degenerate") MDP: prompt → answer → mark | Long-horizon POMDP: the agent acts, the world responds, it sees only part of the state |
| Source of reward | Immediate, on the answer: human preference (RLHF) or verifier (RLVR) | Sparse and delayed: usually a single success verdict at the very end of the trajectory |
| Trajectory length | One action: the complete answer | Dozens of actions interleaved with environment observations |
| Main difficulty | Designing a reward that cannot be gamed (reward hacking) | Credit assignment: which action, out of forty, deserved the reward? |
| Notion of a "good action" | An answer is correct or incorrect | An action moves closer to or further from the goal, correctness is undefined |
| What is really trained | The model, which produces text | The model + harness pair: a policy conditioned on the tools, the observation format and context management |
Why this matters
Much of the discussion about agents stays at product level: which tools, which interface, which system prompt. What this body of work shows is that moving to agents reaches all the way down into the mathematics of training. You cannot take an RL recipe built for "one question, one answer" and apply it unchanged to forty actions: the final reward, on its own, does not say enough.
Three consequences are worth keeping beyond the technique.
First, a substantial share of the ingenuity sits in the reward function and in how it is distributed along the trajectory, a place that is far from obvious when looking at an agent from the outside, since it leaves no visible trace in the finished product.
Second, the harness is not separable from the model. A trained agent and its scaffolding form one whole; either one alone does not reproduce the observed behaviour.
Finally, the field moves fast and is not settled. Most of the work cited here is less than two years old, evaluated on heterogeneous benchmarks, often built by its own authors. What is solid is the framing: long horizon, partial observability, delayed reward, credit assignment. What remains open is which method wins, and it is entirely possible that none of those presented here is the one in use three years from now.
Key takeaways
- The problem changes in kind, not in degree. Classic LLM RL is a single-step decision process (prompt, answer, mark). Agentic RL is a long-horizon, partially observable process: the agent acts, the world responds, it sees only part of the state, and the reward arrives only at the end.
- Credit assignment is the heart of the problem: if a forty-action trajectory succeeds, which action deserved the reward? Three families coexist, grouping actions taken from identical states, using an asymmetric critic that sees more at training time than at inference, and estimating step-level rewards by temporal difference. None has won.
- The decisive conceptual shift: in reasoning, a step is true or false; in agentic settings, an action moves closer to or further from the goal. The "correctness" of an action is simply undefined.
- The harness is part of what gets trained. The tools exposed, how they are described, the observation format: an agent trained on a given harness degrades when you change it. You do not train a model, you train a model + harness pair.
- Context becomes a resource to be managed actively. On long tasks the trajectory outgrows the window; one answer is to learn, through RL, to fold sub-trajectories (branch, summarise, return) so as to keep the active context short.
- The curriculum applies to the horizon itself: the number of allowed interactions is widened progressively, otherwise behaviour collapses on long trajectories. For the plumbing that runs all of this (asynchronous rollouts, sandboxes, off-policyness) see Training LLM agents with RL; for how the environments themselves get built, Building the worlds.
1. According to the page, why is training an agent not the same problem as training a classic LLM with RL?
2. A forty-action agent trajectory succeeds, and the same reward is handed to every one of the forty actions. What is the problem?
3. During training, an agent opens a file that turns out to be unrelated to the bug, then backtracks. How does the agentic viewpoint judge that action?
4. A team trains an agent with one set of tools, then deploys it with different, better-documented tools. What should they expect?
5. How does Context-Folding differ from the usual fixes for context overflow, such as truncation or automatic summarization?