mlsanityData to 14 Oct 2026

Sample-Efficient Online Learning in LM Agents via Hindsight Trajectory Rewriting

arXiv 2510.10304 ↗First posted 11 Oct 2025cs.LG cs.AI cs.CLcited by 13

On the map: LLM agents and tool use → Agent memory systems

Abstract (arXiv)

Language model (LM) agents deployed in novel environments often exhibit poor sample efficiency when learning from sequential interactions. This significantly hinders the usefulness of such agents in environments where interaction is costly (for example, when they interact with humans or reset physical systems). While a number of existing LM agent architectures incorporate various mechanisms for experience storage and reflection, they make limited use of LMs' abilities to directly generate or reason about full counterfactual trajectories. We introduce ECHO (Experience Consolidation via Hindsight Optimization), a prompting framework that adapts hindsight experience replay from reinforcement learning for language model agents. ECHO generates optimized trajectories for alternative goals that could have been achieved during failed attempts, effectively creating synthetic positive examples from unsuccessful interactions. Our approach consists of two components: a hindsight rule that uses the language model itself to identify relevant subgoals and generate optimized trajectories, and an update rule that maintains compressed trajectory representations in memory. We evaluate ECHO on stateful versions of XMiniGrid, a text-based navigation and planning benchmark, and PeopleJoinQA, a collaborative information-gathering enterprise simulation. Across both domains, ECHO outperforms vanilla language agent baselines by up to 80%; in XMiniGrid, it also outperforms a number of sophisticated agent architectures including Reflexion and AWM, demonstrating faster adaptation to novel environments through more effective utilization of past experiences.

Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Placed in Agent memory systems, one of 16 directions in LLM agents and tool use. Builds on 21 of its 27 references that are in the map. First posted on arXiv 11 Oct 2025.

Builds on

21 of 27 references.

References · 21

  1. 2022ReAct: Synergizing Reasoning and Acting in Language Modelscited by 8,695
  2. 2024GPT-4o System Cardcited by 4,588
  3. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  4. 2023Toolformer: Language Models Can Teach Themselves to Use Toolscited by 4,182
  5. 2023WebArena: A Realistic Web Environment for Building Autonomous Agentscited by 2,006
  6. 2023AgentBench: Evaluating LLMs as Agentscited by 1,267
  7. 2017Hindsight Experience Replaycited by 1,136
  8. 2015Prioritized Experience Replaycited by 1,099
  9. 2023ChatDev: Communicative Agents for Software Developmentcited by 919
  10. 2023ExpeL: LLM Agents Are Experiential Learnerscited by 876
  11. 2023Cognitive Architectures for Language Agentscited by 429
  12. 2024Agent Workflow Memorycited by 383
9 more
  1. 2023Can Large Language Models Transform Computational Social Science?cited by 250
  2. 2023Synapse: Trajectory-as-Exemplar Prompting with Memory for Computer Controlcited by 187
  3. 2025Measuring AI Ability to Complete Long Software Taskscited by 156
  4. 2025Inducing Programmatic Skills for Agentic Taskscited by 111
  5. 2023Synthetic Experience Replaycited by 101
  6. 2023XLand-MiniGrid: Scalable Meta-Reinforcement Learning Environments in JAXcited by 55
  7. 2024BAGEL: Bootstrapping Agents by Guiding Exploration with Languagecited by 34
  8. 2024CodeIt: Self-Improving Language Models with Prioritized Hindsight Replaycited by 23
  9. 2023Interpreting User Requests in the Context of Natural Language Standing Instructionscited by 5

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. 2026From Outcomes to Actions: Leveraging Hindsight for Long-Horizon Language Agent Training
  2. 2026Spinning Straw into Gold: Relabeling LLM Agent Trajectories in Hindsight for Successful Demonstrations
  3. 2026Experience is the Best Teacher: Motivating Effective Exploration in Reinforcement Learning for LLMs
  4. 2026Experience Funnel: A State-Policy Alternating Loop for Self-Evolving Agents
  5. 2026ECHO: Prune To Act, Trace To Learn With Selective Turn Memory In Agentic RL
  6. 2026LifeMem: Enabling Lifelong Experience Reuse for LLM Agents
  7. 2026MemCo: Memory-Centric Collaboration for Generalizing LLM Agents to Unseen Environments
  8. 2025H2R: Hierarchical Hindsight Reflection for Multi-Task LLM Agents