Natural Language Reinforcement Learning

Xidong Feng, Bo Liu, Ziyu Wan, Haotian Fu, Girish A. Koushik, Zhiyuan Hu, Mengyue Yang, Ying Wen, Jun Wang

TL;DR

This paper introduces Natural Language Reinforcement Learning (NLRL), a novel paradigm that reformulates Reinforcement Learning (RL) principles using natural language. By leveraging Large Language Models (LLMs), NLRL aims to make RL more intuitive, interpretable, and efficient, especially in complex scenarios where traditional RL struggles.

What Problem Does This Paper Address?

Traditional Reinforcement Learning (RL) relies on mathematical frameworks like Markov Decision Processes (MDPs) to solve decision-making problems. While successful, these methods often lack task-specific prior knowledge, require extensive data for learning environment dynamics, and their decision-making processes are notoriously opaque. Humans, on the other hand, excel at using natural language to understand tasks, devise strategies, and communicate reasoning. This paper addresses the gap by proposing a way to integrate this human-like language-based reasoning into RL, making it more accessible and powerful. The authors aim to overcome the limitations of traditional RL by harnessing the emergent capabilities of LLMs to interpret and generate language-based representations of RL concepts.

Methods

The core innovation is Natural Language Reinforcement Learning (NLRL), which reinterprets RL components (task objectives, policies, value functions, Bellman equations, policy iteration) as language-based constructs. This is achieved by leveraging Large Language Models (LLMs) in several ways:

  • Text-based MDP: Traditional MDPs are translated into a text-based representation where states, actions, and environment feedback are described in natural language.
  • Language Policy: Instead of directly outputting action probabilities, LLMs are prompted to generate "chain-of-thought" reasoning, leading to more strategic action selection.
  • Language Value Function: LLMs are used to evaluate states and state-action pairs using natural language descriptions, providing richer information than scalar values.
  • Language Bellman Equation: Analogous to the traditional Bellman equation, a language-based version is proposed to relate state values through language descriptions of intermediate transitions and future evaluations.
  • Language Generalized Policy Iteration (GPI): The paper outlines how GPI can be implemented using LLMs for both policy evaluation (using language Monte Carlo or Temporal Difference estimates) and policy improvement.

The authors propose three specific algorithms:

  1. Language GPI by Prompting: Enhances LLM critic and policy using only prompting.
  2. Training Natural Language Value Function: Trains an LLM critic to evaluate states with natural language explanations.
  3. Natural Language Actor-Critic Learning: Combines policy and value learning in a natural language framework.

Datasets

The experiments were conducted on three game environments:

  • Maze: Using the LMRL Gym environment, which provides text-based observations of the agent's position, goal, and walls.
  • Breakthrough: A 5x5 board game where the environment is textualized.
  • Tic-Tac-Toe: A standard two-player game environment.

No new benchmarks were introduced; instead, existing game environments were adapted to a text-based representation suitable for NLRL.

Key Insights and Ideas

  • LLMs as a Natural Interface for RL: The paper demonstrates that LLMs can effectively act as the "brain" for RL agents, translating complex decision-making processes into human-understandable language. This opens up possibilities for more intuitive agent design and debugging.
  • Interpretable Decision-Making: By generating "thoughts" and detailed evaluations, NLRL provides insights into why an agent makes a particular decision, a significant improvement over the black-box nature of many traditional RL models.
  • Leveraging Language for Efficiency and Stability: Natural language feedback and prior knowledge embedded in LLMs can potentially lead to faster learning and more stable training compared to RL methods that rely solely on sparse, scalar rewards.
  • Bridging the Gap Between Human and AI Reasoning: NLRL offers a path towards agents that can not only perform tasks but also explain their reasoning in a way that humans can readily comprehend and even collaborate with.

Key Results

  • Maze Experiment: Language GPI (LGPI) with language TD estimation showed better performance than prompt-based language policy and language value function baselines, with more variations and look-ahead steps leading to improved results.
  • Breakthrough Experiment: The trained language value function achieved significantly higher evaluation accuracy (0.87 on the test set) compared to prompting-based LLMs (around 0.61), demonstrating the effectiveness of language TD training for board evaluation.
  • Tic-Tac-Toe Experiment: The Natural Language Actor-Critic pipeline outperformed baselines, including a PPO agent fine-tuned on LLaMA-3.1-8B-Instruct, showing substantial improvements in win rates. Ablation studies indicated that components like Monte Carlo sampling, buffer merging, and action selection masks enhance performance.

Limitations and Future Work

Limitations: * Discrete Action Spaces and Low-Dimensional States: Current experiments are primarily in discrete action spaces and textualizable states. Performance on continuous action spaces and high-dimensional states (e.g., robotics) is unexplored. * Computational Cost: Invoking LLMs is computationally expensive, making NLRL significantly slower than traditional RL methods with smaller networks.

Future Work: * Theoretical Foundation: Developing a formal theoretical basis for NLRL in the language space is crucial to move beyond analogical reasoning. * Integration with Existing LLM Research: Exploring how NLRL can be integrated with self-evaluation, self-improvement, LLM agent frameworks, and planning techniques. * Broader Application Domains: Extending NLRL to domains beyond games, such as reasoning tasks and code generation.

Summary updated

BibTeX
@inproceedings{feng2025natural,
  author = {Xidong Feng and Bo Liu and Ziyu Wan and Haotian Fu and Girish A. Koushik and Zhiyuan Hu and Mengyue Yang and Ying Wen and Jun Wang},
  title = {{Natural Language Reinforcement Learning}},
  booktitle = {SSI-FM @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=wzlDTzqPu3},
}
Figure