Decision Making as Language Generation

Roland Memisevic, Sunny Panchal, Mingu LeeFMDM @ NeurIPS 2022

TL;DR

This paper proposes treating decision transformers, a recent approach to offline reinforcement learning, as pure language models. By doing so, they enable leveraging pre-trained language models and data-centric techniques to improve performance, particularly in handling reward mismatches, and open doors for transfer learning across tasks.

What Problem Does This Paper Address?

Decision transformers (DTs) have shown promise in offline reinforcement learning (RL) by framing decision-making as a sequence modeling problem using transformer architectures. However, current DT approaches often treat the model as an RL-specific architecture with task-specific components, limiting their ability to benefit from the generalizability and transfer learning capabilities seen in large language models (LLMs). A key challenge highlighted is the "reward-mismatch" problem: at inference time, it's often unknown what achievable return to prompt the DT with, leading to poor performance. This paper aims to bridge this gap by treating DTs as general-purpose language models, enabling them to leverage pre-training and data-centric methods to overcome these limitations.

Methods

The core idea is to re-purpose pre-trained language models as decision transformers without task-specific heads or tokens. This involves:

  • Encoding: Representing states, actions, and returns as text sequences. The paper found simple comma-separated notation to be effective.
  • Environment-Model Interaction: The environment continuously monitors the model's output for well-formed actions. A regular expression is used to parse actions, and the environment then generates the next state and reward, feeding them back into the model's sequence. This is referred to as "environment forcing."
  • Training on Crops: To mitigate "exposure bias" (where the model sees token sequences during inference that are rare or absent during training), the training data is pre-processed by generating random "crops" of sub-sequences at the character level. This ensures the model is exposed to a wider variety of sequence beginnings and endings.
  • Addressing Reward Mismatch: The authors propose a data-centric approach. Before training, the first return encoding in the training data is perturbed to be overly optimistic (i.e., a higher return than achievable). This encourages the model to learn to approximate the achievable return, effectively changing the prompt's semantics from "trajectory selection" to "return request."

Datasets

The experiments were conducted on a shortest path problem. The authors generated random graphs with 20 nodes and varying levels of sparsity. Training data consisted of 60k sequences of random traversals (30 steps each) from these graphs. No new benchmarks were introduced; the focus was on applying existing techniques to a standard RL testbed.

Key Insights and Ideas

  • DTs as General Language Models: Treating decision transformers as pure language models unlocks the potential for pre-training on vast text corpora and applying data-centric improvements, mirroring the success of LLMs.
  • Data-Centric Reward Mismatch Solution: The proposed method of "perturbing" return prompts in the training data offers a simple yet effective way to handle the reward-mismatch problem without architectural changes. It shifts the model's behavior from selecting a trajectory based on a prompt to actively requesting a return.
  • Exposure Bias Mitigation: The "training on crops" technique is a straightforward yet powerful way to expose the model to a wider range of sequence transitions, improving its robustness during inference.

Key Results

The paper demonstrates the viability of their approach on a shortest path problem.

  • The language-only decision transformer ("DT" in Figure 1) achieved significantly higher average returns compared to a random walk baseline.
  • The DT's performance was competitive with, and in some cases surpassed, the optimal performance obtained by Bellman-Ford, especially at higher sparsity levels.
  • Figure 2 shows that the "w/ return perturbation" model (trained with the proposed reward mismatch solution) achieved a much better correlation between prompted and obtained returns, especially for higher prompted returns, compared to the model trained without perturbation. This indicates the model successfully learned to approximate achievable returns.

Limitations and Future Work

  • Limited Task Scope: The current study is limited to a shortest path problem. The authors suggest future work should explore more challenging tasks to fully assess the potential of pre-trained language models for decision-making.
  • Mixing Objectives: The paper notes that pre-trained language models could potentially be used to mix RL objectives with other NLP tasks, which could be beneficial for developing more generalist agents.
  • Data-Driven Stochasticity Handling: Exploring data-driven approaches (as opposed to architectural ones) to deal with environment stochasticity is suggested.
  • Interleaving Text and Actions: The authors propose investigating the interleaving of language-based reasoning with action emissions, potentially allowing for adaptive computation time in complex tasks.

Summary updated

BibTeX
@inproceedings{memisevic2022decision,
  author = {Roland Memisevic and Sunny Panchal and Mingu Lee},
  title = {{Decision Making as Language Generation}},
  booktitle = {FMDM @ NeurIPS},
  year = {2022},
  url = {https://openreview.net/forum?id=N47cSU036T},
}
Figure