Sample-Efficient Online Learning in LM Agents via Hindsight Trajectory Rewriting
Hu, Van Durme, Andreas et al.
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.
言語モデル(LM)エージェントを新しい環境に配置する際、逐次相互作用学習においてサンプル効率が低いという課題が生じている。これは、人間との相互作用や物理システムのリセットなど、相互作用コストが高い環境でのエージェントの実用性を大きく阻害している。既存のLMエージェントアーキテクチャは、様々な経験保存および反省メカニズムを組み込んでいるが、LMが直接生成または推論する完全な反事実軌跡の能力の活用は限定的である。本論文では、強化学習における後知恵経験リプレイを言語モデルエージェントに適応させるプロンプトフレームワークであるECHO(Experience Consolidation via Hindsight Optimization)を提案する。ECHOは失敗した試行で達成可能な代替目標に対して最適化された軌跡を生成し、不成功な相互作用から合成的な正例を効果的に作成する。本手法は2つのコンポーネントから構成される:言語モデル自体を使用して関連するサブ目標を特定し最適化軌跡を生成する後知恵ルール、およびメモリ内で圧縮された軌跡表現を維持する更新ルールである。