Planning to Practice: Efficient Online Fine-Tuning by Composing Goals in Latent Space

Kuan Fang, Patrick Yin, Ashvin Nair, Sergey Levine

Abstract

Training robots for long-horizon, multi-stage tasks remains a significant challenge in robotics. While offline reinforcement learning (RL) leverages large datasets, it often fails to generalize to novel task sequences. Conversely, online RL allows for error correction but suffers from prohibitive exploration costs in complex environments. This paper introduces Planning to Practice (PTP), a framework that bridges this gap by using a high-level latent-space planner to generate a structured "practice curriculum." By breaking long-horizon goals into manageable subgoals, PTP enables efficient online fine-tuning, allowing robots to master complex behaviors that were never explicitly demonstrated in the training data.

Introduction

Teaching a robot a single primitive skill, such as opening a drawer, is a well-documented success in modern robotics. However, real-world utility requires robots to perform sequences of these skills—for example, moving an obstacle, opening a drawer, and retrieving an object. These long-horizon tasks present a dual challenge: offline methods struggle with compounding errors during skill transitions ("stitching"), while online methods rarely encounter the final goal through random exploration.

In "Planning to Practice: Efficient Online Fine-Tuning by Composing Goals in Latent Space," researchers from UC Berkeley propose a hierarchical approach. PTP utilizes a high-level planner to propose intermediate waypoints in a learned latent space, transforming a daunting long-horizon problem into a series of reachable "practice" sessions. This allows the robot to learn from its own interactions effectively and efficiently.

Methodology

The PTP framework operates in two distinct phases: offline pre-training and online fine-tuning.

Phase 1: Offline Pre-training

The robot is first trained on a diverse dataset of primitive behaviors, such as sliding objects or interacting with furniture. During this phase, the system learns three core components:

  1. A Goal-Conditioned Policy: The low-level controller that executes actions to reach a specific state.
  2. A Latent Representation (VQ-VAE): A compressed space that allows the robot to process raw 48x48 RGB images without the computational burden of pixel-level planning.
  3. A Conditional Subgoal Generator: A CVAE-based model that imagines potential future states based on the current observation, ensuring that proposed subgoals are physically plausible.

Phase 2: Online Fine-tuning (The "Practice" Phase)

When tasked with a new, complex goal, the robot does not attempt the entire sequence at once. Instead, it employs a hierarchical planning strategy:

  • Hierarchical Planning: A high-level planner uses the subgoal generator to propose a sequence of intermediate waypoints in the latent space.
  • Optimization via MPPI: The system uses Model Predictive Path Integral (MPPI) optimization to select the most feasible path of subgoals leading to the final target.
  • Policy Fine-tuning: The robot attempts to reach these subgoals sequentially. This provides a dense reward signal; even if the robot fails the final task, it receives reinforcement for successfully reaching intermediate waypoints. This data is then used to fine-tune the policy online.

Experimental Results

The researchers evaluated PTP against several baselines, including model-free RL and existing hierarchical methods like LEAP and GCP, using both simulated and real-world environments.

Simulation Performance

In simulated environments requiring multi-stage manipulation (Tasks A, B, and C), PTP achieved success rates between 50% and 85%. In contrast, many baseline methods remained at 0% success, failing to overcome the exploration challenge inherent in long-horizon tasks.

Real-World Validation

On a physical robot performing a drawer-retrieval task, PTP demonstrated remarkable efficiency:

  • Initial Success: After offline training alone, the robot succeeded only 12.5% of the time.
  • After Practice: Following just 10 epochs of online fine-tuning using the PTP curriculum, the success rate climbed to 62.5%.
  • Task Mastery: On secondary tasks, the system achieved up to 100% success, demonstrating the power of structured online interaction.

Qualitatively, the subgoals generated by PTP were visually coherent, depicting the robot arm and objects in logical intermediate configurations, which facilitated more stable learning compared to the noisy subgoals produced by baseline generators.

Discussion and Limitations

PTP demonstrates that planning is not just for execution—it is a powerful tool for structuring learning. By using a planner to "scaffold" exploration, robots can teach themselves tasks that are significantly more complex than those found in their initial training data.

However, the method is not without limitations. The system's performance is heavily dependent on the quality of the VQ-VAE latent space; if the encoder fails to represent a critical object, the planner cannot set subgoals involving that object. Additionally, the current framework assumes subgoals can be reached within a fixed time budget, which may not hold in highly dynamic or unpredictable environments.

Conclusion

Planning to Practice (PTP) offers a compelling blueprint for the next generation of general-purpose robots. By composing goals in a latent space and using them to guide online practice, PTP allows robots to move beyond static datasets and autonomously bridge the gap between simple primitives and complex, real-world multi-stage tasks.

Summary updated

Abstract

General-purpose robots in real-world settings require diverse repertoires of behaviors to complete challenging tasks in unstructured environments. To address this problem, goal-conditioned reinforcement learning aims to train policies that can reach configurable goals for a wide range of tasks on command. However, such goal-conditioned policies are notoriously difficult and time-consuming to train from scratch. In this paper, we propose Planning to Practice (PTP), a method that makes it practical to train goal-conditioned policies for long-horizon tasks that require multiple distinct types of interactions to solve. Our approach is based on two key ideas. First, we decompose the goal-reaching problem hierarchically, with a high-level planner that sets intermediate subgoals using conditional subgoal generators in the latent space for a low-level model-free policy. Second, we propose a hybrid offline reinforcement learning approach with online fine-tuning, which uses previously collected data to pre-train both the conditional subgoal generator and the policy, and then fine-tune the policy via online exploration. This fine-tuning process is itself facilitated by the planned subgoals, which break down the original target task into short-horizon goal-reaching tasks that are significantly easier to learn. We conduct experiments in both the simulation and real world, in which the policy is pre-trained on demonstrations of short primitive behaviors and fine-tuned for temporally extended tasks that are unseen in the offline data. Our experimental results show that PTP can generate feasible sequences of subgoals that enable the policy to efficiently solve the target tasks.
BibTeX
@inproceedings{fang2022planning,
  author = {Kuan Fang and Patrick Yin and Ashvin Nair and Sergey Levine},
  title = {{Planning to Practice: Efficient Online Fine-Tuning by Composing Goals in Latent Space}},
  booktitle = {GPL @ ICLR},
  year = {2022},
  url = {https://openreview.net/forum?id=StZUCEaV1Zc},
}
Figure