Unleashing the Power of Pre-trained Language Models for Offline Reinforcement Learning

Ruizhe Shi, Yuyao Liu, Yanjie Ze, Simon Shaolei Du, Huazhe Xu

TL;DR

LaMo (Language Models for Motion Control) is a novel framework that repurposes pre-trained Large Language Models (LLMs) as the backbone for offline reinforcement learning (RL). By combining parameter-efficient fine-tuning via LoRA, non-linear state-action embeddings, and an auxiliary language loss, LaMo achieves state-of-the-art performance in sparse-reward tasks and demonstrates remarkable few-shot learning capabilities in data-scarce environments.

Introduction: The Challenge of Offline RL

Offline reinforcement learning aims to learn optimal policies from fixed, pre-collected datasets without any further environment interaction. This paradigm is crucial for real-world scenarios—such as robotics or healthcare—where active data collection is expensive, time-consuming, or risky.

Recently, the Decision Transformer (DT) architecture reframed RL as a sequence modeling problem, allowing it to leverage the same Transformer architecture that powers modern LLMs. However, standard DT models are notoriously "data-hungry." They often struggle to match the performance of traditional value-based methods (like Conservative Q-Learning, or CQL) when rewards are sparse or when the available dataset is small. This paper investigates whether the massive amount of knowledge and sequential modeling prowess already baked into pre-trained LLMs can be "unleashed" to solve physical motion control problems more efficiently.

The LaMo Framework

To adapt a pre-trained language model (specifically GPT-2) for offline RL, the authors introduce the LaMo framework, which relies on four key design choices:

  1. LLM Initialization: Instead of training a Decision Transformer from scratch, the model is initialized with weights from a pre-trained GPT-2 model, providing a strong prior for sequence modeling.
  2. LoRA Fine-tuning: Rather than updating all weights—which can lead to overfitting or catastrophic forgetting of pre-trained knowledge—LaMo employs Low-Rank Adaptation (LoRA). This parameter-efficient method trains only a tiny fraction of the model's parameters while keeping the core Transformer frozen.
  3. Non-linear MLP Projections: Standard DT uses simple linear layers to map environment states, actions, and returns into the Transformer's embedding space. LaMo replaces these with 3-layer Multi-Layer Perceptrons (MLPs) to better bridge the modality gap between continuous physical sensor data and the high-dimensional discrete space the LLM expects.
  4. Auxiliary Language Loss: To stabilize training and prevent the model from losing its general sequence modeling abilities, LaMo is simultaneously co-trained on a small amount of language data (WikiText) during the RL fine-tuning stage.
The LaMo architecture utilizes a frozen pre-trained Transformer with LoRA fine-tuning and non-linear MLP embeddings to process RL trajectories.

Key Insights

  • Cross-Domain Knowledge Transfer: Proficiency in modeling language sequences translates surprisingly well to modeling physical trajectories. The "sequential logic" learned from text provides a powerful inductive bias for motion control.
  • The "Freezing" Paradox: Full-weight fine-tuning actually hurts performance in this context. By freezing the core Transformer layers and using LoRA, the model retains its "common sense" sequence priors while adapting efficiently to the new domain.
  • Bridging the Domain Gap: The transition from linear to non-linear (MLP) embeddings is essential. It acts as a more sophisticated "translator" between the language model's internal representations and the physical environment's dynamics.

Empirical Results

The researchers evaluated LaMo on the standard D4RL benchmark across distinct domains, including MuJoCo (continuous control), Atari (discrete control from pixels), and Kitchen (complex, sparse-reward manipulation).

LaMo achieved state-of-the-art results in several key areas:

  • Sparse-Reward Tasks: In the challenging Kitchen domain, LaMo outperformed standard DT by a wide margin and significantly beat value-based baselines like CQL.
  • Dense-Reward Tasks: It successfully closed the performance gap that previously existed between Transformer-based methods and top-tier value-based methods in Atari and MuJoCo environments.
  • Low-Data Regime: Perhaps most impressively, LaMo demonstrates a "few-shot" ability akin to LLMs in text tasks. Its performance is highly robust to data scarcity, maintaining high scores even when using only a tiny fraction (e.g., 1% to 10%) of the available dataset—a regime where standard DT and CQL performance typically collapses.
LaMo maintains superior performance even as the available data sample ratio drops significantly, highlighting its robustness in data-scarce regimes.

Limitations and Future Work

While LaMo represents a significant step forward for sequence-based RL, the authors note a few areas for future exploration:

  • Dense-Reward MuJoCo: In environments with abundant data and dense rewards, traditional value-based methods like CQL remain highly competitive.
  • Scaling Up: This work primarily utilized GPT-2. While the authors experimented with larger models like LLaMA, they did not observe immediate performance gains, suggesting that effectively scaling LLMs for RL requires further research into specialized fine-tuning strategies.
  • Reasoning Capabilities: Future work could explore how to leverage the explicit reasoning capabilities of LLMs (e.g., through chain-of-thought prompting) rather than relying solely on their sequence modeling backbone.

Summary updated

BibTeX
@inproceedings{shi2024unleashing,
  author = {Ruizhe Shi and Yuyao Liu and Yanjie Ze and Simon Shaolei Du and Huazhe Xu},
  title = {{Unleashing the Power of Pre-trained Language Models for Offline Reinforcement Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=AY6aM13gGF},
}
Figure