Abstract
Reinforcement learning (RL) trains agents to accomplish complex tasks through environmental interaction data, but its capacity is also limited by the scope of the available data. To obtain a knowledgeable agent, a promising approach is to leverage the knowledge from large language models (LLMs). Despite previous studies combining LLMs with RL, seamless integration of the two components remains challenging due to their semantic gap. This paper introduces a novel method, Knowledgeable Agents from Language Model Rollouts (KALM), which extracts knowledge from LLMs in the form of imaginary rollouts that can be easily learned by the agent through offline reinforcement learning methods. The primary challenge of KALM lies in LLM grounding, as LLMs are inherently limited to textual data, whereas environmental data often comprise numerical vectors unseen to LLMs. To address this, KALM fine-tunes the LLM to perform various tasks based on environmental data, including bidirectional translation between natural language descriptions of skills and their corresponding rollout data. This grounding process enhances the LLM's comprehension of environmental dynamics, enabling it to generate diverse and meaningful imaginary rollouts that reflect novel skills. Initial empirical evaluations on the CLEVR-Robot environment demonstrate that KALM enables agents to complete complex rephrasings of task goals and extend their capabilities to novel tasks requiring unprecedented optimal behaviors. KALM achieves a success rate of 46% in executing tasks with unseen goals, substantially surpassing the 26% success rate achieved by baseline methods.
Introduction
Offline Reinforcement Learning is a powerful paradigm where agents learn from static, pre-collected datasets. However, these agents are often "data-starved," generally limited to performing skills explicitly present in their training data. While Large Language Models (LLMs) possess immense general knowledge and reasoning capabilities, they suffer from a semantic gap when applied to robotics: LLMs process discrete tokens, while robots operate on continuous numerical vectors.
The KALM Framework
The authors introduce KALM (Knowledgeable Agents from Language Model Rollouts), a framework that bridges this gap by grounding an LLM in a physical environment. This allows the LLM to generate "imaginary rollouts"—synthetic training data for novel tasks—which are then used to train offline RL agents.
LLM Grounding
To help the LLM (specifically Llama-2-7b) understand non-textual data, the researchers modified its architecture. They replaced standard input/output layers with Multi-Layer Perceptrons (MLPs) that map environmental vectors (states and actions) into the same embedding space as text tokens.
The LLM is fine-tuned on four primary tasks to ensure environmental comprehension:
- Dynamics Prediction: Predicting the next state given a current state and action.
- Rollout Explanation: Translating a sequence of vectors into a natural language description.
- Rollout Generation: Producing a vector sequence given a language goal.
- Consequence Prediction: Predicting the final state resulting from a specific goal.
Rollout Generation and Skill Acquisition
Once grounded, the LLM is prompted to "imagine" trajectories for tasks absent from the original RL dataset. This enables Paraphrastic Robustness (handling diverse wording) and Novel Task Generalization (creating behaviors for entirely new goals, such as "arrange all balls in a circle"). These synthetic rollouts are combined with the original offline dataset to train a standard offline RL algorithm, such as Conservative Q-Learning, to derive a final policy.
Experimental Results
Evaluations were conducted in the CLEVR-Robot environment, where an agent manipulates colored balls. The training set consisted of 100,000 simple rearrangement pairs, while testing involved complex, unseen goals generated by ChatGPT.
- Superior Generalization: KALM achieved a 46% success rate on tasks with unseen goals, nearly doubling the 26% success rate of baseline offline RL methods.
- Linguistic Robustness: The agent successfully processed complex natural language, such as "I can't stand the red ball ahead of the blue one. Could you switch the positions of them?"
- Zero-Shot Skill Emergence: The grounded LLM generated meaningful trajectories for complex arrangements (like circles or lines) that were never present in the original training data.
Discussion and Future Work
A key insight from this study is that LLMs are significantly better at acting as "world models" (predicting environment states) than as direct controllers (predicting actions). By using MLP adapters, the authors demonstrate that environmental vectors can be treated as another type of "token," avoiding the precision loss of full text translation.
Future work will look to extend KALM to visual observations (pixels) using vision encoders like CLIP and testing the framework in more diverse, high-dimensional environments beyond the CLEVR-Robot simulation.
Summary updated