Structuring Robotic Harnesses Through Adversarial and Collaborative Play

Hanjun Yoo, Kelvin Li, Kian Hosseinkhani, Kaito Suzuki, Youngwoon Lee, Trevor Darrell, Roei HerzigarXiv 2026

TL;DR

Roboticists often use large language models to write Python code that controls robots, freezing that code so they don’t have to pay for slow LLM calls on every single run. The catch? That frozen code breaks the moment a camera shifts or a new object appears. RALLY fixes this by pairing the code-writing agent ("Bob") with an AI coach ("Alice") who reads Bob’s raw code, spots brittle logic, and custom-designs simulation scenarios to break and expand Bob's skills before the code ever touches a real robot.

What Problem Does This Paper Address?

To get foundation models to manipulate the physical world, researchers use robotic harnesses—systems that give an LLM access to perception and control APIs (like locate(plate) or pick(bowl)) so it can write executable code policies.

Calling an LLM at every step of a task is slow and expensive. Instead, modern harnesses generate a code policy, refine it over a few practice runs, and freeze it for deployment. However, refining code only on the initial setup creates an illusion of competence. Because the physical world is messy, a frozen policy that works perfectly on Tuesday might fail on Wednesday when lighting changes, an object is occluded, or someone nudges the target mid-run. Furthermore, if you ask the robot to put a moka pot in a basket instead of a soup can, existing harnesses have to start from scratch and generate a whole new policy, wasting compute on shared sub-goals they already know how to do.

Figure 1. Alice and Bob refine one frozen code policy together. (a) Existing harnesses call an LLM in every episode or refine a frozen policy only on its given scenes, failing under real-world perturbations. (b) In RALLY, Alice reads Bob’s code and traces to find weaknesses, then proposes task-preserving scene variations as an adversary or related tasks as a cooperator. Bob refines the same policy, which is then frozen for reuse. (c) The final policy is more robust on LIBERO-Pro, LIBERO-Plus, and LIBERO-MAX, generalizes to new LIBERO tasks, and transfers zero-shot to a real Franka arm along with completing new tasks and showing robustness to perturbation.

Methods

Inspired by how human coaches rally with athletes to expose blind spots, the authors introduce RALLY (Refinement through Adversarial and coLLaborative plaY). It wraps around any existing robotic harness ("Bob") without modifying how Bob writes code, introducing a second foundation model agent ("Alice").

In iterative cycles, Alice inspects both Bob’s execution traces and Bob’s actual Python code. Using scene-building tools in simulation, Alice operates in one of two modes:

  • Adversarial Alice (for robustness): Alice looks for brittle assumptions in Bob's code (e.g., locating a plate only once at the start of a script) and designs task-preserving perturbations to break it—like shifting camera angles or moving the plate mid-execution.
  • Cooperative Alice (for generalization): Starting from a single solved task, Alice proposes slightly different, related tasks (e.g., swapping the manipulated object or chaining sub-tasks) that require minimal code edits, prompting Bob to generalize its single script into a multi-task policy.

Bob's revised code is only kept if it improves performance on Alice's new challenge without regressing on any previously solved scenes. The authors also introduce RALLY-Bob, a custom harness structured around explicit, physically grounded if-else checks, making it even easier for Alice to read decisions and target specific branches.

Datasets

No new benchmarks were introduced; instead, policies were refined in the standard LIBERO tabletop manipulation simulator across four 10-task suites (Spatial, Object, Goal, and LIBERO-10).

  • To test robustness, frozen policies were evaluated zero-shot on unseen perturbations from LIBERO-Pro, LIBERO-Plus, and LIBERO-MAX (which includes MAX Dynamic, where objects move mid-run).
  • To test generalization, policies refined on just one task per suite (plus Alice's invented practice tasks) were evaluated on the nine held-out tasks of that suite.
  • Finally, simulation-refined policies were tested zero-shot on a physical Franka robot arm.

Key Insights and Ideas

  • White-box coaching beats black-box curriculum learning: Traditional adversarial training and curriculum methods treat neural networks as black boxes, guessing weaknesses from failure rates alone. Because robotic harnesses output readable code, Alice can spot a bug before it even triggers—Ablations show that hiding the code from Alice ("trajectory-only") causes almost all of RALLY's performance gains to vanish.
  • Smart training structure beats raw model scale: Pairing a cheaper model (Sonnet 5.5) with Alice outperforms a much stronger frontier model (Fable 5.2) acting alone—even when the frontier model is explicitly prompted to write robust code—at roughly one-third the API cost ($7.62 vs. $22.82 per task).
  • Explicit code structure helps the coach: Designing RALLY-Bob to use clear if-else physical checks gave Alice cleaner hooks to attack and extend, yielding the highest performance across all tested harnesses.

Key Results

  • Simulation Robustness: Adversarial Alice boosted overall zero-shot success across unseen perturbations for three existing state-of-the-art harnesses—ASPIRE (+19.9%), RHO (+15.0%), and GaP (+13.7%)—and pushed RALLY-Bob from 65.5% to 83.2%.
  • Cross-Task Generalization: With Cooperative Alice, a single policy refined on just one seed task achieved an average 62.8% success rate on the nine unseen tasks in its suite across harnesses (up from 11.7% without Alice), reaching 76.7% with RALLY-Bob.
  • Zero-Shot Sim-to-Real Transfer: Policies refined entirely in simulation transferred directly to a real Franka arm. Under real-world perturbations (occlusion and moving targets), success jumped from 0% (0/40) with Bob alone to 85% (34/40) with Alice. Across four unseen real-world tasks, RALLY succeeded in 92.5% (74/80) of trials, whereas the baseline harness failed every single trial (0%).

Limitations and Future Work

The authors note three main constraints:

  1. Alice relies on human-written prompt guidelines and parameter bounds to propose sensible variations and tasks.
  2. Alice's imagination is bottlenecked by the simulator—she can only build scenes using the objects and physics the simulator supports.
  3. RALLY refines the high-level policy glue code, not the underlying perception and control APIs. If a vision tool hallucinates or misidentifies an object, neither Bob nor Alice can rewrite the tool itself, which can mislead Alice's diagnosis. Future directions are not explicitly discussed in the paper.

Summary updated

BibTeX
@misc{yoo2026structuring,
  author = {Hanjun Yoo and Kelvin Li and Kian Hosseinkhani and Kaito Suzuki and Youngwoon Lee and Ke Li and Trevor Darrell and Roei Herzig},
  title = {{Structuring Robotic Harnesses Through Adversarial and Collaborative Play}},
  year = {2026},
  eprint = {2611.37676},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.37676},
}
Figure