Design and Practice of an Evaluation Framework for Coding Agents Controlling Six-Axis Robotic Arms
This article explores the design and practice of an evaluation framework for coding agents that control six-axis robotic arms. It covers the background, evaluation objectives, task matrices, system architecture, and metric design. By analyzing benchmark results and offering engineering optimization recommendations, it provides a reusable evaluation framework to advance robotic applications from research to production.
1. Background: From “Talking” to “Doing” with Coding Agents
Large language models (LLMs) have demonstrated strong general capabilities in text generation, code completion, and tool invocation. However, when models are required to directly drive physical equipment, the problem shifts from “generating seemingly correct code” to “generating action sequences that can be safely executed, verified, and recovered in the real world.” In the context of six-axis robotic arms, models must simultaneously handle multiple challenges: understanding natural language tasks, estimating the spatial relationship between objects and the arm, planning grasping and placing paths, generating control instructions, correcting errors based on multi-camera feedback, and completing the closed loop within a limited time.
Unlike end-to-end vision-language-action models, the coding agent approach emphasizes “letting the model write code to call robotic arm interfaces.” The potential advantages of this approach include explainable logic, the ability to reuse existing planning algorithms, and ease of inserting validation and safety constraints. The challenges are also obvious: code execution has side effects, and incorrect actions may cause collisions; robotic arm control requires precise coordinate systems and time synchronization; and long contexts and multiple rounds of visual feedback can significantly drive up costs. Therefore, establishing an evaluation system for real robotic arms is of greater engineering value than simply looking at whether a model can generate code.
This article discusses a general evaluation method: in an isolated code environment, an LLM receives robotic arm information, connection methods, and task specifications, writes motion planning code, and sends instructions to the robotic arm to complete tabletop manipulation tasks such as grasping, placing, and pressing buttons. The evaluation adopts a zero-shot approach, meaning the model is not specifically trained for the given tasks. To avoid misunderstanding this technical evaluation as a product recommendation, specific vendors, models, and rankings are not discussed; instead, the focus is on the reusable evaluation framework, result signals, and engineering practices.
2. Evaluation Objectives and Task Matrix
2.1 Evaluation Objectives
The core of this evaluation is not a single “grasping success rate” but a comprehensive assessment of the following capabilities:
- Control and Dexterous Manipulation: The ability to control multi-joint robotic arms and grippers to perform approaching, centering, grasping, releasing, placing, and pressing actions.
- Spatial Reasoning: The ability to estimate object positions, orientations, arm poses, and operable areas based on multi-view images.
- Adaptability: The ability to replan when faced with different object positions, occlusions, misgrasps, drops, or minor collisions.
- Code Closed-Loop Capability: The ability to modify code based on feedback rather than outputting a non-executable action script in one pass.
- Safety and Constraint Adherence: The ability to comply with workspace, speed, collision, and timeout limits.
- Cost and Efficiency: The ability to control the number of calls, context length, and cost per task while completing the assignment.
2.2 Design of Eight Desktop Tasks
The initial evaluation typically includes eight types of tabletop manipulation tasks, covering varying difficulties from coarse-grained movement to fine contact. These can be abstracted into the following task families:
- Basic Grasp and Place: Move a target object to a designated area to test coordinate transformation, grasp posture, and end-effector positioning.
- Target Object Selection: Select a specified object among multiple similar items to test visual grounding and spatial reference.
- Stacking or Compact Placement: Place objects in a narrow area to test obstacle avoidance and placement precision.
- Button or Switch Operation: The end-effector approaches and applies appropriate action to test contact-based manipulation.
- Obstacle Bypassing: Complete a grasp when occlusion exists on the tabletop to test path planning.
- Orientation and Direction Adjustment: Grasp, rotate, and place an object in a specified orientation to test dexterous manipulation.
- Error Recovery: Continue attempting after an initial grasp failure or object offset.
- Composite Tasks: Chain grasping, moving, placing, and button operations to test long-sequence stability.
Task design should satisfy three conditions: reproducible, scorable, and explainable. Scene initialization should be resettable; success criteria should be quantifiable (e.g., whether the object enters the target area or triggers a target state); failure reasons should be classifiable (e.g., localization failure, grasp failure, collision, timeout, code error, or interface error). Providing only a total score makes it difficult to locate system bottlenecks. Recording sub-task progress, retry counts, collision counts, and manual intervention times provides a more engineering-ready evaluation.
3. System Architecture: From Task Specification to Robot Motion
3.1 Hardware and Perception Abstraction
The tested platform can adopt a six-degree-of-freedom robotic arm configuration, comprising multiple rotational joints and an end-effector gripper. The model should not rely on a specific model’s proprietary interface but should instead obtain joint states, end-effector poses, gripper open/close capabilities, and constrained motion interfaces through a unified abstraction. On the perception side, four cameras are typically used: three fixed around the tabletop to provide a global multi-view perspective, and one mounted on the wrist to provide a local perspective near the target. The value of multi-view lies in reducing occlusion ambiguity, but it also introduces costs related to calibration, time synchronization, and image context.
Engineering-wise, it is recommended to decouple “robotic arm capabilities” from “model output”:
- The robotic arm side provides constrained motion primitives or general motion interfaces.
- The model side generates high-level action code or parameterized calls.
- The safety layer validates all instructions for speed, range, collision, and workspace.
- The evaluation side records state trajectories, image snapshots, code versions, and error logs.
3.2 Coding Agent Execution Loop
The evaluation framework allows the model to write motion planning code in an isolated environment and send instructions to the robotic arm through a general connection method like an HTTP API. The task specification usually includes the connection method, basic arm information, task goals, and submission method, but does not provide training samples for the specific task. The execution flow can be abstracted as the following pseudocode:
task = load_task_spec()calib = calibrate_cameras_and_robot()history = []plan = agent.initial_plan(task)for step in range(MAX_STEPS):obs = capture_synchronized_images()state = estimate_scene_state(obs, calib)code = agent.write_or_revise_code(task, state, history)check_schema_and_safety(code)result = sandbox.execute(code, robot_api, timeout=T)history.append(summarize(obs, result, code))if evaluator.is_done(task, state):breakscore = evaluate(task, trajectory=history)
The above pseudocode only expresses the control logic and does not represent any real interface. The key point is that the model output is not a one-time text block, but a closed loop of “observe—generate code—execute—feedback—revise.” Whether the evaluation is fair depends on interface stability, timely feedback, sufficient failure information, and clear timeout and retry rules.
3.3 Isolated Execution and Safety Guardrails
Since the code directly acts on physical equipment, the isolated execution environment must at least possess:
- Resource Limits: Limit execution time, call frequency, and single-step motion duration.
- Interface Whitelist: Only expose necessary observation, motion, and gripper control interfaces.
- Instruction Validation: Apply upper bound constraints on joint angles, velocity, acceleration, workspace, and gripper range.
- Collision and Timeout Protection: Immediately stop and return a structured error when abnormal states occur.
- Replayable Logs: Save input images, generated code, execution results, and final scores to support experiment reproduction.
Safety guardrails are not meant to “limit model capabilities” but to make evaluation results comparable. Otherwise, differences in collision risk, timeout strategies, and exception handling across different run instances will render the scores meaningless.
4. Metric Design: Look Beyond the Leaderboard
4.1 Overall Scores and Success Rates
In the initial public results, the top solution scored about 69 points overall, with subsequent solutions declining sequentially. This score indicates that models can already complete some tabletop operations, but there is still a clear gap from highly reliable production applications. Particularly in grasping and fine manipulation, the best-performing solution had a success rate of around 45%, another around 36%, and low-cost solutions around 28%. This means that for tasks requiring multiple contacts, precise centering, or complex posture adjustments, the system still has a high long-tail failure rate.
For developers, the overall score should be examined alongside sub-metrics:
- Basic grasp success rate;
- Fine placement error;
- Button operation success rate;
- Average retry count;
- Collision or safety violation count;
- Task completion time;
- Cost per task;
- Context consumption ratio.
4.2 Speed Gap
In the public results, the model took an average of about 30 minutes per task, while a human took about 20 seconds, making the speed roughly 1/100th of a human’s. This gap does not entirely stem from the robotic arm’s physical movement, but more from model inference, code generation, multi-round observation, trial and error, and replanning. For production scenarios, insufficient speed directly impacts cycle time, availability, and manual takeover costs. Therefore, the evaluation should distinguish between “physical motion time,” “model decision time,” “interface waiting time,” and “failure retry time,” otherwise optimization directions cannot be located.
4.3 Cost Structure
Regarding cost, the lowest-cost solution in the public results averaged about $1.93 per task, while the highest was about $16.36, reaching 8 times the lowest solution, but with only a 4-point higher overall score. This is a crucial signal: a high score does not necessarily correspond to high cost-effectiveness. More critically, about 70% of the cost in high-cost solutions was spent on processing context information, including multi-view images, historical feedback, code versions, and task specifications. This indicates that context management is the core lever for reducing unit task costs.
Costs can be broken down as follows:
| Cost Item | Primary Source | Optimization Direction |
|---|---|---|
| Visual Context | Multi-camera images, repeated observations | Image compression, region cropping, event-triggered sampling |
| Historical Context | Accumulation of multi-round code and feedback | Structured summaries, sliding windows, state machines |
| Code Iteration | Repeated generation and correction | Incremental modifications, failure mode caching, templated motion primitives |
| Interface Calls | Frequent short-step executions | Merging safe actions, local closed-loop control |
| Failure Retries | Grasp failures, localization deviations | Better calibration, confidence estimation, and recovery strategies |
5. Result Interpretation: Benchmark Scores Do Not Equal Production Readiness
The first round of results provides at least three types of signals.
First, general LLMs already possess a certain capability to “write code to control robotic arms,” but under zero-shot conditions, they still struggle to stably complete all tabletop tasks. A top score of 69 indicates the system can handle some tasks, but there is still a distance from high success rates and low manual intervention.
Second, speed and cost have not yet met production application requirements. A cost of several to over ten dollars per task and about 30 minutes per task is suitable for research and validation, but not for high-frequency production cycles. Even considering only the lowest-cost solution, it is necessary to judge acceptability based on the business value of the task.
Third, the leaderboard can only serve as a directional reference. High-scoring solutions may come at the expense of higher costs and longer inference times; low-cost solutions may be more cost-effective for certain simple tasks. Enterprises should base their selection on their own task distribution for re-evaluation, rather than directly copying public rankings.
6. Engineering Optimization Recommendations
6.1 Establish a Hierarchical Control Architecture
It is recommended to split the system into a “task planning layer—skill layer—motion control layer—safety monitoring layer.” The LLM is responsible for task decomposition, skill selection, and parameter generation; the skill layer encapsulates verifiable actions such as grasping, placing, pressing, and returning to zero; the motion control layer handles trajectory interpolation, collision detection, and servo control; the safety monitoring layer operates independently of the model. This retains the flexibility of coding agents while reducing the risk of generating low-level code in every iteration.
6.2 Optimize Context and Multimodal Management
To address high context costs, the following can be adopted:
- Upload only images of task-relevant areas, rather than full multi-view images in every round.
- Make structured summaries of historical trajectories, such as “approached target, gripper closure failed once.”
- Use a state machine to maintain task phases, reducing repetitive descriptions.
- Apply incremental modifications to code to avoid rewriting the entire program each round.
- Build a searchable cache for failure types to reduce repetitive reasoning.
6.3 Enhance Reproducible Evaluation
Evaluation should fix scene initialization, random seeds, camera calibration, lighting conditions, and timeout strategies, and run multiple times to report means, variances, and confidence intervals. For grasping tasks, it is recommended to record failure cause classifications rather than just success or failure. Only with reproducibility can we compare whether different optimizations are truly effective.
6.4 Introduce Simulation Pre-Validation and Safety Checks
Before executing real actions, collision and reachability checks can be performed in a digital twin or simplified geometric model to filter out obviously unsafe trajectories. During real execution, retain speed limits, emergency stops, watchdogs, and exception rollbacks. Model-generated code must pass schema and permission validation, prohibiting access to non-essential interfaces.
6.5 Build a Data Closed Loop
Zero-shot evaluation is used to measure generalization, but production systems require continuous improvement. Successful and failed trajectories, manual takeover records, code correction processes, and visual errors can be organized into an evaluation set for regression testing and prompt strategy optimization. It is important to distinguish between “training data” and “evaluation data” to avoid claiming zero-shot generalization after tuning parameters on test scenarios.
7. Conclusion
Evaluating coding agents for six-axis robotic arms is essentially testing whether LLMs can connect language understanding, spatial reasoning, code generation, and physical execution into a reliable closed loop. Initial evaluations show that models can already complete some tabletop operations, but speed, cost, fine manipulation success rates, and long-tail recovery capabilities are still insufficient to support production applications. For developers, the more valuable work is not chasing single leaderboard rankings, but establishing standardized interfaces, safety isolation, reproducible metrics, context management, and hierarchical control systems. Only when evaluation results can stably map to the success rate, cycle time, and cost of real tasks can coding agents move from demonstrations to usable robotic applications.
