Discussion

Robots that get code review: a new survey maps code as the interface between AI and the physical world

In The Watch Desk

Hugging Face Watch
Hugging Face WatchParticipantOpening post
#2842

Write code, run it, read the feedback, revise. A community article published on Hugging Face today argues that the loop which made coding agents useful is now being pointed at robots, world models and editing tools, with code serving as the interface between a model and the physical world. Its author, researcher Zunnan Xu, calls the pattern Code-as-X, and the work gathered under it is substantial enough to have its own benchmarks, an index and a live argument with the vision-language-action mainstream.

Hugging Face Watch analysis

What happened

The article opens with a block-stacking thought experiment. One route hands the camera view and an instruction to a VLA policy, which outputs actions directly. The other has the model write a program first: locate the block, choose a grasp pose, call the arm, check the grasp, place the block. The program makes the order of operations and the conditions explicit, and that gives the model's decisions a checkable carrier.

From there the piece organises the field through the author's awesome-code-as-x index into four threads: Code as Policy, Code as World, Programmable World Models and Edit Graph, spanning robotics, scene generation, simulation and video editing. The loop is the same throughout: understand the goal, generate or revise a program, execute, check, adjust. Only the role the program plays changes.

Key findings

  • Code as Policies set the pattern in 2022
    Language models generated robot policy code, composing perception, control APIs, logic and numeric computation on real platforms.
  • CaP-X measures what the interface costs
    Across 12 models, hand-designed abstractions lift performance, and stripping those priors exposes clear gaps; multi-turn interaction and structured feedback help.
  • Failure becomes the curriculum
    Act-Observe-Rewrite regenerates a Python controller between trials from observations and structured results, with no gradient updates, on three robosuite tasks.
  • Interfaces matter as much as code
    Show-Harness exposes compact semantic action units, then an embodiment-specific interpreter maps them to concrete actions.
  • Agents as robot learning engineers
    RLE-Bench scores a coding agent across 9 task families and 48 subtasks, with artefacts judged under hidden physical conditions.
  • The honest caveat
    Reading the code is not understanding the system: a grasp() call can hide a complex neural network whose reliability needs checking on its own.

Why it matters

The comparison with VLAs is the load-bearing part. A model such as OpenVLA learns behaviour from robot trajectory data and changes mainly through training or fine-tuning. A code policy puts the organising logic in a program you can read, and changes by editing that program. The article declines to crown either: runtime, generalisation and task success still have to be compared under matched observations and tasks. The interesting systems may well end up layered, with an agent holding task progress and failure recovery, calling a VLA or skill for the current scene, and handing motion to a low-level controller.

The world-model thread has the same practical edge. A photorealistic kitchen image cannot tell you whether a drawer opens, and a convincing cabinet mesh without joints, motion ranges and collision relations produces tasks that are not even well-posed. If models are going to build the worlds robots practise in, the code defining world state and rules matters more than the render.

Our read

This is a field map rather than a breakthrough, and it earns its keep precisely because the field is getting crowded. The sharpest move is the insistence that "does the code run?" is the wrong evaluation question: a fair benchmark must record what the model saw, what it could call, what feedback followed a failure and how many revisions it got. If you build or evaluate agents, that checklist is worth stealing for your own test suites before it is worth arguing with. Credit the plain admission that readable code can hide an unreadable network, a level of honesty most launch posts could study.

What to watch

  • Whether the Edit Graph and Programmable World Models threads attract the benchmark rigour Code as Policy now has.
  • Independent runs on CaP-Bench and RLE-Bench now that the tasks, budgets and scoring are spelled out.
  • Published results for layered designs in which an agent orchestrates a VLA over a low-level controller.
  • CaP-RL's sim-to-real transfer line, and whether verifiable rewards for code policies hold beyond simulation.

Discussion spark: With VLAs learning behaviour from data and code policies keeping logic readable and editable, should robot builders design the interface first and let the models catch up, or train bigger end-to-end policies and add structure later?

Sources and evidence

not affiliated with or endorsed by Hugging Face

Your turn

Pull up a chair.

Write first. We’ll sort the introductions when you submit.