TL;DR
Self-repair in robot agents works, but not for the reasons we usually think. This paper demonstrates that the success of "retrying" a failed task is driven primarily by additional sampling and general task guidance, rather than the model understanding its specific failure. In fact, providing a fixed guided prompt from the very first attempt is often more efficient than waiting for a failure to provide feedback.
What Problem Does This Paper Address?
In the "Code-as-Policy" paradigm, large language models (LLMs) generate executable code to control robots. When these programs fail—perhaps the robot misses a grasp or drops an object—a common strategy is "self-reflection": the model reads its failed code and an execution trace, critiques itself, and tries again.
While this iterative repair often improves success rates, it’s unclear why. Is the model actually learning from its specific mistake? Or is it just benefiting from having more chances to try (resampling) and better general instructions? The authors set out to decouple these factors to see if failure-specific feedback is truly necessary for robot self-repair.
Methods
The researchers evaluated frozen Qwen2.5-Coder models (3B and 7B) in a simulated robot manipulation environment (robosuite). They used a "reset-and-retry" setup: if a program fails, the simulator resets to the exact initial state, and the model gets another shot.
They compared several feedback strategies:
- Resample: Simply retrying with the original prompt (no feedback).
- Compiled: A rule-based system that detects a failure (e.g., "missed grasp"), looks up a corresponding human-written template (e.g., "MUST grasp the object before lifting"), and adds it to the prompt.
- Different-Label: Providing the model with feedback from a different type of failure than the one it actually committed.
- Fixed Task Template: Providing a single, static piece of guidance for the task regardless of how the robot failed.
- Static-from-Start: Including the task guidance in the very first prompt, before any failure occurs.
Crucially, they tested regeneration (writing a fresh program from scratch) versus editing (revising the failed code), a distinction often blurred in self-repair literature.
Datasets
The study utilized simulated robot tasks including:
- Primary Tasks: Cube lifting and stacking.
- Generalization Tasks: Cube-to-zone, place-in-bin, nut insertion, and door opening.
- Evaluation Set: 252 initial failures were used to test recovery, along with a larger set of 700 fresh scenes for end-to-end evaluation.
Key Insights and Ideas
- Specificity is Overrated: Surprisingly, matching the feedback to the specific failure didn't provide a significant boost. The "Different-Label" and "Fixed Task Template" conditions performed almost identically to the "Compiled" feedback. This suggests that the model isn't "debugging" its specific error so much as it is benefiting from general reminders of good behavior.
- Static Guidance Wins on Efficiency: If general guidance is what matters, why wait for a failure? The "Static-from-Start" approach—giving the robot the "tips" upfront—nearly doubled initial success rates (from 19.3% to 36.9%) and solved tasks using significantly fewer tokens.
- Fresh Starts > Edits: In this domain, asking the model to edit its previous failed code was much less effective than asking it to generate a new program from scratch with better instructions.
- Guidance Can Be a Double-Edged Sword: Guidance that helps in one task can hurt in another. For example, a template suggesting a "center grasp" (useful for cubes) actually lowered the success rate on a nut-insertion task that required a "rim grasp."
Key Results
- Recovery Rate: The "Compiled" feedback recovered 85.3% of initial failures within five retries, significantly outperforming simple "Resample" at 68.3%.
- Token Budget: Even when limiting the total number of tokens allowed, the advantage of providing guidance (whether specific or fixed) persisted over simple resampling.
- Overall Success: In the end-to-end study, "Static-from-Start" reached a 92.4% overall success rate, the highest of all methods, while being the most token-efficient.
Limitations and Future Work
The study was conducted in a simulated environment with privileged state information (the model knows exactly where objects are without needing to process raw pixels). The feedback was also "coarse"—based on 14 high-level failure labels rather than a detailed, nuanced understanding of the robot's trajectory.
The authors suggest that future work should:
- Test these findings with visual feedback and raw sensor data.
- Evaluate physical recovery, where the robot must try to fix a mistake from the state it ended up in, rather than resetting the scene.
- Investigate if larger models (like 32B+ parameters) show a greater ability to utilize specific, nuanced feedback compared to the smaller models tested here.
Summary updated