Agentic LLM Post-Training: Critic-Based Policy Optimization and Context Compression
Long-horizon agent tasks expose two major challenges in LLM post-training: assigning credit under sparse rewards and managing rapidly growing interaction histories. This article examines two complementary approaches—SAO-style critic-based optimization and CompactionRL-style context compression—explaining their mechanisms, engineering trade-offs, and implications for building more effective agent training pipelines.
1. Why Agentic RL Is Becoming a Focus of Post-Training
Large language model post-training commonly includes supervised fine-tuning (SFT), reinforcement learning from human feedback (RLHF), and reinforcement learning for reasoning and agent tasks, often called Agentic RL.
Unlike conventional alignment-oriented RLHF, Agentic RL targets multi-turn, long-horizon environments with sparse rewards. A model may need to call tools, inspect an environment, and execute many actions before receiving a final success-or-failure signal.
These tasks create two central training challenges:
- Credit assignment. A complete agent trajectory may contain dozens of model responses but only one terminal reward. Identifying which decisions actually contributed to success is a fundamental difficulty for policy-gradient methods.
- Sequence growth. Environment observations—including web pages, code execution results, and tool responses—accumulate in the context. A single trajectory can become much longer than a typical conversation, increasing memory requirements and computation while reducing training efficiency.
Two research directions address these problems from different angles: explicit value estimation for better policy optimization, and learned context compression for more manageable interaction histories.
2. SAO: Revisiting Critic-Based Value Estimation
2.1 Limitations of Critic-Free Methods
Critic-free methods such as GRPO construct advantage estimates by normalizing rewards across a group of sampled responses or trajectories. They have performed well on tasks such as mathematical reasoning, where outputs can be checked reliably.
Transferring this approach directly to agent tasks, however, exposes several limitations:
- High sampling variance. Agent tasks often have low success rates. Entire sampling groups may receive zero rewards, leaving reward normalization without a useful learning signal and wasting rollout computation.
- Coarse credit assignment. A trajectory-level advantage assigns the same value to all relevant tokens in that trajectory. It cannot distinguish a critical decision from an unnecessary exploration step.
- Unstable training. Sparse rewards and noisy advantage estimates can produce highly variable policy updates, making convergence particularly difficult on long-horizon tasks.
2.2 The Core Idea: Bring Back an Explicit Critic
The central argument behind SAO-style approaches is that an explicit value network can justify its additional cost on long-horizon, sparse-reward agent tasks.
This represents a shift from a simpler but coarser optimization framework toward a more complex framework with finer-grained learning signals.
Stepwise Value and Advantage Estimation
A critic predicts the expected return from each state in a trajectory, where a state corresponds to the interaction context available at that point. These predictions support stepwise advantage estimation, for example through generalized advantage estimation (GAE).
The basic temporal-difference residual and advantage recurrence are:
# Schematic critic-based stepwise advantage estimationdelta_t = r_t + gamma * V(s_{t+1}) - V(s_t)advantage_t = delta_t + (gamma * lam) * advantage_{t+1}
The advantage recurrence is evaluated backward through the trajectory.
Even when the task provides only a terminal reward, value estimates help propagate that learning signal toward earlier decisions. This enables more granular credit assignment than assigning a single advantage to an entire trajectory.
Designing the Critic’s Training Objective
Long trajectories and delayed rewards make value learning difficult. Directly regressing against the final reward can produce a challenging learning problem.
Approaches discussed in this setting include quantile regression or truncated return modeling to reduce the impact of long-tailed targets and large gradients. Limiting the magnitude of critic updates can also help stabilize the joint evolution of the policy and value function.
These choices matter because a critic is useful only to the extent that its predictions support reliable advantage estimates.
Combining Stepwise Advantages with PPO-Style Clipping
On the policy side, importance-sampling ratio clipping can be retained, producing a critic-based proximal policy optimization (PPO) pipeline with stepwise advantages.
The reported experimental conclusions described for this line of work favor critic-based methods over purely critic-free baselines in sample efficiency and final success rate on multi-turn tool-use and long-horizon tasks. The gains are particularly relevant when baseline success rates are low.
2.3 Engineering Costs and Trade-Offs
Critic-based training is not free:
- Additional memory and computation. A separate value network can be comparable in size to the policy, substantially increasing training costs.
- More complex trajectory processing. Estimating values throughout long trajectories may require segmentation and chunked forward passes.
- Sensitivity to critic quality. Poor value predictions undermine advantage estimates. Early training may benefit from warming up the critic on shorter tasks or denser reward signals.
The practical takeaway is conditional rather than universal: longer tasks and sparser rewards strengthen the case for explicit value estimation. On shorter tasks with readily verifiable outcomes, critic-free methods remain competitive because of their simplicity.
3. CompactionRL: Controlling Context Growth Through Learned Compression
3.1 Why Interaction Histories Become a Bottleneck
In multi-turn agent interactions, context length grows approximately with the number of turns. If each environment observation contributes an average of (L) tokens, then after (N) turns, observations alone contribute roughly (N \cdot L) tokens.
With standard dense attention, attention computation grows quadratically with sequence length. Longer histories therefore create a substantial training burden.
There is also an information-quality problem: useful context can become buried beneath observation noise. Historical tool outputs and environment details may remain in the window even when they no longer matter to the current decision. They consume attention capacity and reduce the number of useful training samples that fit on each accelerator.
3.2 The Core Mechanism: Learn to Compress the History
CompactionRL-style approaches do not retain every historical observation verbatim. Instead, they train the model to produce a compact textual representation of relevant history and continue acting from that compressed context.
The mechanism has three main components.
Compression as an Agent Action
“Compress the history” becomes an action available to the model.
During an interaction, the model can replace accumulated observations with a self-generated summary. This keeps the active context within a manageable budget rather than allowing it to grow indefinitely.
The model must therefore decide not only what action to take in the environment, but also when to compact its working context.
Optimizing Compression Through Task Rewards
Compression is not necessarily lossless. A summary may omit information needed later, causing the agent to fail.
Rather than relying solely on hand-designed compression rules or a separately trained summarizer, this approach incorporates compression behavior into the end-to-end task objective:
- If the agent succeeds after compression, the outcome provides evidence that the compressed representation retained enough information for that task.
- If compression removes essential information and contributes to failure, the resulting task feedback can penalize the compression decisions through reinforcement learning.
Over training, the model can learn what to compress, what to retain, and when to compress.
The challenge is that the reward remains indirect: task outcomes evaluate the consequences of compression rather than providing a direct label for summary quality.
Consistency Between Training and Inference
Because compression is a model-generated behavior rather than an external preprocessing step, the same learned behavior can be used during inference.
This helps avoid the mismatch that can arise when a model is trained with one context-management procedure but deployed with another. Compared with fixed truncation or offline summarization, learned compaction places context management inside the agent’s own interaction process.
3.3 Potential Benefits
Learned context compression offers several benefits:
- Controlled context length. The raw interaction history no longer needs to fit inside the context window. This can support much longer interactions, although successful execution still depends on retaining the right information.
- More focused attention. A useful compacted context preserves task-relevant information while removing observations that no longer support decisions.
- Higher training throughput. Shorter active sequences can allow more trajectories to be processed in parallel.
- An indirect contribution to credit assignment. Selecting which historical information to preserve encourages the model to distinguish important events from irrelevant detail.
These benefits depend on compression quality. A short context is not useful if it omits information required to complete the task.
4. How the Two Approaches Fit Together
Taken together, critic-based optimization and learned context compression address different bottlenecks in Agentic RL.
| Dimension | SAO-Style Approaches | CompactionRL-Style Approaches |
|---|---|---|
| Primary problem | Credit assignment under sparse rewards | Sequence growth during long interactions |
| Core mechanism | Explicit value network and stepwise advantages | Learned context compression |
| Main cost or risk | Additional critic training overhead | Loss of important information |
| Most relevant tasks | Low-success-rate tasks with long trajectories | Tool-use tasks with observation-heavy interactions |
The approaches are complementary rather than mutually exclusive.
Compression addresses the scalability problem: trajectories become too long to train efficiently. Critic-based optimization addresses the learning-signal problem: rewards are too sparse to support reliable policy updates.
A plausible combined architecture would estimate stepwise values and optimize the policy over compacted interaction contexts. In that arrangement, context management reduces the representation burden while value estimation improves the usefulness of the training signal.
This is a design direction, not a guarantee that combining the two will automatically deliver gains. Both mechanisms introduce their own failure modes and engineering requirements.
Practical Lessons for Engineering Teams
1. Diagnose the Bottleneck Before Choosing a Method
If failures are driven primarily by noisy credit assignment, explicit value estimation deserves priority.
If the dominant problems are context overflow, observation accumulation, or attention dilution, context compression is the more direct intervention.
The choice should follow the observed failure mode rather than a preference for a particular training framework.
2. Organize Training Data by Difficulty
Low-success-rate tasks can produce many all-zero reward groups under critic-free training. A curriculum and sensible difficulty stratification can reduce uninformative sampling and improve training efficiency.
Task difficulty is therefore part of the optimization design, not merely a property of the dataset.
3. Preserve the Relevant Training–Inference Consistency
For learned compression, the context-management behavior used during training must remain available during deployment. Otherwise, training gains may not carry over to live interactions.
Value estimation requires a different distinction: a critic may be a training-only component and need not run at inference time. What matters is that the deployed policy can operate under the interaction and context conditions it learned during training.
5. Conclusion
The renewed interest in critic-based optimization and the move toward learned context compression point to the same underlying mismatch: long-horizon, sparse-reward agent tasks place demands on training systems that simpler setups do not adequately address.
Explicit value estimation targets the difficulty of learning which decisions matter. Learned compression targets the difficulty of carrying an ever-growing interaction history.
For teams building agent post-training pipelines, the lasting lesson is not a particular hyperparameter choice. It is the need to understand the trade-offs between optimization quality, context capacity, computational cost, and information retention—and to address the bottleneck that actually limits the agent.
