Semantic Consistency Policy Optimization for Reinforcement Learning of LLM Agents

Peng Xu, Sijia Chen, Junzhuo Li, Xuming HuarXiv 2026

TL;DR

Reinforcement learning for LLM agents often penalizes perfectly good intermediate steps if the overall trajectory eventually fails. This paper introduces Semantic Consistency Policy Optimization (SCPO), a value-free reward-shaping method that rescues these wasted steps by matching them semantically against successful "sibling" rollouts. By rewarding fine-grained progress without a costly critic model, SCPO achieves state-of-the-art performance on complex multi-step agent benchmarks.

What Problem Does This Paper Address?

Post-training large language models (LLMs) to act as autonomous agents—navigating websites, using tools, or executing multi-turn household tasks—usually relies on reinforcement learning (RL) with sparse, terminal rewards (i.e., a binary success/failure at the very end of an episode).

Popular value-free RL methods, such as GRPO or RLOO, estimate advantages across a group of sampled rollouts to avoid the computational cost of training a separate critic model. However, they suffer from a severe flaw: semantic credit inconsistency. If an agent performs 9 out of 10 steps perfectly but blunders the final step, every single step in that failed trajectory receives a negative training signal. Conversely, a near-identical step in a successful trajectory gets a positive signal.

Figure 2: Failed trajectories contain successful-like steps. Many failed-trajectory steps (red) fall inside the regions occupied by successful-trajectory steps (green), yet trajectory-level credit assigns them the same nega- tive advantage. Embedding and construction details are in Appendix C.2.

This inconsistency sends conflicting gradients to the model, slows down convergence, and completely discards the valuable, partially correct progress hidden inside failed attempts.

Methods

The authors propose SCPO, a value-free reward-shaping plugin that can be layered on top of existing group-based RL algorithms (like GiGPO). It operates in three main stages:

  1. Success Reference Selection: For each task group, SCPO identifies the longest successful rollout to serve as the reference path.
  2. Semantic Similarity Matrix: It uses a frozen cross-encoder (BGE-Reranker-v2-m3) to compute a similarity score between the text descriptions (action + observation) of steps in the failed rollouts and those in the successful reference.
  3. Monotonic Credit Assignment: To prevent the agent from gaming the system by repeating easy actions or getting stuck in loops, SCPO enforces a strict monotonicity rule. A failed step only receives credit if its similarity to a reference step exceeds a threshold $\theta$ and that reference step lies further ahead than any previously matched step in that trajectory. Each reference position can only be credited once.
Figure 1: Overview of SCPO, a reward-level plugin on group-based agentic RL, read left to right. (1) Rollout group: for each task we sample a group of trajectories and take a successful sibling as the success reference. (2) Semantic similarity: a frozen cross-encoder scores every failed step against every reference step, forming a similarity matrix M. (3) Cross-trajectory matching: a failed step is matched to a reference step when their similarity exceeds the threshold θ, and credited only if that position has not already been credited—so credit advances monotonically through the reference and no position is rewarded twice. (4) Reward integration: the recovered credit, scaled by α, is added to the native GiGPO step reward and passed to the advantage estimator.

The recovered credit is scaled and directly added to the step-level discounted returns before advantage estimation, effectively guiding the gradient toward useful intermediate behaviors.

Datasets

The method was evaluated on two challenging multi-turn agent benchmarks:

  • ALFWorld: A benchmark for text-based embodied household tasks (e.g., locating, cleaning, or heating objects) requiring long-horizon planning (up to 50 steps).
  • WebShop: A simulated e-commerce environment where agents must navigate web pages, search, and click to purchase products matching specific natural language descriptions (up to 15 steps).

Key Insights and Ideas

  • Failed rollouts are goldmines: Failed trajectories aren't completely useless; they often contain long sequences of perfectly correct behavior before a late-stage mistake.
  • Progress over Repetition: Simply rewarding similarity to a successful path causes reward inflation because agents exploit repetitive templates or loops. Enforcing a monotonic forward-matching constraint ensures that only genuine progress along the success path is incentivized.
  • Longer references preserve exploration: Counterintuitively, matching against the longest successful trajectory works better than matching against the shortest (most efficient) one. Short paths restrict the reward to a single rigid solution, suppressing policy entropy, whereas longer paths expose more intermediate milestones and preserve exploration.

Key Results

  • State-of-the-Art at 1.5B: Wrapping the GiGPO baseline with SCPO boosts success rates significantly for Qwen2.5-1.5B-Instruct: from 86.7% to 93.7% on ALFWorld (+7.0) and from 65.0% to 74.8% on WebShop (+9.8).
  • Concentrated Gains on Hard Tasks: The biggest improvements occur in the most complex multi-step task families in ALFWorld, such as LOOK (+21.1%) and PICK2 (+14.5%), where agents are highly prone to making partial progress before failing.
  • Low Overhead: Because it uses a frozen cross-encoder and a lightweight matching algorithm, SCPO introduces only a ~10% computational overhead and minimal memory footprint increase, completely avoiding the need to train a separate critic or process reward model (PRM).
Figure 3: Learning dynamics over 150 training steps for Qwen2.5-1.5B (top) and Qwen2.5-7B (bottom). Each panel shows SCPO’s training and validation curves (three-seed mean, shaded ±std) for ALFWorld success rate, WebShop success rate, and WebShop task score. Validation rises steadily and plateaus within the budget, with training closely tracking it across both benchmarks and model sizes.

Limitations and Future Work

  • Dependence on Sibling Success: SCPO requires at least one rollout in the sampled group to succeed. If all rollouts fail (common in very early training), SCPO provides no adjustment. The authors suggest drawing references from a historical buffer of past successes to mitigate this.
  • Coarse Semantic Matching: The off-the-shelf cross-encoder relies on textual surface similarity. While this works well for embodied and web tasks, preliminary tests showed it fails on exact, symbolic domains like mathematics or code generation, where a single character change alters correctness. Future work includes adapting domain-specific or contrastively trained matchers.

Summary updated

BibTeX
@misc{xu2026semantic,
  author = {Peng Xu and Sijia Chen and Junzhuo Li and Xuming Hu},
  title = {{Semantic Consistency Policy Optimization for Reinforcement Learning of LLM Agents}},
  year = {2026},
  eprint = {2606.25852},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.25852},
}
Figure