Toward Efficient Exploration by Large Language Model Agents

Dilip Arumugam, Thomas L. Griffiths

Introduction

A central challenge in reinforcement learning (RL) is the exploration-exploitation trade-off: an agent must decide whether to exploit known strategies for immediate reward or explore new actions to uncover potentially better long-term outcomes. While Large Language Models (LLMs) have shown significant promise as autonomous decision-making agents, they frequently struggle with strategic exploration. Approaches relying on simple prompting, in-context learning, or frameworks like "Reflexion" often result in greedy behavior, where agents prioritize short-term gains and fail to systematically uncover hidden rewards in complex environments.

Conversely, classic RL literature offers mathematically rigorous algorithms to handle exploration, but these rely on technical machinery—such as probability distributions and value functions—that is difficult to translate into unstructured natural language. To bridge this gap, recent research proposes using LLMs not as implicit RL agents, but as modular subroutines to explicitly implement a proven algorithm: Posterior Sampling for Reinforcement Learning (PSRL).

Methodology: LLMs as Modular RL Components

Rather than coaxing an LLM to "act" like an exploring agent, the authors deconstruct PSRL into functional blocks and assign each to an LLM. PSRL is a classic Bayesian algorithm that operates in three distinct steps, which are translated entirely into natural language:

  1. The Posterior Updater: The LLM processes the history of interactions to generate a textual summary of the agent's "epistemic state"—what is currently known and what remains uncertain about the environment.
  2. The Posterior Sampler: Reading this summary, the LLM generates a single, concrete hypothesis about the world (e.g., "The secret code is likely 1-2-3").
  3. The Optimal Policy: Based on the sampled hypothesis, the LLM determines the optimal action to take, acting as if this hypothesis is the absolute truth for the duration of the episode.

By outsourcing these specific Bayesian steps to LLMs, the agent follows a mathematically sound exploration strategy (Thompson Sampling) translated into text, rather than relying on unstructured guessing.

Experimental Setup

The researchers evaluated this LLM-based PSRL approach across several environments that demand prudent exploration:

  • Multi-Armed Bandits: Including a standard 5-armed Bernoulli bandit and a simulated "Customer Service" bandit.
  • RiverSwim: A classic "hard exploration" RL benchmark where an agent must continuously swim upstream against a current to discover a large reward.
  • Combination Lock: A task requiring the agent to deduce a 3-digit code with minimal feedback.
  • Wordle: The popular word-guessing game, framed as a natural language Markov Decision Process (MDP).

Key Findings and Insights

The empirical results demonstrate that explicitly implementing known, data-efficient RL algorithms is considerably more effective than relying on implicit LLM behaviors.

  • Explicit Over Implicit: The primary takeaway is that LLMs should be used to perform the atomic steps of provably efficient algorithms rather than being expected to implicitly discover them through prompting.
  • Mastering Hard Exploration: In the RiverSwim environment, the LLM-based PSRL agent achieved "sub-linear regret," successfully learning the optimal strategy. In contrast, baseline LLM agents failed to ever reach the upstream reward.
  • Efficiency in Natural Language Tasks: In Wordle, the PSRL agent proved more token-efficient and consistent at identifying target words in fewer turns compared to In-Context RL (ICRL) baselines. In the Combination Lock task, it systematically tested unknown digits instead of getting stuck repeating known ones.
  • The Power of Natural Language Priors: Using LLMs allows designers to inject complex priors in plain English (e.g., "The target word is likely a common English noun"), bypassing the need to define complex mathematical distributions.
  • Model Reasoning Capabilities: The study found that "reasoning" models, such as OpenAI’s o1-mini, significantly outperformed standard models like GPT-4o in stochastic environments. The additional reasoning tokens enabled the model to better handle the planning and probability-matching required for PSRL.

Limitations and Future Directions

Despite its successes, the approach faces several limitations. As environments grow in complexity (e.g., a longer river in RiverSwim), the textual descriptions of the world become overly verbose, degrading the LLM's ability to plan. Furthermore, while reasoning models improve performance, LLMs still struggle with value-based planning in highly stochastic environments, occasionally misinterpreting probabilities or forgetting specific state transitions.

Cost is another practical barrier, as running these modular agents requires multiple API calls per step. Future work will need to focus on optimizing token efficiency. Finally, the authors suggest exploring more advanced exploration strategies beyond Thompson Sampling, such as Information-Directed Sampling (IDS), which showed potential to outperform PSRL in specific, highly informative tasks.

Summary updated

BibTeX
@inproceedings{arumugam2026toward,
  author = {Dilip Arumugam and Thomas L. Griffiths},
  title = {{Toward Efficient Exploration by Large Language Model Agents}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=M3vwnscpL2},
}
Figure