MAGE: Meta-Reinforcement Learning for Language Agents toward Strategic Exploration and Exploitation
Organizations: Tsinghua University
Abstract
Large Language Model (LLM) agents have demonstrated remarkable proficiency in learned tasks, yet they often struggle to adapt to non-stationary environments with feedback. While In-Context Learning and external memory offer some flexibility, they fail to internalize the adaptive ability required for long-term improvement. Meta-Reinforcement Learning (meta-RL) provides an alternative by embedding the learning process directly within the model. However, existing meta-RL approaches for LLMs focus primarily on exploration in single-agent settings, neglecting the strategic exploitation necessary for multi-agent environments. We propose MAGE, a meta-RL framework that empowers LLM agents for strategic exploration and exploitation. MAGE utilizes a multi-episode training regime where interaction histories and reflections are integrated into the context window. By using the final episode reward as the objective, MAGE incentivizes the agent to refine its strategy based on past experiences. We further combine population-based training with an agent-specific advantage normalization technique to enrich agent diversity and ensure stable learning. Experiment results show that MAGE outperforms existing baselines in both exploration and exploitation tasks. Furthermore, MAGE exhibits strong generalization to unseen opponents, suggesting it has internalized the ability for strategic exploration and exploitation. Code is available at https://github.com/Lu-Yang666/MAGE.
Figures & tables
| Category | Method | Multi-Agent Tasks | Single-Agent Tasks | |||
|---|---|---|---|---|---|---|
| Kuhn Poker | Tic-Tac-Toe | ALFWorld | Sokoban | WebShop | ||
| In-Context Learning | ReAct | 0.648 | 0.039 | 0.234 | 0.383 | 0.039 |
| Reflexion | 0.648 | 0.242 | 0.391 | 0.438 | 0.039 | |
| Memory-based | A-MEM | 0.641 | 0.016 | 0.375 | 0.367 | 0.000 |
| Memento | 0.641 | 0.031 | 0.336 | 0.336 | 0.000 | |
| RL | GRPO | 0.648 | 0.219 | 0.836 | 0.602 | 0.711 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Hyperparameter | Value |
|---|---|
| Actor Learning Rate | |
| PPO Mini-batch Size | 64 |
| PPO Micro-batch Size (per GPU) | 8 |
| Log-prob Micro-batch Size (per GPU) | 16 |
| Sampling Temperature | 0.7 |
| Top- / Top- | 0.8 / 20 |
| Reflection | Agent Response |
|---|---|
| Reflection summarizing errors and strategic guidance. | Action generated by the agent after internalizing the reflection. |
| The key mistakes in the past trial were: 1. Invalid moves (e.g., (-1,-1)) that disrupted the game state. 2. Poor initial strategy … Improved Plan: Start with the center (2,2) to maximize control and opportunities for winning. … | </think> … The improved plan says to start with the center (2,2) because that’s the best move for maximizing control and opportunities. So first move should be (2,2). … </think> |
| Agent Response |
|---|
| The agent explicitly considers multiple plausible opponent strategies rather than assuming a fixed policy, and selects an action that is robust under strategic uncertainty. |
| </think> |
| … So, what’s the possible scenario here? Case 1: Player 0 has King. … Case 2: Player 0 has Jack. … So, in this case, it’s better to bet . … Wait, but that’s not necessarily the case. If Player 0 has a King, then they have a strong hand. If they bet, that’s a strong move. But if Player 0 has a Jack, then they might bet as well . … |
| </think> |
RL for LLM Agents
Reinforcement learning for large language model agents trains models to plan, use tools, and adapt through feedback from interactive tasks.
See all 570 papers