Skip to content

Embodied Turing Machine: Code-Only-as-Policy for Recursive Self-Improvement in Robots with Stateful CodeEmbodied Turing Machines: Stateful Code for Robot Recursive Self-Improvement

Hugging Face Daily Papers· arXiv:2610.12369· Kairui Hu, Siyuan Hu, Fangzhou Hong, Zhaoxi Chen, Ziwei Liu·Indexed by this site · 2026-10-09· Originally publishedAI updates

Quick read

Other

Based on the paper PDF (AI-generated); refer to the original

COAP written offline by a coding agent achieves a 70.24% success rate on 42 RoboDojo tasks, with no model at test time.

Questions
Most policies keep a VLA or VLM in the control loop, state cannot be directly inspected, and the same explicit rules cannot be applied across episodes. The authors ask: if state can be accurately measured from images and proprioception, can all decisions be written as code?
Methods
COAP uses code to measure and save the robot, environment, and task states, and then a frozen shared library computes actions; the model is not called during testing. Claude Opus 5.5 modifies code offline, merging only changes that meet a margin on the validation set, and does not use the test set.
Experiments and results
On 42 bimanual RoboDojo tasks, COAP achieves an overall success rate of 70.24% and a progress score of 75.45, higher in all five dimensions than the best baseline in that column of Table 2. Gaps in memory and precision are larger, and smaller in long-horizon; random layouts underperform standard layouts.
Limitations and future work
The authors point out that results are all in simulation; real robots require re-measuring geometry and contact parameters; each new task has an offline development cost; the upper bound depends on the state representation and whether code retries. Evaluation uses RoboDojo and official leaderboards; they do not report reviewer models and ε_q.
Experimental setupRoboDojo · SR、Progress Score
Benchmarks
RoboDojo
Metrics
SRProgress Score
AI summaryThe paper proposes Code-Only-as-Policy (COAP), which treats the embodied world as a Turing machine and uses code to measure and track robot, environment, and task states from camera images and proprioception, with all decisions made by code and no VLM or VLA involvement at test time. The authors claim it has three advantages—explicit state, controllable execution, and scalability—making it suitable as a vehicle for recursive self-improvement (RSI). On 42 bimanual tasks in RoboDojo, the resulting codebase achieves a success rate of 70.24%.

The paper proposes Code-Only-as-Policy (COAP), which treats the embodied world as a Turing machine and uses code to measure and track robot, environment, and task states from camera images and proprioception, with all decisions made by code and no VLM or VLA involvement at test time. The authors claim it has three advantages—explicit state, controllable execution, and scalability—making it suitable as a vehicle for recursive self-improvement (RSI). On 42 bimanual tasks in RoboDojo, the resulting codebase achieves a success rate of 70.24%.

Related events and news

1 events · 0 news mentions

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The core question is whether, when state is measurable, decisions can be written as code that is reused across episodes and model-free at test time.

    If the robot and environment state can be accurately represented, can all decisions be written as code and reused across episodes without calling a model at test time?

    • Scenario: The authors view the robot and environment as an Embodied Turing Machine: the tape is the environment and robot state, and the policy is the rules that read and write that tape. Existing policies mostly keep the model in the control loop; VLA maps observations to actions, and Agent Harness (Agent-as-Policy or Harness VLA) queries a VLM at runtime.
    • Existing shortcomings: The authors state that VLA's mapping stays in the weights and cannot be directly inspected or edited; Agent Harness has text memory, but the VLM and VLA are still black boxes. Existing code policies either write new code online each episode or get state from perception models or simulator oracles (Figure 2).
    • Observation: The authors state that both types of state are observable: robot state comes from proprioception, and object poses can be recovered from RGB and measured geometry. Object rearrangement only changes the tape; the same rules still apply.
    • Proposal: Code-Only-as-Policy (COAP). Code measures and tracks state from camera images and proprioception, and every step's decision is made by code; different tasks share a library, and the same program runs across episodes of a task, with no VLM or VLA at test time. The authors state this is suitable as a medium for recursive self-improvement (RSI) and can also produce successful trajectories for VLA and Agent Harness.
  2. What related research exists?

    Related work is divided into VLA, VLM control, code policies, and code agents with robot benchmarks.

    Vision-Language-Action models

    • End-to-end policies: RT-2, OpenVLA, π0, π0.5 learn language-conditioned visuomotor policies; the authors also mention subsequent foundation models that continue to scale data and training.
    • Authors' comparison: The authors state that VLA cannot be directly inspected or edited, and each improvement requires new data and new training. LIBERO-PRO is cited to suggest that benchmark success may reflect memorized training configurations. The authors also cite results that training on new tasks may reduce performance on old tasks, and state that COAP can trace failures back to variables and merge accepted modifications into code.

    Using VLMs for robot control

    • Planning and tools: ReAct interleaves reasoning and actions; Toolformer lets models call tools; SayCan grounds language plans with learnable affordances; Inner Monologue sends environment feedback back to the planner.
    • Recent harnesses: The authors mention letting VLMs call parsed or learned primitives, and evaluating GPT-6 Astra directly as an embodied policy. Their criticism is that querying the model repeatedly during execution has randomness even with the same prompt, and episode cost is high. This paper only uses models offline to write code.

    Code policies

    • Writing code at runtime: Code as Policies, ProgPrompt prompt language models to write code that calls perception and control APIs; VoxPoser writes code that composes spatial value maps. Later work adds execution feedback, repeated generation, and skill discovery. PyRUA-Lean writes code cell by cell per episode, and Skill2Real composes new programs from frozen skill memories at each decision stage. The authors state that these systems write programs with the model at runtime, with state from detectors or SAM.
    • Offline one program, state outside code: RHO and EmbodiedSWE have a coding agent write one program offline. The authors state that RHO's state comes from SAM and Molmo, and EmbodiedSWE's solver reads simulator oracles; these perception models are black boxes, and uncertainty is not controlled by code. COAP instead measures state itself, and if measurement is wrong, it changes the measurement code.

    Code agents and benchmarks

    • Code as interface: CodeAct treats executable code as the action space; other work exposes tools as code APIs. Voyager grows a code skill library through interaction; software agents do long-horizon repository tasks with tests and diffs. The authors state that these environments explicitly provide state via files, test results, or game APIs, while robots must measure from sensors.
    • Robot RSI: RoboRSI uses manager, planner, engineer, reviewer, and a no-regression gate in the loop. The authors state that its execution still has VLM decisions, and changes that pass the gate only guide the black box; measured behavior may not be runtime behavior.
    • Benchmarks: LIBERO tests knowledge transfer in lifelong learning; RoboTwin 2.0 generates domain-randomized bimanual tasks; RoboCasa365 extends household simulation. RoboDojo covers memory, precision, open instructions, generalization, and long-horizon manipulation in one protocol.

    Baselines and benchmark: Experiments compare against 23 entries on the official RoboDojo leaderboard not lower than π0.5, divided into Agent Harness, World Action Model, and VLA (Table 2). The evaluation benchmark is RoboDojo's 42 bimanual tasks.

    The authors place COAP in the third cell of Figure 2: one program, state measured by code, reused across episodes. The authors state that when the code is robust enough and reusable across episodes, no VLM or VLA is needed at runtime.

  3. How does the paper address this problem?

    COAP puts state into code variables, uses a shared library as rules, and has a coding agent modify code offline.

    Implement the robot and environment as an Embodied Turing Machine: code variables hold state, and the source code acts as rules. The shared library Code-Only-as-Policy (COAP) is frozen at runtime and improved offline by a coding agent (Figure 3). Development does not use benchmark test sets.

    Observation, state, and transition

    • Observation: each step o_t contains the instruction, three RGB streams (head and both wrists), joint angles, end-effector pose, and gripper command echo.
    • Three types of state: the environment state records object poses, sizes, categories, and spatial relations, as well as measurement error, source, and time; the robot state records each arm's joint angles, end-effector pose, gripper opening, and reachable poses. The two together form the tape. The task state records the current stage, the arm assigned to each object, the number of retries, and information the task must remember (such as the color under each cup); it corresponds to the Turing machine's internal state and is not part of the tape. In each task, the three parts have the same form.
    • Update: the robot state comes from proprioception at each step; the environment state is measured by the perception-layer library; the task code updates the task state during execution.
    • Transition: θ defines (xt+1, at) = Fθ(xt, ot), where a_t is the next trajectory segment. At runtime θ is frozen and only x_t changes, so one program runs every layout of that task, including held-out test layouts.

    Measuring the environment with code

    • Candidate objects: perception is ordinary code based on NumPy and OpenCV. Each frame uses the measured joint angles to project the robot mesh into the image and mask its pixels; pixels differing from the current tabletop color form candidate regions, and connected components whose lower edge falls on the tabletop become object candidates.
    • Pose fitting: rays from boundary pixels intersect the tabletop plane to obtain positions on the tabletop (Equation 2). The known 3D shape of that object category is then placed near that position, and position and yaw are searched, keeping the fit with the largest overlap with the observed region.
    • Constants and state: the camera model, robot mesh, object shapes, and table height are released with the benchmark and do not change between episodes; they are constants in the rules. Which objects are present and where they are is measured from images each episode.
    • Maintain and remeasure: measurement yields category, position, yaw, size, and confidence, written into the episode-level WorldState. Objects occluded by an arm retain their last pose. Tasks requiring millimeter precision remeasure with the wrist camera before final approach.

    Sharing one library across tasks

    • Layering: tasks all operate on the same form of state, with dependencies pointing downward. Task programs specify subgoal order, task-specific decisions, and recovery conditions; lower layers perform grasping, transport, placement, pushing, pouring, as well as perception and motion. One transfer expands into candidate generation, inverse kinematics and collision filtering, pre-grasp remeasurement, approach, closing, short lift and hold check, transport, placement, release, and final verification.
    • Three kinds of extension: compose existing modules; inherit an existing task and override only one decision; add a parameter that is off by default to a shared function. For example, lift_dir allows diagonal lifting, while the default remains a vertical lift (Code Example 2).
    • Compatibility: for tasks that do not pass the new parameter, execution traces on the unit-test fixture must be identical before and after the extension (Equation 3). The authors state that old tasks therefore retain their original behavior by construction. §3.3 writes cross-task sharing as the 83% row and points to §4.3.3.

    Offline iteration and acceptance

    • Who writes the code: the Claude Opus 5.5 coding agent writes the library and all code for each task, runs tests, evaluates, and debugs on its own, with no human in the loop. The introduction calls this coding agent Opus 5.5 Max and stipulates that no hacks may be written for individual episodes and that oracle state must not be used at test time.
    • Branches: the accepted code at round k is θ_k. Each agent views the recorded state of failed development runs in its own git worktree, locates the problematic variable or rule, and proposes a diff. Each branch is complete runnable code and can be evaluated in parallel under the same conditions.
    • Pre-simulation checks: task code executes on numerical scenarios to confirm that each stage reaches the target state; each waypoint checks the inverse kinematics solution and collisions. Only after passing is it evaluated in parallel on validation episodes.
    • Acceptance: debugging and selection are separate. The agent watches videos on a self-defined development set and compares measured state with simulator ground truth; selection compares success counts on the validation split. The acceptance condition is Jq(θk+Δ; Vq) ≥ Jq(θk; Vq) + εq, where J_q is the success count for task q and ε_q is a margin above rerun noise. The paper does not give a numerical value for ε_q. If met, it becomes the baseline for the next round; otherwise it is not merged. The authors state that Equation 3 protects untargeted tasks, and this rule guarantees improvement on targeted tasks, so accepted steps do not regress.
  4. What experiments did the paper conduct?

    COAP achieves an overall success rate of 70.24% on RoboDojo, higher than the best baseline in that column of Table 2 in all five dimensions.

    Experimental setup

    • Benchmark: 42 bimanual tasks in RoboDojo, divided into Memory (6), Precision (8), Open instruction following (8), Generalization (12), Long-Horizon (8). Three seeds per task, 50 layouts per seed. In Generalization, half of the layouts are randomized: new object instances, new rooms and tabletop appearances, up to 20 distractors.
    • Inputs: Only three-view RGB, proprioception (joint angles, end-effector pose, gripper command echo), and language instructions. No depth, no segmentation, no model service at test time. During development, simulator ground truth can be used to improve perception, but oracle state is not used at test time.
    • Code source: Opus 5.5 Max in the introduction, Claude Opus 5.5 coding agent in §3.4 writes code offline; the test set is not used for development. Debugging is done on the agent's self-determined development set.
    • Baselines: 23 entries on the official leaderboard not lower than π0.5 (Table 2), divided into Agent Harness, World Action Model (WAM), and VLA. §4.3 states that comparisons within each category use the entry with the highest total score in that category. For measurements not in the benchmark, the authors cite numbers from prior work.
    • Metrics and judges: SR is the percentage of episodes where the entire task succeeds (%); Score is the benchmark's progress score. Numbers are produced by the official evaluation client, judges, and summary script. The paper does not state which model the judges are or whether they are human, nor does it report agreement with humans.
    • Unspecified quantities: The paper does not report the number of RSI rounds, the value of ε_q, or the number of coding agent calls.

    Main results

    Per Table 2. The table below lists only COAP, two Agent Harnesses, the WAM and VLA with the highest total scores in each category, one lower WAM, and π0.5 with the lowest total SR. Long-Horizon and Score are placed after the table.

    Swipe horizontally to read the table

    MethodMemoryPrecisionOpenGeneralizationTotal SR
    COAP89.975.164.165.770.24
    PhysicalRSI46.632.524.915.631.38
    GPT-6 Astra38.74.031.030.522.48
    Awomo-0.541.233.522.923.829.64
    Simate-beta33.026.98.527.927.96
    OpenWAM-α9.19.21.114.811.92
    π0.54.75.51.78.26.93
    • Authors' summary: The authors state that COAP's total success rate is 70.24%, 38.9 percentage points higher than the then-SOTA (31.38%); the abstract and conclusion write 38.9% above. Table 2's vs. best row is total SR +38.86, Score +39.18; COAP's Score is 75.45. The authors also state it is more than 40 percentage points higher than the strongest WAM (29.64%) and the strongest VLA (27.96%).
    • Per dimension: The authors state that success rates are highest in all five dimensions. vs. best is Memory +39.6, Precision +41.6, Open +33.1, Generalization +35.2, Long-Horizon +13.0. On Long-Horizon, COAP is 56.4. Generalization is 65.7%, with standard layouts 77.3% and random layouts 54.1%; Open is 64.1%. The authors state the smallest margin is Long-Horizon.
    • Table scope: Omitted are VPP2-Preview, Liber-0 Preview, Liber-0 Lite, InternW0-Δ, ME-Brain-1.0, Rex-M1 Preview, DM0.5, GalaxeaVLA (G0.5), Xiaomi-Robotics-1, Meituan-Robotics-0, SimpleMemVLA, Hy-Embodied-0.5-VLA, KinRT, Spatial Forcing, VLAct, StarVLA-PI_v3, InternVLA-A1.5. The 90%, 47%, 33% and 75%, 33%, 27% in Figure 5 are rounded values for the category's highest total score entry, not the highest baseline in that column; Table 2 has 50.3 (VPP2-Preview) in the Memory column.

    Explicit state and online execution

    • What was measured: Relative to the category's highest total score entry as stated in §4.3, compare whether state is written into variables, whether failures can be backtracked, and online computation (Figure 5, Figure 6, appendix Table 3).
    • Results: The authors state that on Memory, COAP is 90%, Agent Harness 47%, VLA 33%; on Precision, 75%, 33%, 27%. The same program succeeds 63% on measured state and 83% on oracle state; the authors state that fixing each measurement narrows this gap. Of failed episodes, 76% are discovered by the program itself, and 34% retry with a new method. Median control step time is 0.3 ms; per-episode compute is 0.8–2.4% of VLA and less than 0.1% of Agent Harness. The appendix states that model-side numbers are estimates based on reported scales, not measured; the FLOP scale in Figure 6 lost its superscript in text conversion, so it is not cited here.
    • Authors' interpretation: The authors believe explicit variables make tasks that depend on memory or precise measurement easier to handle; once state is tracked, failures can return to the last checkpoint and retry with a different grasp. Appendix Table 3 divides failed episodes into: retry success 12%, retry failure 22%, discovered and reported 42%, reached step limit 1%, unreported 22%.

    Failure types

    • Classification: Failed episodes from Table 2 runs are attributed to the minimal change that would avoid the failure (Figure 11, §5.2). Perception errors 35%, contact errors 27%, incomplete logic 29%, poor code design 8%. The authors state that limits of state measurement account for 62%, and limits of code logic account for 37%.
    • Examples: In random scenes, a dartboard is recognized as headphones; a soft cloth slips out after the gripper grips the hem; pushing stops after one push even though inspection finds the block still rotated; a fixed-size threshold filters out a small watch.
    • Authors' interpretation: The authors state that the upper bound is determined by whether the state representation is accurate and comprehensive, and whether the code detects failure and switches to another method. Perception errors are related to having only RGB input; contact representation for deformable objects is coarse.

    Library expansion and parallel branching

    • Reuse: The authors state that 83% of the code run for new tasks comes from the library, 17% is task code (Figure 7). Grasping is written by method rather than by object (Figure 8). Appendix Table 7: task programs 23.5k lines, object families 28.5k, manipulation 5.4k, perception 5.3k, motion 3.3k; perception and motion are used by all 40 task programs.
    • Adding tasks from scratch: After the library is frozen, new tasks without programs average 47% success within 15 hours, with no demonstrations or training; the baseline line in Figure 7 is marked by the authors as schematic. On the same tasks, the strongest VLA after training on demonstrations is 4.7%. The authors cite OpenVLA: fine-tuning per task on 8 A100s for 5–15 hours. store_tools_in_toolbox never gets a successful program.
    • Branch search: The authors state that single changes rarely help; more branches make acceptable changes more frequent, with larger gains and earlier wall-clock time, but more GPU time (Figure 10). For decisions with two or more variants, acceptable changes are found in four out of five cases. The acceptance line is at least 4 more successes out of 30 episodes relative to the parent program. The figure notes 8 branches running simultaneously, round 1 about 1.7 h, three parallel rounds about 5 h, and sequential 15 evaluations about 26 h. The percentages and the column for branch count k do not align after text conversion, so they are not cited cell by cell.

    Other ablations and analyses

    • By step limit (appendix Table 4, which does not name Agent Harness and VLA): 200–500 steps (12 tasks) COAP 78.1%, Agent Harness 47.3%, VLA 21.9%, GPT-as-policy 26.5%; 550–800 (15) 78.4%, 30.6%, 38.0%, 26.9%; 900–1900 (15) 52.0%, 13.2%, 22.1%, 14.8%.
    • Old tasks whose code was not changed, on the same layouts, go from 78.4% to 79.9% (Cochran–Mantel–Haenszel test p=0.16; the authors state no task changes significantly). Including tasks later cleaned up, from 80.0% to 81.4%.
    • The 40 tasks with programs: standard layouts validation 76.7%, test 74.9%; random layouts validation 55.2%, test 52.8%. After the library is frozen and successive merges, total success rate goes from 66.5% to 70.24%. At the busiest time, 12 tasks run in parallel, taking 17% of the sequential time.
    • Appendix Table 6 validation success rates: make_toast at merge is 50 then 77; hang_mugs is 7, 50, 57; sweep_blocks is 0, 60, 50; fill_pen_holder is 0, 20, 27.
    • Table 9: plug_in_charger and store_tools_in_toolbox have no program, SR 0.0, Score column “–”. organize_table has SR 0.0, Score 51.5; pack_objects_into_box has SR 0.7. cover_blocks, press_by_number, swap_T, swap_blocks, pour_by_language have SR 100.0.
    • The authors cite prior work, not this paper's experiments: π0.5 after sequential fine-tuning on five real tasks drops average score from 86.9 to 31.4.
  5. What are some points that can be further explored?

    The authors point out that it is simulation-only, has a development cost per task, and the upper bound is limited by state representation and code logic.

    Limitations and future directions noted by the authors

    • Simulation only (§5.4): All results are in simulation. Perception relies on the benchmark's public camera parameters, robot meshes, and object dimensions; the authors call this the main limitation. On a real robot, these quantities need to be re-measured, and contact parameters such as gripper width and carrying speed need to be re-tuned.
    • Offline development cost (§5.4): Online execution is fast, but each iteration requires evaluation and modification. The authors compare with GPT, which can be used directly as a policy, and state that COAP has a development cost for each new task.
    • Generalization (§5.4): The authors state that the code's generalization ability may be limited, currently succeeding in only 70.24% of episodes. Part of the gap comes from incomplete logic and poor code design, such as hard-coded values that only hold in the written scenario. The programs were developed on validation layouts and never on test layouts, so lower success on unseen layouts is expected, especially on random layouts with new objects, new rooms, and distractors (54.1%, vs. 77.3% on standard layouts). On standard layouts, test at 74.9% is close to validation at 76.7%.
    • Coding ability and loop (§5.2): The authors state that current coding ability is limited, and the offline RSI loop needs further optimization to write better code.
    • Two factors of the upper bound (§5.3): Whether the state is represented accurately and comprehensively, and whether the code logic is robust, e.g., detecting failure and retrying. Perception errors are related to having only RGB; contact with deformable or complex objects is hard to represent.
    • Judgment in the conclusion (§6): The authors state that as coding agents become stronger, this upper bound will rise; and they believe COAP can be a data engine for VLA, Agent-as-Policy, and Harness VLA.

    Experimental coverage

    • Success rates come from 42 bimanual simulation tasks in RoboDojo, five dimensions, three seeds per task, 50 layouts per seed; half of the Generalization layouts are randomized (§4.1).
    • The comparison is 23 entries on the official leaderboard not lower than π0.5, divided into Agent Harness, WAM, and VLA (Table 2). Test inputs are three-view RGB, proprioception, and instructions, with no depth, segmentation, or online models.
    • Code is written offline by the Claude Opus 5.5 coding agent; the development set is self-determined by the agent, choosing to use the validation split, and the test set is not used for development (§3.4, §4.1). 40 of the 42 tasks have programs (appendix).
    • Failure analysis covers failed episodes in Table 2 runs, classified into four categories by minimal change, with examples from official videos (Figure 11). The appendix also reports numbers by step limit, recovery outcomes, new-task timeline, and successive merges.
    • The paper states that numbers come from the official evaluation client, judges, and summary script; it does not report which model the judges are, the value of ε_q, the number of RSI rounds, the number of coding agent calls, or agreement between reviewers and humans. §5.5 discusses training other policies with COAP trajectories, but does not report post-training success rates. The baseline line and right-side capability growth in Figure 7 are marked as schematic; the model compute in Figure 6 is an estimate based on reported scales, not measured.
  6. Summarize the main content of the paper

    COAP uses shared code on explicit state as the policy, with a total success rate of 70.24% on RoboDojo, with no model at test time.

    The authors view the robot together with the environment as an Embodied Turing Machine and use Code-Only-as-Policy (COAP) to write the policy as frozen code: state is measured by code, actions are computed by code, and no VLM or VLA is called at test time.

    • Problem: VLA keeps state in the weights, and Agent Harness queries the model at runtime. The authors believe that if environment poses and robot proprioception can be written into variables, decisions can be inspectable rules, and the same program can run on different layouts of a task.
    • Approach: A shared library handles perception, motion, and pick-and-place in layers; task programs only write sequences, task-specific decisions, and recovery conditions. New tasks can be composed, inherited, or use parameters that are off by default. Claude Opus 5.5 modifies code in an offline loop based on failure logs, only merging diffs that exceed the rerun noise margin on the validation set, and does not look at the test set or use an oracle at test time.
    • Main result: On 42 bimanual tasks in RoboDojo, total success rate is 70.24%, progress score 75.45 (Table 2). The authors state this is 38.9 percentage points higher than the then-SOTA of 31.38%; the table's vs. best is +38.86. All five dimensions are higher than the highest baseline in that column: Memory 89.9%, Precision 75.1%, and Long-Horizon has the smallest gap (56.4%, vs. best +13.0). Random layouts are 54.1%, lower than Generalization standard layouts at 77.3%.
    • Other observations: 83% of the code run for new tasks comes from the library. Of failed episodes, 76% are discovered by the program itself. Among failures, the authors attribute 62% to state measurement and 37% to code logic. Two tasks have no program, with SR 0.0.
    • Authors' conclusion: The authors view COAP as a direction different from VLA, world action models, and Agent Harness, and state that explicit state, controllable execution, and an extensible library make it suitable for RSI. The upper bound is still determined by state representation and code robustness; the authors believe the upper bound will rise as coding agents become stronger, and trajectories can also be supplied to other policies as training data.
Read originalhuggingface.co