From Player to Master: Enhancing Test-Time Learning of LLM Agents via Reinforcement Learning over Memory

Yishuo Cai, Xingyu Guo, Xuancheng Huang, Jinhua Du, can huang, Wenxuan Huang, Wenhan Ma, Yuyang Hu, Aohan Zeng, Jie Tang, Xu Sun

Abstract Large Language Model (LLM) agents are increasingly deployed in long-running environments where they must learn and adapt from experience—a capability known as Test-Time Learning (TTL). Traditional approaches rely on appending extensive interaction histories or using hand-designed prompting rules to update an explicit memory. However, these methods often fail to align memory updates with downstream objectives over multi-step horizons. Enter MemoPilot, a plug-in memory copilot that explicitly trains the memory update process using reinforcement learning, enabling frozen LLMs to rapidly adapt and outperform proprietary models in complex sequential tasks.

The Challenge of Test-Time Learning

When LLM agents operate in continuous, multi-turn environments, they need a mechanism to remember past interactions and adjust their strategies. Currently, most agents handle this by either stuffing the entire interaction history into the prompt or relying on hand-crafted "reflection" heuristics to summarize past events.

Both approaches have significant drawbacks. Appending full histories introduces noise and incurs high computational costs. Conversely, hand-designed reflection rules often miss critical, task-specific nuances. For instance, in a game of Poker, a generic summary might overlook a subtle betting pattern that reveals an opponent's bluff. There is a fundamental gap in how we train agents to manage their internal "cheat sheets" to maximize performance over multiple interactions.

Introducing MemoPilot

To bridge this gap, researchers introduce MemoPilot, a plug-in module that manages an evolving memory state for a frozen "player" LLM. Instead of relying on fixed prompts, MemoPilot treats memory updating as a multi-turn decision problem and optimizes it end-to-end using Group Relative Policy Optimization (GRPO).

The architecture introduces several key technical innovations:

  • 3-Tier Structured Memory: Rather than a monolithic block of text, the memory is divided into three actionable components: Identification (diagnosing the opponent's strategy), Maintenance (a belief state with confidence scores), and Guidance (actionable rules for the player).
  • Turn-Wise Reward Signal: Instead of waiting for the end of a long episode to assign rewards, the model receives a "one-step proxy" reward based on the immediate next game's outcome. This significantly reduces the noise inherent in stochastic environments like card games.
  • Turn-Level Advantage Estimation: The researchers adapted GRPO to calculate advantages at the turn level across parallel rollouts, stabilizing training across complex, multi-step horizons.

Experimental Setup and Key Findings

MemoPilot was evaluated across three distinct testbeds: Multi-round Rock-Paper-Scissors (RPS), Limit Texas Hold’em (LHE), and StreamBench (a benchmark for continuous improvement in real-world tasks like SQL generation and Python coding).

The results demonstrate that MemoPilot substantially improves the test-time learning of frozen players:

  • State-of-the-Art Performance: MemoPilot ranked first in head-to-head Elo ratings, achieving 1762 on LHE and 1590 on RPS. It successfully outperformed all baseline memory methods and proprietary models, including DeepSeek-V3.2 and Gemini-3.0-Flash.
  • Rapid Adaptation: Learning dynamics show that MemoPilot-equipped agents experience a sharp performance jump within the first 2-3 games of an encounter. In contrast, baseline methods like Reflexion or ExpeL show much slower or stagnant improvement.
  • Cross-Domain Generalization: On StreamBench, MemoPilot improved accuracy (pass@4) to 73.5% on CoSQL and 56.3% on DS-1000, proving the framework's utility far beyond gaming contexts.

Strategic Insights

The study revealed several fascinating behaviors learned by the agent. First, selective memory consistently outperforms full history, as MemoPilot learns to compress experience into actionable strategic guidance rather than noisy logs. Second, the agent naturally developed a "hypothesize-and-verify" cycle. Through RL, it learned to be conservative—waiting for sufficient evidence before committing to a counter-strategy, thereby preventing overreactions to a single lucky or unlucky hand. Finally, the memory representations proved highly transferable: a memory model trained to assist a smaller 14B parameter model successfully "up-leveled" a much larger, frozen 235B parameter model without any additional training.

Limitations and Future Work

While MemoPilot represents a significant step forward, the authors note a few limitations. The system currently relies on a clear, objective reward signal (e.g., chips won or code passing tests), which may be difficult to define in "fuzzy" real-world interactions. Additionally, the experiments utilized a fixed 512-token memory budget; extremely long-term interactions might eventually require more sophisticated hierarchical compression or "forgetting" mechanisms. Finally, if an opponent changes their strategy faster than the agent's hypothesize-and-verify cycle can update, the memory can become temporarily stale.

Future research will likely explore denser training signals, such as trajectory-quality rubrics, to help agents learn in environments where success and failure are less immediately obvious.

Summary updated

BibTeX
@inproceedings{cai2026from,
  author = {Yishuo Cai and Xingyu Guo and Xuancheng Huang and Jinhua Du and can huang and Wenxuan Huang and Wenhan Ma and Yuyang Hu and Aohan Zeng and Jie Tang and Xu Sun},
  title = {{From Player to Master: Enhancing Test-Time Learning of LLM Agents via Reinforcement Learning over Memory}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=gNWNtstp3r},
}
Figure