Abstract
Autonomous agents require the ability to solve long-horizon problems and generalize to unseen tasks. While data-driven skill learning can extract behavioral priors from offline data to solve challenging tasks via reinforcement learning, generalizing to entirely unseen tasks remains difficult. We present Few-shot Imitation with Skill Transition Models (FIST), an algorithm that extracts skills from offline data and utilizes them to generalize to new tasks given only a few downstream demonstrations. FIST learns an inverse skill dynamics model and a distance function, employing a semi-parametric approach for imitation. Our results demonstrate that FIST substantially outperforms prior baselines in complex navigation and robotic manipulation tasks requiring interaction with previously unseen objects.
Introduction
To be truly useful in real-world environments, autonomous agents must manage complex, long-horizon tasks and adapt quickly to novel variations. Current methodologies typically fall into two categories, both with inherent limitations:
- Reinforcement Learning (RL) with Behavioral Priors: While effective at extracting skills from massive datasets, adapting to a new task requires training a new RL agent through millions of environment interactions.
- Few-Shot Imitation Learning (Behavioral Cloning): This allows for rapid adaptation from a few human demonstrations but suffers from compounding errors. Over long horizons, the agent "drifts" away from the demonstrated trajectory and eventually fails.
FIST addresses these challenges by bridging the gap between offline skill extraction and few-shot imitation, providing a mechanism to select the correct skills for a new task without the drift associated with standard behavioral cloning.
Methodology: The FIST Framework
FIST utilizes three primary components to enable robust generalization and long-horizon execution:
1. Future-Conditioned Inverse Skill Dynamics
Standard skill extraction models typically predict a skill based solely on the current state. However, offline datasets are often highly multi-modal, meaning a single state could lead to many valid skills. FIST introduces an inverse skill dynamics model conditioned on both the current state ($s_t$) and a future state $H$ steps ahead ($s_{t+H}$). This conditioning forces the model to learn a uni-modal distribution, identifying the specific skill required to bridge the gap between two points in time.
2. Semi-Parametric Evaluation and Anti-Drift
To prevent the agent from drifting off-course during execution, FIST employs a semi-parametric look-ahead strategy. At test time, the agent uses a learned contrastive distance metric to query the few-shot demonstration. It identifies a target state in the demonstration that is approximately $H$ steps ahead of its current position. This target is fed into the inverse skill model to sample the correct skill, which is then executed by a low-level decoder. This process acts as a dynamic waypoint system, constantly anchoring the agent to the demonstration.
3. Skill Adaptation
The pre-trained skill encoder, decoder, and inverse model are fine-tuned on the few downstream demonstrations. This allows the agent to adapt its prior knowledge to out-of-distribution (OOD) tasks, such as manipulating objects not seen during the initial offline training phase.
Experimental Evaluation
The authors evaluated FIST on modified environments from the D4RL benchmark designed to test OOD generalization:
- PointMaze & AntMaze: Navigation tasks where specific regions are blocked during offline training. The agent must navigate into these unseen regions using few-shot demonstrations.
- Kitchen: A 7-DoF robotic arm environment. Offline data excludes specific objects (e.g., a kettle), requiring the agent to manipulate the unseen object within a sequence of four sub-tasks.
Key Results
FIST significantly outperformed both standard Behavioral Cloning with fine-tuning (BC+FT) and state-of-the-art skill extraction (SPiRL):
- PointMaze: FIST achieved success rates of 91% to 100%, compared to SPiRL's 0-2% and BC+FT's 7-87%.
- AntMaze: FIST achieved a 21-32% success rate, while all baselines (SPiRL, BC+FT) failed completely (0%).
- Kitchen: FIST successfully completed an average of 3.5 to 4.0 out of 4 sub-tasks in the correct order, beating SPiRL (1.9-3.3) and BC+FT (1.0-2.2).
Discussion and Insights
The success of FIST highlights that future conditioning is a critical component for imitation. By looking at a future goal state rather than just the present, skill selection becomes deterministic and easier to follow. Furthermore, the semi-parametric anchoring effectively solves the classic drift problem in imitation learning by providing continuous trajectory correction.
While FIST shows great promise, it remains dependent on the quality of the offline dataset; for instance, noisy data in the AntMaze environment limited absolute success rates. Future work may focus on optimizing the distance metric for waypoint selection and implementing human-in-the-loop verification to ensure the safety of extracted skills.
Summary updated