Abstract
In this paper we explore few-shot imitation learning for control problems, which involves learning to imitate a target policy by accessing a limited set of offline rollouts. This setting has been relatively under-explored despite its relevance to robotics and control applications. State-of-the-art methods developed to tackle few-shot imitation rely on meta-learning, which is expensive to train as it requires access to a distribution over tasks (rollouts from many target policies and variations of the base environment). Given this limitation we investigate an alternative approach, fine-tuning, a family of methods that pretrain on a single dataset and then fine-tune on unseen domain-specific data. Recent work has shown that fine-tuners outperform meta-learners in few-shot image classification tasks, especially when the data is out-of-domain. Here we evaluate to what extent this is true for control problems, proposing a simple yet effective baseline which relies on two stages: (i) training a base policy online via reinforcement learning (e.g. Soft Actor-Critic) on a single base environment, (ii) fine-tuning the base policy via behavioral cloning on a few offline rollouts of the target policy. Despite its simplicity this baseline is competitive with meta-learning methods on a variety of conditions and is able to imitate target policies trained on unseen variations of the original environment. Importantly, the proposed approach is practical and easy to implement, as it does not need any complex meta-training protocol. As a further contribution, we release an open source dataset called iMuJoCo (iMitation MuJoCo) consisting of 154 variants of popular OpenAI-Gym MuJoCo environments with associated pretrained target policies and rollouts, which can be used by the community to study few-shot imitation learning and offline reinforcement learning.
Introduction
In robotics and autonomous control, agents frequently encounter the need to adapt to novel physical conditions—such as mechanical wear, changes in limb dimensions, or varying surface friction. Few-shot imitation learning (FSIL) offers a solution by enabling an agent to mimic a target expert policy using only a handful of demonstration rollouts.
While meta-learning techniques like Model-Agnostic Meta-Learning (MAML) currently define the state-of-the-art for FSIL, they carry significant overhead. Meta-learning requires a diverse distribution of tasks during training, necessitating access to numerous environment variations and expert policies before the agent can even begin to learn. This research investigates whether the complexity of meta-learning is strictly necessary, or if a standard fine-tuning approach—pretraining on a single task and adapting to another—can provide a more practical and effective alternative for control domains.
Methodology
The study proposes a straightforward two-stage baseline for FSIL:
- Online Pretraining: A base policy is trained from scratch on a single, standard environment (e.g., a standard MuJoCo "Hopper") using Soft Actor-Critic (SAC), a robust reinforcement learning algorithm.
- Offline Fine-Tuning: When presented with a new environment variant (e.g., a Hopper with modified joint mobility), the agent utilizes a small set of rollouts from a target expert. It then performs Behavioral Cloning (BC)—essentially supervised learning to match the expert's actions—to update the weights of the pretrained policy.
This approach was benchmarked against several alternatives: training from scratch, "Head Fine-Tuning" (updating only the final layer), standard MAML, and a "Multi-Task" baseline that pretrains on a wide variety of tasks using BC.
The iMuJoCo Dataset
To facilitate rigorous comparison, the authors introduced iMuJoCo (iMitation MuJoCo), a comprehensive benchmark for the FSIL community. The dataset includes:
- 154 variants of three standard OpenAI Gym environments: Hopper, HalfCheetah, and Walker2d.
- Systematic variations in physical parameters, including mass, joint mobility, limb length, and friction.
- Expert data, providing a pretrained SAC expert policy and 100 offline rollouts for every variant.
iMuJoCo addresses a gap in existing RL benchmarks by providing the specific heterogeneity and expert trajectories required to study imitation learning and offline RL in a unified framework.
Experimental Results and Insights
Performance Parity
In medium-shot (10 rollouts) and high-shot (25–50 rollouts) scenarios, the simple fine-tuning baseline achieved performance comparable to or exceeding meta-learning across most iMuJoCo tasks. As the number of demonstration shots increases, the performance gap between the complex meta-learner and the simple fine-tuner virtually disappears. This suggests that for many practical applications, the investment in meta-training may not yield superior results over standard pretraining.
The 1-Shot Gap
Meta-learning maintains a clear advantage in the extreme 1-shot regime. This is attributed to the meta-training process, which exposes the model to a broad distribution of dynamics, resulting in initial weights that are more inherently "general purpose" than those derived from a single environment.
Architecture and Transferability
In computer vision, fine-tuning only the "head" of a deep network often suffices because deep backbones learn generalizable features. However, in RL, policies typically utilize shallow Multi-Layer Perceptrons (MLPs). The study found that Head Fine-Tuning performed poorly, indicating that in shallow RL networks, the entire model must be adapted to capture the nuances of new environment dynamics.
Practicality
Fine-tuning is significantly easier to implement, debug, and parallelize than meta-learning. It does not require the definition of a complex task distribution, making it a more viable choice for real-world engineering where such distributions are often unknown or difficult to simulate.
Conclusion
This research demonstrates that a simple two-stage approach—pretraining via RL on a single environment followed by BC fine-tuning—is a highly effective baseline for few-shot imitation in control tasks. While meta-learning remains superior for 1-shot adaptation, the fine-tuning approach offers a practical, scalable, and competitive alternative as more demonstrations become available. The release of the iMuJoCo dataset provides a standardized foundation for future work in this area, encouraging further exploration of how pretraining strategies can bridge the gap between simulation and real-world deployment.
Summary updated