arXiv:2610.02339cs.ROOct 2026

Manuscript Offprint

arXiv:2610.02339

NEEDLEWORK: Offline Rewriting of Robot Data with Verified Local Stitches

Juntao Ren, Yifan Hou, Shuran Song

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Robot demonstrations may contain useful behavior even when individual episodes are inefficient or unsuccessful. Trajectory stitching offers a way to compose these behaviors into improved training data, but identifying useful connections and verifying their feasibility is difficult in high-dimensional robot data, where many prior methods rely on low-dimensional state representations. We introduce NEEDLE, an offline dataset-augmentation algorithm that addresses these challenges by adding short, verified action bridges between recorded observations in high-dimensional robot demonstrations. First, NEEDLE identifies and creates connections that bypass suboptimal detours, broaden action coverage, and augment the original dataset with failed trajectories, using only RGB images, proprioception, and episode-level outcomes, without new environment interaction or privileged object state. Next, we present a sampling technique that incorporates accepted bridges into policy training without synthesizing intermediate images or discarding the original demonstrations, allowing policies to learn alternative actions while retaining the original dataset's coverage. On real-robot tasks, NEEDLE improves success rate over the strongest baseline on each task by an average of 21 percentage points. Videos and supplementary materials are on needle-work.github.io.

1 INTRODUCTION

The best robot behavior may not exist in any single trajectory of a dataset. Consider a bi-manual laundry-folding task. One demonstration may fold the sleeves reliably but require several corrective grasps to complete the bottom fold; another may fold the sleeves poorly but fold the bottom cleanly. Neither demonstration alone completes the task well, but synthesizing a connection between the two good segments would produce a demonstration better than either individually.

This example illustrates one of three opportunities offered by trajectory stitching (Fig. 1). Within a trajectory, it can bypass inefficient detours within a demonstration, al-

(a) Before NEEDLE

(b) After NEEDLE

Figure

Figure 1: NEEDLE produces synthetic bridges within trajectories that bypass inefficient detours, cross-trajectory stitches that discover more successful ways to complete the task, and recover useful behavior from failed episodes.

lowing a policy to learn shorter routes to success. Across successful trajectories, it can combine complementary behaviors and expose continuations that were never recorded together. From failure trajectories, it can recover useful behavior from failed episodes by connecting states along an unsuccessful execution to a successful continuation.

Despite this promise, realizing this in real-world robot manipulation is difficult. A stitch must be both useful, offering a better continuation, and feasible, with actions that physically reach its target. Most prior methods that stitch trajectories typically assume access to low-dimensional or privileged state (Yu et al., 2025; Lee & Choi, 2025; Hepburn & Montana, 2024; Li et al., 2024; Char

*Correspondence to: juntao.ren@stanford.edu et al., 2021), while methods designed to improve mixed-quality robot data typically filter or reweight recorded behavior without supplying the actions needed to connect desirable segments (Du et al., 2023; Hejna et al., 2025; Agia et al., 2025; Dass et al., 2026). We ask if we can get the best of both.

We introduce New Edges from Existing Demonstrations through Local Editing (NEEDLE), which identifies valuable segments with no existing connection, and proposes verified action bridges to connect them. Our key insight is that rather than learning a globally accurate dynamics model or task-specific value function and asking either to reason over long horizons, we can reduce stitching in high-dimensional spaces to a series of locally supervised reachability problems.

Specifically, the feasibility and duration of a local connection can be learned directly from recorded action sequences. Across any episode, successful, suboptimal, or failed, each short segment is an example of which two observations can be connected, the specific action sequence that connects them, and the exact number of steps it takes. We use this insight to train two modules. Given source and target observations, a goal-conditioned diffusion Inverse Dynamics Model (IDM) generates action sequences that attempt to reach from source to target. In parallel, we supervise an action-conditioned verifier that receives the same source and target observations and predicts whether, and after how many steps, the proposed actions reach the target.

To make these connections useful for policy learning, NEEDLE turns accepted bridges into action sequences at recorded observations. Pairing each bridge with the originally-recorded actions leading up to its source exposes the synthesized actions from multiple preceding observations, without needing to generate intermediate images. Original training examples remain available, including those the bridge bypasses, so the policy receives new ways to make progress without losing supervision for the situations and behaviors covered by the original demonstrations.

Our contributions are threefold:

(1) An offline stitching method that finds useful connections and verifies bridges with an action-conditioned reachability model.

(2) A training formulation that adds bridge actions while preserving recorded supervision, without synthesizing observations or requiring a shared coordinate frame.

(3) Evaluations on a real robot and in simulation of success, completion efficiency, recovery, and key design decisions.

References (68)