Skip to main content
Back

Cyber Monday Deal: Get 20% off all AlphaSignal Pro subscriptions. Ends soon. Subscribe here

UC Berkeley's RopeFormer Teaches Robots to Learn From Each Swing

A humanoid learns to swing, twirl and whip unfamiliar ropes by reusing its own past attempts as in-context memory, with policy weights frozen.

Pro

Paper, Full Access
  • RopeFormer uses a six-layer Transformer-XL to carry action-response history across rope-manipulation trials with frozen weights.
  • On a Unitree H1-2, acquisition time drops 30.9% for Rope Swing and 33.9% for Rope Twirl from trial 1 to trial 3.
  • Rope Whip mean target hits rise from 0.2 to 2.3 out of 3 across ten rope-height groups.
  • Trained with PPO and an asymmetric critic in the Newton simulator, with no online parameter estimation.
  • Simulation sweep over 384 ropes shows retained context beats reset context, but gains vary with stiffness and observed points.
  • Videos and setup details are on the project page; code listed as coming soon.

Identical arm swings can send different ropes along sharply different paths because mass, bending stiffness, and internal damping alter how motion travels down the cable. Those properties are difficult to measure from vision and reproduce in simulation. Researchers at UC Berkeley’s Mechanical Systems Control Lab developed a controller that adapts by retaining the action and response history from previous attempts.

RopeFormer uses a Transformer-XL policy to carry that history across repeated trials with the same rope. Its weights remain fixed during deployment, and it does not estimate physical parameters online. The research paper evaluates the approach in simulation and on a Unitree H1-2 humanoid using ropes excluded from training.

Why one swing leaves too much unknown

Rope control combines continuous motion with dynamics that are only partly observable. A camera can track points along a cable, but it cannot directly reveal the bending stiffness, distributed mass, or internal damping that determine the cable’s response.

Domain randomization typically addresses this gap by training a policy across many simulated parameter combinations. A feedforward policy can then handle some variation, but it discards evidence from one trial before the next begins. Simulation errors compound the problem because deformable-object properties are difficult to model faithfully.

RopeFormer treats each attempt as both task execution and physical probe. When a swing produces an unexpected arc, the resulting trajectory remains available to the policy during the next attempt.

A bounded cache carries experience forward

At each 30 Hz control step, an encoder converts the robot’s joint state, tracked rope points, task command, and previous action into a token. A six-layer Transformer-XL processes that token alongside cached keys and values, the internal representations used by attention, from the previous 128-frame segment. That cache covers about 4.3 seconds of control history. An action head then outputs joint targets.

When a segment fills, it replaces the cached segment. This design bounds memory use while allowing context to cross trial boundaries when attempts are short enough to fit within the retained history.

Unitree H1-2 humanoid whipping a rope toward candle targets
The Unitree H1-2 executes a rope-whipping task using RopeFormer.

Training takes place in the Newton simulator using proximal policy optimization, a reinforcement-learning algorithm, and an asymmetric critic. The critic receives privileged rope and actuator parameters during training so it can estimate value more accurately; the deployed policy receives only its observation history.

Rope properties vary between episodes, while each episode contains several attempts under unchanged conditions. Advantage estimation stops at trial boundaries, keeping reward calculations local to each attempt. Attention masks prevent history from leaking between episodes while preserving context across trials within an episode.

Three tasks probe different dynamics

The authors train a separate policy for each task while keeping the architecture unchanged:

  • Rope_Swing: One hand holds the rope while the free tip must reach a commanded rotation rate and direction.
  • Rope_Twirl: Both hands hold the ends while the midpoint orbits the axis between them.
  • Rope_Whip: A transient sweep must send the free tip along a target line segment.

Memory cuts recovery time in simulation

The simulation evaluation compares the same trained weights under two conditions: context retained across trials and context cleared after every trial. The test covers 384 ropes with matched starting states. For Rope_Swing, the paper reports mean capped acquisition time, a bounded time-to-target metric, across trials two through five.

Rope_Swing simulation results
Observed points Context reset Context retained Difference
One 7.39 s; 48.2% success 4.89 s; 79.8% success 2.50 s faster; 31.6 percentage-point success gain
Six 5.64 s 4.34 s 1.30 s faster

An MLP baseline using an eight-frame observation stack shows no difference between retained and reset conditions because it carries no state beyond that fixed window.

Rope_Twirl shows that the gain varies with both observability and stiffness. With one tracked point, retained context reduces acquisition time most for low- and medium-stiffness ropes, by 1.55 seconds and 1.19 seconds. With six points, the largest reduction shifts to high-stiffness ropes at 0.79 seconds.

Rope Twirl acquisition time grouped by rope stiffness
Rope-twirling acquisition time varies by stiffness and the number of observed points.

Across five repeated Rope_Whip attempts with one rope, maximum tip deviation falls from 7.8 cm on the first attempt to 4.9, 3.8, 3.1, and 2.9 cm. The controller crosses the 5 cm threshold on its second attempt.

The gains survive the hardware gap

The physical deployment uses the frozen one-point Transformer-XL variant, TXL-1, on a Unitree H1-2. Two ZED 2i cameras triangulate a marker attached to the rope tip for Rope_Swing and Rope_Whip, or to the midpoint for Rope_Twirl.

Each evaluation block contains three consecutive attempts. Trial one begins with an empty context, which remains available during trials two and three. Researchers manually return the rope to rest between attempts, limiting physical carryover while preserving the policy’s memory.

Real-robot results from the first to the third attempt
Task and metric Trial 1 Trial 3 Outcome
Rope_Swing acquisition time across five ropes 8.57 s 5.92 s 30.9% lower; every rope was faster
Rope_Twirl acquisition time 3.23 s 2.13 s 33.9% lower; tracking error fell 55.6%
Rope_Whip mean targets struck 0.2 of 3 2.3 of 3 Measured across ten rope-height groups using two ropes

Where the evidence stops

Across simulated and physical ropes, fixed Transformer-XL weights use prior action-response history to improve later attempts. Adaptation occurs through activations stored in the cache: training uses no dedicated meta-learning objective, deployment performs no parameter estimation, and the controller receives no fine-tuning on the physical rope.

  • Improvement is not monotonic: Individual attempts can regress even when averages improve across trials or ropes.
  • Observations matter: The size of the gain changes with the number of tracked points and the rope’s stiffness regime.
  • Perception remains instrumented: The real-robot tests use marker-based triangulation, leaving markerless tracking untested.
  • Policies remain task-specific: The authors train separate controllers for swinging, twirling, and whipping.
  • Code was unavailable: At publication, the project page listed code as “coming soon,” while providing videos and a BibTeX entry.

RopeFormer gives developers a practical pattern for systems whose physical parameters are difficult to identify: train across diverse dynamics, preserve recent trajectories across retries, and condition each new control sequence on the observed outcome. The study establishes that pattern for ropes; validation on cloth, cables, and soft tools remains open.