mlsanityData to 14 Oct 2026

AgentHER: Hindsight Experience Replay for LLM Agent Trajectory Relabeling

arXiv 2603.21357 ↗First posted 22 Mar 2026cs.AI cs.CLcited by 13

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

LLM-agent training pipelines routinely discard failed trajectories even though GPT-4o achieves only 14-20% on WebArena and below 55% pass@1 on ToolBench; even specialised systems at 50-65% leave the majority of trajectories unused. We introduce AgentHER, which recovers this lost signal by adapting Hindsight Experience Replay (HER) to natural-language agent trajectories: a trajectory that fails goal A is often a correct demonstration for an achievable alternative goal B. AgentHER realises this through a four-stage pipeline (failure classification, outcome extraction, LLM-guided relabeling with confidence gating, and data packaging) that converts discarded failures into SFT, DPO, and ShareGPT training data. On WebArena and ToolBench under a strict task-disjoint held-out protocol, AgentHER improves over success-only SFT by +7.6-11.4% across four model families (GPT-4o, Qwen2.5-72B/7B, LLaMA-3.1-8B), achieves 2x sample efficiency, and beats the strongest experience-centric baseline (Agent Workflow Memory) by +3.0-6.2%. Two robustness mechanisms, failure-severity weighting and cross-model multi-judge verification (gpt-4o-mini paired with Qwen2.5-72B-Instruct), reduce label noise from 5.9% to 2.9% and raise human-rated relabeling precision to 97.1% on WebArena and 96.0% on ToolBench. A full system-cost audit shows the entire relabeling pipeline costs 2.98 and 26 wall-clock minutes for 3,000 trajectories, i.e. 1.4 x 10^-3 per accepted pair. Code: https://github.com/alphadl/AgentHER

Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 32 of its 45 references that are in the map. First posted on arXiv 22 Mar 2026.

Builds on

32 of 45 references.

References · 32

  1. 2023GPT-4 Technical Reportcited by 18,396
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
  4. 2024Qwen2.5 Technical Reportcited by 4,942
  5. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  6. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
  7. 2023Let's Verify Step by Stepcited by 3,789
  8. 2023Generative Agents: Interactive Simulacra of Human Behaviorcited by 3,568
  9. 2023Tree of Thoughts: Deliberate Problem Solving with Large Language Modelscited by 3,211
  10. 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,724
  11. 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 2,006
  12. 2023ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIscited by 1,947
20 more
  1. 2023Improving Factuality and Reasoning in Language Models through Multiagent Debatecited by 1,784
  2. 2023AgentBench: Evaluating LLMs as Agentscited by 1,267
  3. 2023Mind2Web: Towards a Generalist Agent for the Webcited by 1,242
  4. 2023HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Facecited by 1,190
  5. 2017Hindsight Experience Replaycited by 1,136
  6. 2023Encouraging Divergent Thinking in Large Language Models through Multi-Agent Debatecited by 1,011
  7. 2022STaR: Bootstrapping Reasoning With Reasoningcited by 940
  8. 2023ExpeL: LLM Agents Are Experiential Learnerscited by 876
  9. 2023CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquingcited by 783
  10. 2023Instruction Tuning with GPT-4cited by 686
  11. 2023Reinforced Self-Training (ReST) for Language Modelingcited by 500
  12. 2023AgentTuning: Enabling Generalized Agent Abilities for LLMscited by 338
  13. 2023FireAct: Toward Language Agent Fine-tuningcited by 256
  14. 2024V-STaR: Training Verifiers for Self-Taught Reasonerscited by 217
  15. 2024Agent Q: Advanced Reasoning and Learning for Autonomous AI Agentscited by 208
  16. 2024Trial and Error: Exploration-Based Trajectory Optimization for LLM Agentscited by 197
  17. 2023Error Analysis Prompting Enables Human-Like Translation Evaluation in Large Language Modelscited by 87
  18. 2023SteP: Stacked LLM Policies for Web Actionscited by 66
  19. 2024A Simple Model of Inference Scaling Lawscited by 36
  20. 2025Sample-Efficient Online Learning in LM Agents via Hindsight Trajectory Rewritingcited by 13

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 13.

13 papers.

Sort:

By area:

Similar, not cited

Close in wording, no citation either way

  1. 2026Spinning Straw into Gold: Relabeling LLM Agent Trajectories in Hindsight for Successful Demonstrations
  2. 2026Experience Memory Graph: One-Shot Error Correction for Agents
  3. 2026TRAJDEBUG: Tracing Error Lifecycle to Identify Critical Failures in Long-Horizon Agent Trajectories
  4. 2025Exploring Expert Failures Improves LLM Agent Tuning
  5. 2026No Time Like the Present: Agentic Test-Time Training for LLM Agents
  6. 2026FALAT: Tracing Failures in LLM Agent Trajectories via Dependency-Guided Search
  7. 2026Can Failed Trajectories Reveal Where Agents Go Wrong? Agentic Failure Attribution Without Step-Level Labels
  8. 2025AgenTracer: Who Is Inducing Failure in the LLM Agentic Systems?