mlsanityData to 14 Oct 2026

Spinning Straw into Gold: Relabeling LLM Agent Trajectories in Hindsight for Successful Demonstrations

arXiv 2607.04235 ↗First posted 5 Jul 2026cs.CLcited by 5

On the map: LLM agents and tool use → Reinforcement learning for LLM agents

Abstract (arXiv)

Large language model agents operate in partially observable, long-horizon settings where obtaining supervision remains a major bottleneck. We address this by utilizing a source of supervision overlooked in existing post-training methods: unintended yet successful goals embedded within agent rollouts. Specifically, we introduce Hindsight Supervised Learning (HSL), where an auxiliary LLM reviews each completed trajectory and relabels it with all of the natural-language goals the agent actually achieved. HSL then pairs the trajectory with its relabeled goals and uses these pairs for additional fine-tuning. To mitigate suboptimality in the relabeled data, we propose two learning techniques for HSL, irrelevant-action masking and sample reweighting. Our experiments show that HSL is flexible and compatible with existing post-training pipelines. It improves both SFT and DPO, with larger gains on long-horizon tasks with more diverse goal spaces. Moreover, HSL is sample-efficient: on ALFWorld, it surpasses baselines trained on the full dataset while using only one quarter of the ground-truth demonstrations.

Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in Reinforcement learning for LLM agents, one of 16 directions in LLM agents and tool use. Builds on 31 of its 41 references that are in the map. First posted on arXiv 5 Jul 2026.

Builds on

31 of 41 references.

Closest ancestors · 2

Same direction, newest first

  1. 2024Trial and Error: Exploration-Based Trajectory Optimization for LLM Agents4 Mar
  2. 2022MineDojo: Building Open-Ended Embodied Agents with Internet-Scale Knowledge17 Jun

Other references · 29

  1. 2017Proximal Policy Optimization Algorithmscited by 15,215
  2. 2024The Llama 3 Herd of Modelscited by 14,715
  3. 2024DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Modelscited by 9,379
  4. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  5. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 8,065
  6. 2021On the Opportunities and Risks of Foundation Modelscited by 4,033
  7. 2023Let's Verify Step by Stepcited by 3,789
  8. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  9. 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 2,006
  10. 2022WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agentscited by 1,251
  11. 2020ALFWorld: Aligning Text and Embodied Environments for Interactive Learningcited by 1,205
  12. 2024OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environmentscited by 1,195
17 more
  1. 2017Hindsight Experience Replaycited by 1,136
  2. 2024GPT-4V(ision) is a Generalist Web Agent, if Groundedcited by 563
  3. 2023AgentTuning: Enabling Generalized Agent Abilities for LLMscited by 338
  4. 2019Learning Latent Plans from Playcited by 316
  5. 2023ToolQA: A Dataset for LLM Question Answering with External Toolscited by 274
  6. 2018BabyAI: A Platform to Study the Sample Efficiency of Grounded Language Learningcited by 244
  7. 2024OS-Genesis: Automating GUI Agent Trajectory Construction via Reverse Task Synthesiscited by 163
  8. 2024Embodied Agent Interface: Benchmarking LLMs for Embodied Decision Makingcited by 144
  9. 2024AgentTrek: Agent Trajectory Synthesis via Guiding Replay with Web Tutorialscited by 130
  10. 2022From Play to Policy: Conditional Behavior Generation from Uncurated Robot Datacited by 103
  11. 2025SafeArena: Evaluating the Safety of Autonomous Web Agentscited by 102
  12. 2024Watch Every Step! LLM Agent Learning via Iterative Step-Level Process Refinementcited by 88
  13. 2023The Wisdom of Hindsight Makes Language Models Better Instruction Followerscited by 62
  14. 2024BAGEL: Bootstrapping Agents by Guiding Exploration with Languagecited by 34
  15. 2024Plancraft: an evaluation dataset for planning with LLM agentscited by 16
  16. 2025SymAgent: A Neural-Symbolic Self-Learning Agent Framework for Complex Reasoning over Knowledge Graphscited by 10
  17. 2018ARCHER: Aggressive Rewards to Counter bias in Hindsight Experience Replaycited by 9

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 5.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025Leveraging In-Context Learning for Language Model Agents
  2. 2026AgentHER: Hindsight Experience Replay for LLM Agent Trajectory Relabeling
  3. 2026From Outcomes to Actions: Leveraging Hindsight for Long-Horizon Language Agent Training
  4. 2026Learning More from Less: Reinforcement Learning from Hindsight
  5. 2025Sample-Efficient Online Learning in LM Agents via Hindsight Trajectory Rewriting
  6. 2025Learning Instruction-Following Policies through Open-Ended Instruction Relabeling with Large Language Models
  7. 2026Skill Reuse as Compression in Agentic RL
  8. 2026Trajectory Unlearning on LLM-based Agents