Introduction
Recent advances in Reinforcement Learning (RL) have introduced "Trajectory Transformers"—models trained to predict sequences of states, actions, and rewards. Many of these models utilize a Masked Auto-Encoding (MAE) objective, learning to reconstruct missing segments of a trajectory. However, at test time, these models are often relegated to passive roles, acting as simple policy models that predict the next action based on the current state. This approach fails to exploit the model's internal "world model"—its capacity to predict environmental responses to specific actions.
The M3PC (Masked Model Predictive Control) framework addresses this underutilization by transforming pretrained bidirectional trajectory models (BTMs) into active planners. By enabling the model to "think ahead" and evaluate multiple potential futures, M3PC significantly enhances performance across offline RL, online finetuning, and zero-shot goal reaching without requiring additional training parameters.
Methodology: Masked Model Predictive Control
The core of M3PC is the use of a single pretrained BTM to perform Model Predictive Control (MPC) at test time. Rather than relying on a single fixed mask, M3PC employs an ensemble of mask patterns to unlock various capabilities within the same model:
- Action Proposals: A Return-Conditioned Behavior Cloning (RCBC) mask suggests potential actions.
- Forward Dynamics: A Forward Dynamics (FD) mask predicts future states resulting from those actions.
- Evaluation: A Reward and Return Prediction (RP) mask estimates the utility of the predicted futures.
Additionally, M3PC supports Backward Planning for goal-reaching tasks. Leveraging the bidirectional nature of the transformer, the model can "inpaint" waypoints from a current state to a distant goal. An Inverse Dynamics (ID) mask then determines the actions necessary to navigate this path. To ensure effective exploration, M3PC utilizes uncertainty-aware action reconstruction, training with a Negative Log Likelihood (NLL) loss to learn an action distribution rather than a point estimate.
Experimental Evaluation
M3PC was evaluated on several benchmarks, including D4RL Locomotion (Hopper, Walker2d, HalfCheetah) and RoboMimic Manipulation tasks (Can, Lift, Square). It was also tested on customized robotics tasks like can-lim and can-real to assess generalization and real-world applicability.
Key Results and Insights
M3PC demonstrates that a sufficiently trained masked transformer can serve as its own critic, inferring rewards and future states directly from learned patterns. Key findings include:
- Offline RL Performance: M3PC improves standard BTM performance by 6.0% on D4RL tasks, outperforming specialized algorithms like IQL and TD3+BC.
- Online Finetuning Efficiency: M3PC outperforms the state-of-the-art Online Decision Transformer (ODT) by 26.0%, demonstrating superior sample efficiency.
- Zero-Shot Generalization: The model can perform novel tasks, such as commanding a walker trained only for "walking" to perform "splits," simply by specifying a target goal state.
The unified representation of a "generalist" model trained on random masks was found to be more effective than separate "specialist" models for policy and dynamics, as it captures environmental physics more cohesively. Furthermore, the parallel processing capabilities of transformers allow M3PC to evaluate future trajectories faster than traditional step-by-step planning.
Limitations and Future Work
While M3PC shows great promise, it currently relies on low-dimensional state vectors. Future research will focus on extending the framework to high-dimensional pixel observations. Additionally, exploring the scalability of planning "intuition" with larger model sizes and extending the planning horizon for long-term reasoning remain key challenges.
Summary updated