NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Comparing the Efficacy of Fine-Tuning and Meta-Learning for Few-Shot Policy Imitation

Massimiliano Patacchiola, Mingfei Sun, Katja Hofmann, Richard E. Turner

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 often need to adapt quickly to new conditions—like a robot joint becoming stiff or a change in floor friction. Few-shot imitation learning aims to solve this by allowing an agent to mimic a target "expert" policy using only a handful of example trajectories (rollouts). Currently, the state-of-the-art approach is meta-learning (learning to learn). While powerful, meta-learning is notoriously difficult to implement and expensive to train because it requires a massive "meta-training" set: rollouts from hundreds of different target policies across many environment variations. In contrast, fine-tuning (pretraining on one dataset and adapting to another) is the standard in computer vision but has been under-explored in control because there is no "ImageNet for robotics" to provide a universal starting point.

Methodology: Simple Fine-Tuning

The authors propose a straightforward two-stage baseline to address the limitations of meta-learning:

  1. Online Pretraining: Train a base policy $\hat{\pi}_\theta$ on a single, standard environment using Soft Actor-Critic (SAC), a state-of-the-art reinforcement learning algorithm. This stage provides the agent with "physical common sense."
  2. Offline Fine-Tuning: When faced with a new task (a variation of the environment), the pretrained policy is fine-tuned using Behavioral Cloning (BC) on a few offline rollouts $\mathcal{S}^* = \{\tau_1, \dots, \tau_K\}$ from the target policy $\pi^*$.
Overview of the proposed two-stage approach: online pretraining on a standard environment followed by offline fine-tuning on target trajectories.

A key finding is that pretraining on just one base environment provides enough of a prior for the agent to adapt to many different physical variations. Furthermore, the authors found that Head Fine-Tuning (updating only the last layer) performed poorly compared to full fine-tuning. Because RL networks are typically shallow (2-3 layers), the entire network must shift to accommodate new dynamics.

The iMuJoCo Dataset

To fill the gap in imitation learning benchmarks, the authors introduce iMuJoCo (iMitation MuJoCo). This comprehensive dataset includes 154 variants of the popular Hopper, Halfcheetah, and Walker2d environments. Variations include changes in limb mass, joint mobility (range of motion), limb length, and floor friction. For every variant, the dataset provides a pretrained expert policy and 100 rollouts, making it a valuable resource for few-shot imitation and offline RL research.

Results and Discussion

The simple fine-tuning baseline was compared against several methods, including MAML (Model-Agnostic Meta-Learning), Multi-Task Learning, and training from scratch.

Comparison of fine-tuning against various baselines across different environments and shot counts. Points above the diagonal indicate that the fine-tuning baseline achieves lower loss (better performance) than the comparison method.

Key results include:

  • Fine-Tuning vs. Meta-Learning: While meta-learning is superior in the extreme low-data regime (1-shot), the gap virtually disappears as soon as 10 or more trajectories are available. In the 10-shot to 50-shot range, fine-tuning achieved query-set losses comparable to MAML.
  • Robustness: The fine-tuning approach proved capable of imitating target policies even on unseen variations of the environment, such as adapting to a 200% increase in limb mass after only seeing the standard mass during pretraining.
  • Efficiency: For many practical applications, the ease of implementation and lower training cost of fine-tuning outweigh the marginal gains of complex meta-learning protocols.

Conclusion

This work demonstrates that simple fine-tuning is a highly effective and practical alternative to meta-learning for few-shot policy imitation. While meta-learners still hold an advantage in 1-shot scenarios, the fine-tuning baseline is competitive in most practical settings and significantly easier to deploy. Future work will investigate how the choice of RL algorithm during pretraining affects adaptation and how these methods scale to high-dimensional visual control tasks.

Summary updated

BibTeX
@inproceedings{patacchiola2023comparing,
  author = {Massimiliano Patacchiola and Mingfei Sun and Katja Hofmann and Richard E. Turner},
  title = {{Comparing the Efficacy of Fine-Tuning and Meta-Learning for Few-Shot Policy Imitation}},
  booktitle = {CoLLAs},
  year = {2023},
  url = {https://openreview.net/forum?id=8heqneLNCP},
}
Figure