STRAP: Robot Sub-Trajectory Retrieval for Augmented Policy Learning

Marius Memmel, Jacob Berg, Bingqing Chen, Abhishek Gupta, Jonathan Francis

Introduction

In the rapidly evolving field of robot learning, we are increasingly blessed with "big data"—massive, diverse collections of robot trajectories like the DROID dataset. However, effectively utilizing this data to teach robots new tasks remains a significant challenge.

STRAP (Sub-sequence Trajectory Retrieval for Augmented Policy Learning) is a novel approach that enables robots to learn new tasks from just a few demonstrations. It achieves this by automatically retrieving relevant "sub-trajectories" from massive offline datasets. By matching small, atomic chunks of behavior rather than entire task sequences, STRAP significantly improves data efficiency and policy robustness in both simulated and real-world environments.

High-level overview of STRAP matching sub-trajectories from an offline dataset to few-shot demonstrations.

The Problem: Generalists, Specialists, and the Limits of Full-Trajectory Retrieval

Standard generalist policies (multi-task models) often suffer from "negative transfer," where learning one task inadvertently degrades performance on another. Conversely, specialist policies trained on a single task are robust but require a prohibitively large amount of expensive, task-specific data.

Existing retrieval methods attempt to bridge this gap by finding "similar" full trajectories in a dataset to help train a new task. But what if your new task is "pick up a mug and put it in a drawer," and your dataset only contains "pick up a mug and put it on a shelf"? A full-trajectory search might discard the perfectly relevant "pick up a mug" segment simply because the ending differs. STRAP addresses this by operating at the sub-trajectory level—finding and extracting the useful pieces of behavior hidden within otherwise unrelated tasks.

Methods: How STRAP Works

The STRAP pipeline consists of four main steps designed to seamlessly integrate offline data with new, few-shot demonstrations:

  1. Automatic Segmentation: The few target demonstrations provided by a human are sliced into "atomic chunks" (sub-trajectories). This is achieved using a simple kinematic heuristic: when the robot's end-effector velocity drops below a specific threshold (a "stop-motion" event), a segment boundary is created.
  2. Foundation Model Embeddings: To accurately compare visual scenes across entirely different environments, STRAP utilizes off-the-shelf vision foundation models like DINOv2. These models provide rich semantic features that focus on "object-ness" while ignoring distracting changes in lighting, backgrounds, or textures.
  3. Subsequence Dynamic Time Warping (S-DTW): This is the core algorithmic contribution. S-DTW allows the system to take a short query segment (e.g., "grasping a handle") and find the best-matching portion within a much longer trajectory in the offline dataset, regardless of differences in execution speed or overall length.
  4. Augmented Policy Learning: The retrieved sub-trajectories are combined with the original few-shot demonstrations to create a rich, augmented training set. A transformer-based policy is then trained on this combined data using behavior cloning.
The detailed STRAP pipeline, illustrating the use of vision foundation models and dynamic time warping for sub-trajectory retrieval.

Key Insights

  • Granularity is Key: Retrieving sub-trajectories is far more powerful than retrieving full trajectories. It allows the model to "borrow" low-level skills (like grasping or reaching) from a wide variety of tasks that might be semantically different at a high level.
  • Zero Training for Retrieval: Unlike prior methods that require training custom encoders (like VAEs) on the robot data, STRAP works "out of the box" using pre-trained vision models. This makes it highly scalable to new datasets.
  • Robustness through Diversity: By pulling in data from different environments and viewpoints found in the offline dataset, the resulting policy becomes much more robust to variations in object poses than a policy trained solely on the few-shot target demos.

Datasets and Key Results

The authors evaluated STRAP across several challenging benchmarks, including LIBERO-10 & LIBERO-90 (simulation), the massive DROID dataset (76k real-world trajectories), DROID-Kitchen, and a Franka-Pen-in-Cup cross-task retrieval test.

  • Simulation: On the LIBERO-10 benchmark, STRAP outperformed state-of-the-art retrieval baselines (BehaviorRetrieval and FlowRetrieval) by roughly 25% on average.
  • Real-World Performance: In the DROID-Kitchen experiments, STRAP achieved a success rate of 61% in a challenging sink environment. In contrast, a standard multi-task policy achieved only 31%, and simple behavior cloning on the few demos managed a mere 10%.
  • Scalability: STRAP efficiently processed the 18.9 million timesteps of the DROID dataset, with the retrieval phase taking only about 5 minutes on a single GPU.

Limitations and Future Work

While highly effective, STRAP has a few limitations. The current velocity-based heuristic segmentation is simple but might struggle with continuous, fluid motions that lack clear pauses; future work could explore learned segmentation. Additionally, STRAP's performance is naturally bounded by dataset dependency—if the offline dataset lacks the necessary low-level behaviors, retrieval cannot help. Finally, while efficient, the retrieval and training steps still occur at deployment time, meaning reducing deployment latency further would be beneficial for rapid, on-the-fly adaptation.

Summary updated

BibTeX
@inproceedings{memmel2025strap,
  author = {Marius Memmel and Jacob Berg and Bingqing Chen and Abhishek Gupta and Jonathan Francis},
  title = {{STRAP: Robot Sub-Trajectory Retrieval for Augmented Policy Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=4VHiptx7xe},
}
Figure