Behavioral Cloning via Search in Video PreTraining Latent Space

Federico Malato, Florian Leopold, Amogh Raut, Ville Hautamäki, Andrew Melnik · DOI

Abstract

Traditional imitation learning often fails in complex, open-ended environments due to distribution shift. This paper introduces a search-based behavioral cloning approach for Minecraft agents. By leveraging the latent space of a massive Video PreTraining (VPT) model, the agent treats control as a continuous retrieval task, identifying the most relevant expert "situations" to mimic. This method eliminates the need for explicit reward functions and demonstrates high efficacy in the MineRL BASALT 2022 challenge.

Introduction

Building autonomous agents for open-ended environments like Minecraft is a significant challenge in artificial intelligence. Standard Reinforcement Learning (RL) requires well-defined reward functions, which are often unavailable for human-centric tasks such as "building a village house." Behavioral Cloning (BC) offers an alternative by mimicking expert demonstrations, but it is prone to error accumulation—a phenomenon known as distribution shift. This paper addresses these issues by reframing imitation as a search problem within a pre-trained latent representation space.

Methodology: Search-based Behavioral Cloning

The proposed approach moves away from direct policy mapping. Instead, it utilizes a library of expert demonstrations indexed by their latent representations.

1. Latent Encoding with VPT

The system employs the Video PreTraining (VPT) model, which was trained on 70,000 hours of Minecraft gameplay. VPT uses an IMPALA CNN backbone and Transformer blocks to map visual sequences into a high-dimensional latent space that captures the semantic nuances of the game environment.

2. The Search and Execution Loop

A "situation" is defined as a sequence of observation-action pairs. The agent's inference process follows a continuous loop:

  • Encoding: The current observation is mapped into the VPT latent space.
  • Proximity Search: The agent calculates the L1 distance between its current state and the states in the expert dataset to find the most similar "situation."
  • Action Copying: Once a match is found, the agent executes the sequence of actions associated with that expert trajectory.
Overview of the Search-based Behavioral Cloning pipeline, showing the transition from demonstration datasets to real-time inference in the MineRL environment.

3. Divergence Triggers

To maintain alignment with the expert data, the agent monitors the L1 distance. If the distance exceeds a threshold (0.35) or a maximum time-step (128 frames) is reached, a new search is triggered. This allows the agent to recover from physical obstructions or environmental changes that cause its state to diverge from the chosen expert path.

Key Results and Insights

The search-based approach proved highly effective, securing a top position in the MineRL BASALT 2022 leaderboard. The core innovation lies in using feature divergence as a natural error signal. When the agent encounters an obstacle not present in the expert's path, the resulting visual difference causes a spike in L1 distance, automatically prompting the agent to find a new, more relevant trajectory.

Visualization of L1 distance spikes across different Minecraft tasks. Vertical lines indicate points where the divergence threshold was met, triggering a new search to reset the agent's trajectory.

Quantitative analysis confirms the success of this mechanism. Across tasks like FindCave and BuildVillageHouse, the average L1 distance dropped from approximately 0.37 (just before a search) to 0.17–0.18 (immediately after), indicating that the proximity search consistently identifies relevant states to follow.

Conclusion and Future Work

By treating control as a retrieval problem in a foundation model's latent space, this method bypasses the need for complex reward engineering and representation learning from scratch. However, performance remains dependent on the density of the expert dataset and the selection of heuristic thresholds. Future research will explore self-supervised scene segmentation and the integration of working memory to support longer-term goal maintenance.

Summary updated

BibTeX
@inproceedings{malato2023behavioral,
  author = {Federico Malato and Florian Leopold and Amogh Raut and Ville Hautamäki and Andrew Melnik},
  title = {{Behavioral Cloning via Search in Video PreTraining Latent Space}},
  booktitle = {Pretraining4Robotics @ ICRA},
  year = {2023},
  url = {https://openreview.net/forum?id=Gd1rXFG3SxN},
}
Figure