Abstract
This paper introduces Transformer Dynamics Models (TDMs), a novel approach to robotic control that leverages the sequence-modeling capabilities of Transformers to learn the underlying physics of environments. Unlike traditional methods that focus on learning direct policies (mapping observations to actions), TDMs learn a unified "physics engine" capable of predicting future states and rewards. We demonstrate that TDMs serve as highly effective world models, exhibiting remarkable zero-shot and few-shot generalization to entirely new robot morphologies, significantly outperforming traditional behavioral cloning policies in their ability to adapt to unseen systems.
Introduction
In the field of robotics, the development of a generalist agent—a single model capable of operating across diverse robots and tasks—remains a primary objective. While large-scale Transformer models have revolutionized natural language processing and computer vision, their application in control has largely been confined to policies.
This research argues that learning a dynamics model (predicting the next state $s_{t+1}$ given the current state $s_t$ and action $a_t$) is a more robust path toward generality. The underlying physics of movement are often more consistent across different robots than the optimal behavior required for a specific task. The core challenge addressed here is whether a single Transformer can learn a unified representation of physics that generalizes across robots with varying joints, limbs, and skeletal structures.
Methodology
The researchers adapted the Gato architecture—a multi-modal, multi-task Transformer—to function as a TDM. The approach involves several key components:
- Tokenization: Continuous observations, actions, and rewards are discretized into integer tokens. This allows the Transformer to treat control as a sequence-modeling problem, analogous to predicting the next word in a sentence.
- Autoregressive Prediction: The TDM is trained to predict the sequence of future tokens (states and rewards) given a history of past interactions and a sequence of candidate actions.
- Model Predictive Control (MPC): At test time, the model is embedded in an MPC loop. Instead of a learned policy, the system samples many random action sequences (using temporally correlated Brownian noise), uses the TDM to "imagine" the outcomes, and executes the first step of the sequence that yields the highest predicted reward.
- Generalist Training: The model is pre-trained on a massive dataset of trajectories from dozens of different environments to learn broad physical principles.
Datasets and Environments
The study utilizes two primary sources of data to evaluate the model's breadth and depth:
- DeepMind Control Suite: Standard benchmarks including Cartpole, Walker, and Humanoid. These were used for specialist training and few-shot fine-tuning experiments.
- Procedural Walker Universe: A newly introduced benchmark for "dense" environment coverage. It consists of procedurally generated locomotion agents with varying degrees of freedom (4 to 20) and diverse skeletal structures (Line, Chain, Bush, and Tree configurations). This dataset is crucial for testing zero-shot generalization to robots the model has never seen before.
Key Insights
- Dynamics Generalize Better than Policies: A striking finding is that a TDM generalizes to a new robot morphology much better than a Behavioral Cloning (BC) policy trained on the exact same data. The TDM can infer a new robot's physics through a short history of interaction, whereas policies often fail to adapt their behavior to structural changes.
- The "Foundation Model" for Control: By learning the joint distribution of states and actions across many environments, the TDM acts as a foundation model. It doesn't just memorize tasks; it learns a latent representation of system dynamics.
- Tokenization Benefits: Interestingly, even standard MLP baselines performed better when using tokenized inputs/outputs, suggesting that discretization helps models handle the complexities of multi-modal distributions in control data.
- Robustness to Data Quality: TDMs proved robust even when trained on "expert" data but tested with "random" actions. This distribution shift is usually a major failure point for world models, but the Transformer's capacity helps it extrapolate effectively.
Experimental Results
Few-Shot Efficiency
In the Cartpole environment, a pre-trained generalist TDM achieved the same performance as a model trained from scratch but required 2 to 3 orders of magnitude less data, succeeding with fine-tuning on just 10-100 episodes.
Zero-Shot Success
On 10 held-out "walker" morphologies never seen during training, the TDM achieved roughly 50% of the optimal reward zero-shot. In contrast, the BC policy version of the same model showed almost no generalization capability.
Specialist Performance
When trained as a specialist on a single complex task like Humanoid Stand (21 degrees of freedom), the TDM significantly outperformed established baselines like PETS and Dreamer V2.
Limitations and Future Work
Despite its success, the TDM faces challenges regarding inference speed. Transformers are computationally expensive; the current 77M parameter model predicts about 500 tokens per second, which can lead to environment step durations of several seconds—too slow for real-time hardware control. Additionally, while this work focused on state-based observations (joint angles, velocities), extending TDMs to pixel-based inputs via existing tokenization methods (like ViT) remains a promising area for future research. Finally, integrating TDMs with more sophisticated planners, such as the Cross-Entropy Method, could further enhance control performance.
Summary updated