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.
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:
- Success Reference Selection: For each task group, SCPO identifies the longest successful rollout to serve as the reference path.
- 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. - 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.
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%) andPICK2(+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).
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