Introduction In the realm of embodied AI, "Code-as-Policies" (CaP) has emerged as a powerful paradigm, utilizing language models to write Python code that directly controls robots. However, a major hurdle remains: skill grounding. Making a general skill—such as "pick up a knife"—work on a specific robot in a specific environment is incredibly fragile. Transferring a skill from a Franka arm to a UR5 arm, or swapping a parallel-jaw gripper for a vacuum suction cup, typically breaks the underlying code.
Currently, researchers face a dilemma. Large Language Models (LLMs) possess the reasoning capabilities to rewrite this code, but they are often too slow for real-time control and require expensive, latency-prone cloud connections. Conversely, Small Language Models (sLMs) can run locally on the robot's hardware, but they lack the reasoning horsepower to regenerate complex, long-horizon code from scratch without introducing critical errors.
To address this, researchers have introduced RECENT (REfactoring-Centric ageNT), a framework that enables sLMs to ground robotic skills by performing localized code refactoring instead of rewriting programs from scratch. By decoupling high-level logic from robot-specific execution, RECENT allows for efficient, real-time adaptation to new hardware and dynamic environments.
The Core Innovation: Refactoring Over Regeneration The primary bottleneck in current CaP systems is regeneration overhead. Most systems attempt to rewrite an entire script when environmental or hardware parameters change. RECENT shifts the paradigm from regeneration to refactoring. Instead of asking an sLM to write a complete program to chop vegetables, RECENT provides a validated template and instructs the model to fix only the specific lines that conflict with the current robot's embodiment.
This approach relies on several key mechanisms:
- Semantic-Execution Decoupling: Skills are stored in a repository where the high-level semantic intent (the logic) is strictly separated from the low-level execution bindings (the specific motor commands).
- Skill Ontology: A structured knowledge graph maps robot capabilities to specific API calls, acting as a reference guide for the sLM.
- Ontology-Based Reasoning: Before execution, RECENT uses this ontology to identify hardware mismatches (determined conflicts). It then employs the sLM to perform localized Fill-in-the-Middle (FIM) editing, swapping out incompatible API calls.
- In-Situ Adaptation: For undetermined factors—such as an object slipping or an unexpected obstacle—the system inserts autonomous unit tests into the code. If a test fails during execution, the sLM proactively patches the remaining code on the fly, avoiding a complete task restart.
Experimental Setup The researchers evaluated RECENT in two high-fidelity simulators to test different types of variations:
- CoppeliaSim: Used to test Kinematic Variations, transferring skills from a Franka Panda to UR5 and Sawyer robots.
- Genesis: Used to test End-Effector Variations, transferring skills from parallel-jaw grippers to Robotiq 2F-85 and vacuum grippers.
The benchmark tasks were adapted from RLBench, VIMA, and RoboGen. These involved complex, long-horizon sequences requiring up to 54 API calls, such as "put the knife on the chopping board" or "insert the umbrella into the stand." Additionally, the team deployed RECENT in the real world, testing a "scan-and-bag" task using physical FR3 and UR7e robot arms.
Key Findings and Results The results demonstrate that massive models are not strictly necessary for effective skill grounding if the task is framed as an editing problem. By constraining the sLM to localized refactoring, a 7-billion-parameter model performed exceptionally well.
- Task Success Rate (SR): In kinematic tests, RECENT achieved a 73.00% success rate, vastly outperforming the standard sLM-based CaP baseline, which managed only 20.00%.
- Grounding Overhead: By generating only necessary patches rather than full scripts, RECENT reduced the number of generated tokens by 99.09 percentage points compared to full regeneration methods. This directly translates to lower latency and power consumption.
- LLM-Level Performance: Remarkably, RECENT (powered by a 7B Qwen model) matched the performance of LLM-based systems, coming within ~6.5 percentage points of GPT-level models while operating much faster and more efficiently.
- Execution Continuity: Thanks to anticipatory patching via unit tests, the system averaged only 0.71 interruptions per task, allowing for fluid, continuous robot operation.
Limitations and Future Directions While RECENT marks a significant step forward for local, efficient robot control, it does have limitations. The framework heavily relies on a pre-defined skill ontology; if a robot encounters a task or capability absent from this knowledge graph, it cannot ground the skill. Furthermore, RECENT operates under a closed-world assumption. It assumes the high-level intent of the skill is already correct and can adapt how a robot executes a task, but it cannot learn a brand-new skill from scratch if the foundational logic is missing.
Future work will likely focus on lifelong skill learning, enabling robots to autonomously expand their own ontologies as they encounter and interact with new tools and environments.
Summary updated