Large Language Model Is Semi-Parametric Reinforcement Learning Agent

Danyang Zhang, Lu Chen, Situo Zhang, Hongshen Xu, Zihan Zhao, Kai Yu

Abstract

Current Large Language Model (LLM) agents often struggle with long-term learning and cross-task experience transfer. This paper introduces REMEMBERER, a framework that transforms LLMs into semi-parametric reinforcement learning agents. By utilizing Reinforcement Learning with Experience Memory (RLEM), the agent maintains a persistent, long-term experience memory that evolves through interaction without requiring expensive weight fine-tuning.

Introduction: The Memory Gap in LLM Agents

While LLMs exhibit remarkable reasoning capabilities, they typically lack the ability to "learn from doing" in a persistent manner. Existing methods generally fall into two categories: computationally intensive fine-tuning or transient in-context learning (working memory). In the latter, once a task concludes, the acquired knowledge is lost.

Comparison between short-term goal-aware working memory and long-term cross-goal experience memory.

The authors identify a critical need for a long-term episodic memory that allows agents to transfer experiences across different goals and permanently evolve their capabilities. REMEMBERER addresses this by treating past trajectories as a searchable library, mimicking human expertise where reasoning is often a form of remembering.

Methodology: The REMEMBERER Framework

The REMEMBERER framework consists of two primary pillars: a structured Experience Memory and the RLEM update mechanism. The Experience Memory stores task information, observations, actions, and their associated Q-values—the expected future rewards.

The operational workflow of the REMEMBERER framework involving retrieval, execution, and memory updates.

The RLEM Workflow

  1. Retrieval: Upon receiving a new observation, the agent retrieves the most relevant past experiences from its memory.
  2. Action Advice: These experiences are injected into the prompt as "Action Advice," categorizing past moves into Encouraged (high Q-value) and Discouraged (low/zero Q-value) actions.
  3. Execution & Update: The LLM selects an action and receives environmental feedback. RLEM then updates the Q-values in the external memory using the Bellman equation and n-step bootstrapping, allowing the system to "evolve" parametrically while the LLM remains frozen.

Key Insights

  • Semi-Parametric Advantage: By keeping the LLM weights fixed (non-parametric) and evolving the external memory (parametric), the agent combines the learning power of RL with the flexibility of few-shot prompting.
  • The Power of Discouragement: Explicitly informing the LLM about past failures ("Discouraged Actions") is highly effective in preventing the repetition of mistakes in similar contexts.
  • Sample Efficiency: REMEMBERER demonstrates extreme efficiency, showing significant performance gains after training on as few as 10 tasks for 74 steps, far outperforming traditional RL methods.

Evaluation and Results

The framework was evaluated on WebShop (e-commerce navigation) and WikiHow (mobile app instruction following).

  • Performance: REMEMBERER achieved state-of-the-art results, outperforming the ReAct baseline by 2% on WebShop and 4% on WikiHow in success rate.
  • Robustness: The system is less sensitive to initial exemplars. Its ability to learn from experience allows it to recover from poor initializations that typically cause standard LLM agents to fail.
  • Reward Estimation: Ablation studies confirmed that n-step bootstrapping significantly improves reward estimation accuracy, validating the effectiveness of the RL component.

Conclusion and Future Directions

REMEMBERER provides a scalable path toward persistent LLM agents. However, limitations remain, such as performance saturation due to context window constraints and the focus on text-heavy tasks. Future work may involve integrating more advanced RL algorithms and extending the framework to multimodal environments with visual observations and longer-term dependencies.

Summary updated

BibTeX
@inproceedings{zhang2023large,
  author = {Danyang Zhang and Lu Chen and Situo Zhang and Hongshen Xu and Zihan Zhao and Kai Yu},
  title = {{Large Language Model Is Semi-Parametric Reinforcement Learning Agent}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=ZcJa1R6j3v},
}
Figure