RetroAgent: From Solving to Evolving via Retrospective Dual Intrinsic Feedback
Organizations: Shanghai AI Lab · National University of Singapore · Independent Researcher
Abstract
Standard reinforcement learning (RL) for large language model (LLM) agents primarily optimizes extrinsic task rewards, often favoring isolated task completion over continual adaptation. This paradigm can cause premature convergence to suboptimal policies and leaves useful experience only implicitly encoded in model parameters, limiting its retrieval and reuse for future decisions. We introduce RetroAgent, an online RL framework that trains agents to master interactive environments not merely by solving tasks, but by evolving across episodes. Inspired by human retrospective self-improvement, RetroAgent augments extrinsic rewards with hindsight-generated dual intrinsic feedback: (1) Intrinsic Numerical Feedback, which rewards beneficial exploration by measuring incremental subtask progress relative to prior attempts; and (2) Intrinsic Language Feedback which distills successes and failures into reusable textual lessons for explicit experience reuse. To leverage these lessons effectively, we propose Similarity & Utility-Aware Upper Confidence Bound (SimUtil-UCB), a retrieval strategy that balances semantic relevance, historical utility, and exploration. Across four challenging agentic benchmarks, RetroAgent achieves new state-of-the-art performance, outperforming GRPO by +18.3% on ALFWorld, +15.4% on WebShop, +27.1% on Sokoban, and +8.9% on MineSweeper, while demonstrating strong test-time adaptation and out-of-distribution generalization.
Figures & tables
| Method | ALFWorld | WebShop | Sokoban | MineSweeper | |
| Success (%) | Score (%) | Success (%) | Success (%) | Success (%) | |
| Qwen-2.5-7B-Instruct (Zero-Shot) | |||||
| Prompting-based Methods | |||||
| ReAct ∗ ( Yao et al., 2022c ) | 31.2 | 46.2 | 19.5 | 3.9 | 7.0 |
| Reflexion ∗ ( Shinn et al., 2023 ) | 42.7 | 58.1 | 28.8 | 4.3 | 7.4 |
| Fine-tuning with RL | |||||
| Method | Memory Retrieval | WebShop | ||
| Discovery@1 (%) | Discovery@2 (%) | Discovery@3 (%) | ||
| GRPO (Baseline) | – | |||
| RetroAgent (In-Context) | ||||
| RetroAgent (RL-Trained) | ||||
| RetroAgent (In-Context) | ||||
| RetroAgent (RL-Trained) | ||||
| Method | Hallucination Rate (%) | Estimated Utility Score (%) | ||||||
| Failure ( ) | Success ( ) | Failure | Success | |||||
| Low ( ) | Med ( ) | High ( ) | Low ( ) | Med ( ) | High ( ) | |||
| Single Induction | 8.8 | 15.1 | 8.8 | 78.2 | 12.9 | 12.2 | 75.6 | 12.2 |
| Pairwise Induction | 3.8 | 11.9 | 3.1 | 76.7 | 20.1 | 6.2 | 76.2 | 17.6 |
| Method | Augmentation Ratio | WebShop | |
| Task Score (%) | Success Rate (%) | ||
| GRPO | — | 75.5 ±3.6 | 66.9 ±1.2 |
| + Single Induction | 100% (Full Group) | 81.3 ±2.6 | 70.3 ±2.1 |
| + Pairwise Induction | 100% (Full Group) | 82.3 ±1.3 | 72.9 ±1.6 |
| + Pairwise Induction | 0 50% (Half Group) | ||
| Method | Discounted Returns | Reward Type | WebShop | |
| Task Score (%) | Success Rate (%) | |||
| GRPO (Baseline) | – | Extrinsic | ||
| GRPO | ✓ | Extrinsic | ||
| + Progress-Guided Rewards | ✓ | Extrinsic | ||
| + Capability-Evolution Rewards | ✓ | Extrinsic & Intrinsic | ||
| Method | Discounted Returns | Retrieval Strategy | WebShop | |
| Task Score (%) | Success Rate (%) | |||
| GRPO (Baseline) | – | – | ||
| GRPO | ✓ | – | ||
| + Memory Retrieval | ✓ | Similarity | ||
| + Memory Retrieval | ✓ | Similarity & Utility | ||
| + Memory Retrieval | ✓ | SimUtil-UCB | ||
| Method | Intrinsic Feedback | Self-Reflection Mechanism | WebShop | |
| Task Score (%) | Success Rate (%) | |||
| GRPO (Baseline) | – | – | ||
| + Capability-Evolution Rewards | Numerical | Pairwise Induction | ||
| + SimUtil-UCB Memory Retrieval | Language | Pairwise Induction | ||
| RetroAgent (In-Context) | Dual | Pairwise Induction | ||
| RetroAgent (RL-Trained) | Dual | Pairwise Induction | ||
| Method | Intrinsic Feedback | Vendi Score ( ) | |
| Successful Traj. | Failed Traj. | ||
| Qwen-2.5-7B-Instruct | – | 0.00 * | 1.89 |
| GRPO (Baseline) | – | 1.85 | 1.71 |
| + Capability-Evolution Rewards | Numerical | 2.04 | 1.82 |
| + SimUtil-UCB Memory Retrieval | Language | 2.13 | 1.97 |
| RetroAgent (In-Context Self-Reflection) | Dual | 2.01 | 1.78 |
| Method | ALFWorld | WebShop | Sokoban | MineSweeper | |
| Success (%) | Score (%) | Success (%) | Success (%) | Success (%) | |
| Llama-3.1-8B-Instruct (Zero-shot) | |||||
| GRPO (Baseline) | |||||
| LaMer ( Jiang et al., 2025 ) | - | ||||
| GiGPO ( Feng et al., 2025 ) | |||||
| RetroAgent (In-Context) | |||||
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Qwen-2.5-7B-Instruct | Llama-3.1-8B-Instruct | Description |
| Training Configuration | |||
| Training batch size | 16 | 16 | Accumulated batch size per update |
| Validation batch size | 128 | 128 | Batch size for validation |
| Learning rate | Optimizer learning rate | ||
| Max prompt length | 16 384 | 16 384 | Maximum input context length (tokens) |
| Max response length | 2 048 | 2 048 | Maximum generated response length (tokens) |
| Instruction: You are an expert autonomous agent operating in the WebShop e - commerce environment. Your task is to: Find me officially licensed, machine wash men’s t-shirts with polyester heathers, heathers cotton, cotton heather, needle sleeve, classic fit with color: pink, and fit type: youth, and size: small, and price lower than 50.00 dollars. |
| Past reflections on similar tasks: Action Insight: The search terms used did not match the available products, leading to no suitable options being found. | Navigation Insight: Efficient use of filters could have potentially narrowed down the search, but the specific dimensions and color were not met in any of the results. Warning: These lessons may be outdated. Use them only if they align with your current observation. |
| Observation 1: Your current observation is: ‘Search’. Your admissible actions of the current situation are: [’search[<your query>]’, ’click[search]’] Now it’s your turn to take one action for the current step. You should first reason step-by-step about the current situation, then think carefully which admissible action best advances the shopping goal. This reasoning process MUST be enclosed within <think> </think> tags. Once you’ve finished your reasoning, you should choose an admissible action for current step and present it within <action> </action> tags. |
| RetroAgent : <think> To achieve the goal of finding officially licensed, machine wash men’s t-shirts with specific attributes, I need to construct a search query that includes all the required attributes… I will construct the search query to include all these attributes and then execute the search. </think> Action: search[officially licensed men’s t-shirts polyester heathers heathers cotton cotton heather needle sleeve classic fit color pink fit type youth fit type size small price < 50.00] |
| Observation 2: You are now at step 2 and your current observation is: ’Back to Search’ [SEP] ’Page 1 (Total results: 50)’ [SEP] ’Next ’ [SEP] ’B09GL561XH’ [SEP] ’Disney Mickey And Friends Happy Birthday Mickey Confetti T-Shirt’ [SEP] ’22.99’ … [SEP] ’B09Q8RD8YN’ [SEP] ’Bungo Stray Anime Dogs Anime Character, Long Sleeve, Sweatshirt, Hoodie, T shirt’ [SEP] ’$19.99’. |
| RetroAgent : <think> The current page does not list any t-shirts that are officially licensed… The best action at this point is to click on the first product listed to see if it is the correct product… </think> Action: click[b09gl561xh] |
| Observation 3: You are now at step 3… ’fit type’ [SEP] ’men’ [SEP] ’women’ [SEP] ’youth’ [SEP] ’color’ [SEP] ’white’ … [SEP] ’pink’ [SEP] ’size’ [SEP] ’small’ … ’Disney Mickey And Friends Happy Birthday Mickey Confetti T-Shirt’ [SEP] ’Price: $22.99’. |
| Instruction: You are an expert autonomous agent operating in the WebShop e - commerce environment. Your task is to: Find me officially licensed, machine wash men’s t-shirts with polyester heathers, heathers cotton, cotton heather, needle sleeve, classic fit with color: pink, and fit type: youth, and size: small, and price lower than 50.00 dollars. |
| Observation 1: Your current observation is: ‘Search’. Your admissible actions of the current situation are: [’search[<your query>]’, ’click[search]’] . Now it’s your turn to take one action for the current step. You should first reason step-by-step about the current situation, then think carefully which admissible action best advances the shopping goal. This reasoning process MUST be enclosed within <think> </think> tags. Once you’ve finished your reasoning, you should choose an admissible action for current step and present it within <action> </action> tags. |
| GRPO: <think> To achieve the goal of finding officially licensed, machine wash men’s t-shirts with specific attributes, I need to construct a search query that includes all the required attributes… I will construct the search query to include all these attributes and then execute the search. </think> Action: search[officially licensed men’s t-shirts polyester heathers heathers cotton cotton heather needle sleeve classic fit color pink fit type youth fit type size small price < 50.00] |
| Observation 2: You are now at step 2 and your current observation is: ’Back to Search’ [SEP] ’Page 1 (Total results: 50)’ [SEP] ’Next >’ [SEP] ’B08HF132PN’ [SEP] ’Flamingo Pink waterbird costume Gift Premium T-Shirt’ [SEP] ’19.99’ [SEP] ’B09GL561XH’ [SEP] ’Disney Mickey And Friends Happy Birthday Mickey Confetti T-Shirt’ [SEP] ’16.05 to $40.98’. |
| GRPO: <think> The current observation indicates that the search results are being displayed, and the first result is "B08HF132PN" with the title "Flamingo Pink waterbird costume Gift Premium T-Shirt" and a price of $19.99. However, this product does not match the specific criteria we are looking for, as it is a costume t-shirt rather than a men’s t-shirt, and it is not officially licensed. Given the current search results, the next logical step is to click on the first result to see if it matches the criteria… The most appropriate action here is to click on the first result, "B08HF132PN", to check if it matches the criteria. </think> Action: click[b08hf132pn] |
| Observation 3: You are now at step 3 and your current observation is: ’Back to Search’ [SEP] ’< Prev’ [SEP] ’fit type’ [SEP] ’men’ [SEP] ’women’ [SEP] ’youth’ [SEP] ’size’ [SEP] ’small’ … ’Flamingo Pink waterbird costume Gift Premium T-Shirt’ [SEP] ’Price: $19.99’ [SEP] ’Rating: N.A.’ [SEP] ’Description’ [SEP] ’Features’ [SEP] ’Reviews’ [SEP] ’Buy Now’. |
| GRPO: <think> 1. The current observation shows that the search results are being displayed… 2. The product does not match the search criteria… 3. The next step is to refine the search results to ensure that the search criteria are met. The most appropriate action here is to click on "youth" to filter the results to show only products that are intended for youth. </think> Action: click[youth] |
Reinforcement Learning
Reinforcement learning studies how agents learn sequential decisions from rewards and interaction, balancing exploration, performance, safety, and adaptation.
See all 1,717 papers