Agent-Reflex: Teaching Language Agents to Act Reflectively
Organizations: Gaoling School of Artificial Intelligence, Renmin University of China · National University of Singapore
Abstract
Large language models have evolved from single-turn chatbots into interactive agents capable of long-horizon reasoning. In real deployments, MCP tool services can return noisy feedback and users may intervene to correct the agent, but existing methods provide limited supervision for reflection learning and failure recovery. To bridge this gap, we propose Agent-Reflex, a general training framework for incentivizing proactive reflection in agents. Specifically, Agent-Reflex comprises three stages. First, Environment Reflection Skill Discovery (RSD) injects grounded tool-feedback perturbations into environment scaling, samples a capability-diverse LLM pool, mines matched success-failure pairs, and summarizes reusable reflection meta-skills. Building on this skill library, we then apply Reflective Supervised Fine-Tuning (ReSFT) that converts each skill into supervision for self-reflection, skill recovery, and user-centric correction, strengthening complementary reflective behaviors. Finally, we propose On-Policy Reflective Policy Optimization (ORPO) to combine agentic reinforcement learning under noisy interactions with reflection-guided on-policy distillation to further elicit proactive reflection. Built on Qwen3-8B, Agent-Reflex reaches 58.6 overall on five long-horizon tool-use benchmarks and 29.1 on AgentNoiseBench, surpassing strong environment-scaling and reflection baselines. Experiments on six challenging agent benchmark suites demonstrate the effectiveness of Agent-Reflex. Further analyses show that Agent-Reflex improves agents' robustness to noise while maintaining stable training dynamics, supporting scalable agent training. Our code is available at https://github.com/RUC-NLPIR/Agent-Reflex.
Figures & tables
| Method | VitaBench | -Bench | BFCL V4 | ACEBench | Tool Sandbox | Overall | |||||||||||||||
| Cro. | Del. | In. | OTA. | Avg. | Ret. | Air. | Tel. | Avg. | Web. | Mem. | Mul. | NoL. | Liv. | Irr. | Avg. | Ste. | Tur. | Avg. | |||
| Foundation Models | |||||||||||||||||||||
| GPT-5.2 | 24.3 | 52.5 | 45.8 | 28.3 | 37.7 | 81.6 | 62.5 | 95.8 | 80.0 | 75.5 | 45.8 | 48.5 | 81.9 | 70.4 | 88.7 | 62.9 | 95.0 | 50.0 | 68.0 | 73.3 | 64.4 |
| Claude-4.5-Sonnet | 23.5 | 52.0 | 48.3 | 28.3 | 38.0 | 86.2 | 70.1 | 98.0 | 84.7 | 81.0 | 65.0 | 61.4 | 88.7 | 81.1 | 86.6 | 73.2 | 100.0 | 70.0 | 82.0 | 85.0 | 72.6 |
| Gemini 3 Pro | 31.5 | 62.0 | 56.5 | 40.3 | 47.6 | 85.3 | 72.7 | 98.0 | 85.4 | 80.0 | 61.7 | 60.8 | 90.7 | 83.1 | 85.6 | 72.5 | 100.0 | 50.0 | 70.0 | 88.4 | 72.8 |
| Qwen3-235B-A22B | 14.5 | 45.0 | 32.0 | 15.8 | 26.8 | 71.9 | 45.6 | 58.0 | 58.5 | 54.0 | 23.9 | 45.4 | 37.4 | 68.9 | 81.7 | 48.0 | 100.0 | 63.3 | 78.0 | 77.1 | 57.7 |
| Method | AgentNoiseBench- | AgentNoiseBench-Vita | Overall | ||||||
| Clean | Tool Noise | User Noise | Avg. | Clean | Tool Noise | User Noise | Avg. | ||
| Foundation Models | |||||||||
| GPT-5.2 | 81.0 | 61.0 | 72.0 | 66.5 | 53.0 | 45.0 | 45.0 | 45.0 | 55.8 |
| Claude-4.5-Sonnet | 73.0 | 57.0 | 65.0 | 61.0 | 51.0 | 41.0 | 41.0 | 41.0 | 51.0 |
| Gemini-2.5-Pro | 60.0 | 37.0 | 55.0 | 46.0 | 49.0 | 34.0 | 38.0 | 36.0 | 41.0 |
| Qwen3-8B | 26.2 | 14.1 | 26.2 | 20.2 | 11.4 | 3.3 | 5.5 | 4.4 | 12.3 |
| Variant | ANB- | ANB-Vita |
| Agent-Reflex | 45.9 | 12.3 |
| w/o SR | 41.3 | 8.9 |
| w/o KR | 42.4 | 10.2 |
| w/o UR | 43.0 | 10.9 |
| w/o OPD | 43.7 | 9.5 |
| w/o weight | 44.5 | 10.4 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Failure family | Share | Typical signals | Recovery implication |
| Server/gateway unavailable | 33.6% | 500/502/503/504 | Retry with bounded backoff; switch endpoint after the stop rule. |
| Authentication/permission | 17.9% | 401/403, permission denied | Refresh credentials, request authorization, or escalate; unchanged retry is insufficient. |
| Timeout | 14.7% | timeout, read timeout | Retry or narrow the request after checking whether state changed. |
| Resource missing | 10.5% | 404, not found | Verify the identifier or discover the resource through search/list tools. |
| Argument/validation | 10.2% | 400/422, invalid argument | Repair schema, types, required fields, or enums before retrying. |
| Generic execution exception | 8.3% | tool/operation failed | Inspect returned evidence and choose a typed recovery rather than blind repetition. |
| Provider | Model family | Checkpoints for trajectory sampling |
| Alibaba | Qwen3 [ Yang et al., 2025 ] | 4B-Thinking, 8B, 14B, 32B, 235B-A22B |
| Meta | Llama [ Grattafiori et al., 2024 ] | 3.1-8B-Instruct |
| Gemma [ Team et al., 2025 ] | 4-31B-it | |
| OpenAI | GPT-OSS [ OpenAI et al., 2025 ] | 120B |
| DeepSeek-AI | DeepSeek | V4-Flash (284B) |
LLM Agent Training
Large language model agent training teaches models to plan, use tools, and learn from multi-step interaction with environments.
See all 564 papers