TL;DR
Imagine trying to assemble complex furniture, but you are only allowed to read the manual once before opening the box—and you only find out if you did it right at the very end. That is how most Large Language Model (LLM) agents are trained today. SAPO fixes this by letting agents dynamically look up specific, relevant "skills" from a self-improving playbook at every single step of a task, while also pinpointing exactly which intermediate decisions deserve credit for the final outcome.
What Problem Does This Paper Address?
Training LLM agents with Reinforcement Learning (RL) on multi-turn tasks—like navigating a website or exploring a virtual house—faces three compounding headaches:
- Amnesia across episodes: Standard RL agents start every training rollout with a blank slate, repeating errors and forgetting clever tricks discovered in earlier attempts—discarding structured knowledge in favor of pure weight updates.
- Stale advice: Recent "experience-augmented" methods give agents a library of past strategies. However, they fetch advice only once at step zero based on the initial prompt. Twenty steps later, when an online shopping agent has moved from searching categories to comparing checkout prices, that initial advice is completely stale.
- Sparse rewards: Multi-turn environments usually only hand out a binary pass/fail reward at the very end of a long episode, leaving the agent guessing which of its dozens of intermediate actions actually mattered (the classic credit assignment problem).
Methods
The authors introduce SAPO (Step-Level Skill-Augmented Policy Optimization), built atop Group Relative Policy Optimization (GRPO, a critic-free RL algorithm that compares groups of parallel attempts). SAPO weaves three components together:
- Step-Level Observation Clustering: Instead of scanning an entire database of experiences at every turn, SAPO groups structurally similar environment states into clusters using lightweight string similarity (extending prior state-grouping ideas to also index skills). At each step, the agent looks at its current observation, finds the matching cluster, and injects the top-3 relevant skills directly into its prompt.
- Self-Evolving Skill Bank: Rather than updating via gradients, the skill bank evolves semantically. After a batch of rollouts, the same base LLM contrasts the highest-reward successes against the lowest-reward failures. It synthesizes positive, actionable rules ("in state X, do Y") and admits them into a capacity-limited bank only if their quality score beats existing entries.
- Unified Multi-Level Credit Assignment: SAPO reuses those exact same observation clusters to solve credit assignment. If multiple trajectories pass through the same state cluster, SAPO compares their discounted future returns to calculate a step-level advantage. It combines this with the standard episode-level advantage ($\hat{A} = A_{\text{episode}} + w \cdot A_{\text{step}}$) so the policy knows which exact turns helped or hurt.
Datasets
No new datasets were introduced. The authors evaluate SAPO on established long-horizon, multi-turn benchmarks:
- ALFWorld: Embodied household planning tasks across six subtasks (Pick, Look, Clean, Heat, Cool, Pick2).
- WebShop: Interactive e-commerce navigation and purchasing.
- Search-Augmented QA: Trained on Natural Questions (NQ) and HotpotQA (in-domain), and evaluated both in-domain and out-of-domain across TriviaQA, PopQA (single-hop), 2WikiMultihopQA, MuSiQue, and Bamboogle (multi-hop).
Key Insights and Ideas
- One cluster primitive, two jobs: Using observation equivalence classes to simultaneously index skill retrieval and normalize per-step RL advantages keeps the guidance the agent receives tightly aligned with how its actions are graded.
- Failures teach what successes miss: By default, SAPO retrieves two skills distilled from successes and one corrective skill from failures. Swapping that failure slot for a third success skill drops WebShop success by ~5% (75.4% to 70.3%), proving that contrasting mistakes supplies unique, corrective signal—even when phrased positively.
- The agent genuinely learns to read the manual: If you train an agent with SAPO and abruptly yank away the skill bank at test time, performance crashes below a standard RL baseline (53.6% vs. 77.6% on ALFWorld). The policy doesn't just treat skills as optional hints; it integrates runtime retrieval into its core decision-making.
- Quality over quantity: The rate of new skills entering the bank naturally decays over training, converging to a stable set of high-utility strategies. Making the bank too large ($C=200$ vs. $C=100$) actually slightly hurts performance by diluting retrieval precision.
Key Results
Tested primarily on Qwen2.5-7B-Instruct (and 1.5B for scaling), SAPO consistently beats standard RL (GRPO), step-credit RL (GiGPO), and task-level skill RL (SkillRL):
- ALFWorld: Achieves a 93.5% overall success rate (+15.9 points over GRPO, +3.6 over SkillRL), dominating on longer-horizon subtasks like Pick2 (90.4%).
- WebShop: Reaches 76.3% success (+10.2 points over GRPO) and an 87.6 average score. On the smaller
1.5Bmodel, it jumps ~10 percentage points in success rate over GiGPO, showing smaller models benefit heavily from externalized skill guidance. - Search QA: Hits a 60.9% average across all seven datasets (+9.0 over GRPO). On the tough multi-hop MuSiQue benchmark, SAPO scores 77.2%, whereas group- and skill-based baselines (GiGPO, IGPO, SkillRL) collapse below 32%.
Limitations and Future Work
- Hyperparameter sensitivity: Performance relies on getting the observation clustering similarity threshold ($\delta = 0.85$) right. Making clusters too strict ($\delta = 0.95$) fragments the states, preventing skill reuse across trajectories and tanking WebShop success to 32.0%.
- Statistical resolution across seeds: While SAPO's 3-seed average beats GiGPO across all metrics, the confidence intervals overlap on four of the six configurations, meaning smaller margins (1.2–3.4 points) aren't fully resolved by three seeds.
- Coarse skill credit: SAPO evaluates skill sources (success vs. failure) in aggregate. Figuring out the exact causal value of an individual retrieved skill would require running matched counterfactual rollouts with and without each skill—a direction the authors leave for future work.
Summary updated