One-shot imitation learning

OpenAI Blog Papers

Summary

OpenAI proposes a meta-learning framework for one-shot imitation learning that enables robots to learn new tasks from a single demonstration and generalize to new instances without task-specific engineering. The approach uses soft attention mechanisms to allow neural networks trained on diverse task pairs to perform well on unseen tasks at test time.

No content available
Original Article Export to Word Export to PDF
View Cached Full Text

Cached at: 04/20/26, 02:43 PM

# One-shot imitation learning Source: [https://openai.com/index/one-shot-imitation-learning/](https://openai.com/index/one-shot-imitation-learning/) ## Abstract Imitation learning has been commonly applied to solve different tasks in isolation\. This usually requires either careful feature engineering, or a significant number of samples\. This is far from what we desire: ideally, robots should be able to learn from very few demonstrations of any given task, and instantly generalize to new situations of the same task, without requiring task\-specific engineering\. In this paper, we propose a meta\-learning framework for achieving such capability, which we call one\-shot imitation learning\. Specifically, we consider the setting where there is a very large set of tasks, and each task has many instantiations\. For example, a task could be to stack all blocks on a table into a single tower, another task could be to place all blocks on a table into two\-block towers, etc\. In each case, different instances of the task would consist of different sets of blocks with different initial states\. At training time, our algorithm is presented with pairs of demonstrations for a subset of all tasks\. A neural net is trained that takes as input one demonstration and the current state \(which initially is the initial state of the other demonstration of the pair\), and outputs an action with the goal that the resulting sequence of states and actions matches as closely as possible with the second demonstration\. At test time, a demonstration of a single instance of a new task is presented, and the neural net is expected to perform well on new instances of this new task\. The use of soft attention allows the model to generalize to conditions and tasks unseen in the training data\. We anticipate that by training this model on a much greater variety of tasks and settings, we will obtain a general system that can turn any demonstrations into robust policies that can accomplish an overwhelming variety of tasks\. Videos available at[this https URL⁠\(opens in a new window\)](https://bit.ly/nips2017-oneshot)\.

Similar Articles

Robots that learn

OpenAI Blog

OpenAI describes a robot learning system powered by two neural networks — a vision network trained on simulated images and an imitation network that generalizes task demonstrations to new configurations. The system is applied to block-stacking tasks, learning to infer and replicate task intent from paired demonstration examples.

Third-person imitation learning

OpenAI Blog

OpenAI presents a method for unsupervised third-person imitation learning that enables agents to learn from demonstrations taken from different viewpoints without explicit state correspondence, using domain confusion techniques to learn viewpoint-agnostic features.

Generalizing from simulation

OpenAI Blog

OpenAI describes challenges with conventional RL on robotics tasks and introduces Hindsight Experience Replay (HER), a new RL algorithm that enables agents to learn from binary rewards by reframing failures as intended outcomes, combined with domain randomization for sim-to-real transfer.

On first-order meta-learning algorithms

OpenAI Blog

This paper analyzes first-order meta-learning algorithms for few-shot learning, introducing Reptile and providing theoretical insights into why these computationally efficient methods work well on established benchmarks.