SYNTHESIS NOTE
Topics›RLVR›this note

Can executing generated code measure CAD generation quality?

Can an LLM be trained to write executable CAD scripts, and can running those scripts against a target shape yield reliable rewards for improving geometric accuracy?

Synthesis note · 2026-11-18 · sourced from RLVR

CAD-Coder reformulates text-to-CAD generation as writing executable CadQuery scripts — "a Python-based, parametric CAD language" — instead of predicting low-level CAD command sequences. The authors choose CadQuery because it "provides inherent geometric validation, as CadQuery scripts can be directly executed to verify the validity of the resulting CAD model," offers "a richer modeling vocabulary," and is "composed of semantic, function-based constructs, making them more interpretable." Training runs in two stages: supervised fine-tuning (SFT) on a constructed set of 110K paired text–CadQuery–3D model triplets to teach syntax, then reinforcement learning with Group Reward Policy Optimization (GRPO) using "a CAD-specific reward comprising both a geometric reward (Chamfer Distance) and a format reward." The full pipeline — SFT, GRPO, and a chain-of-thought (CoT) planning stage — reduces Mean Chamfer Distance (CD) to 6.54 and Median CD to 0.17, "surpassing all existing LLMs" including the strong baseline Text2CAD, while keeping "a lower code invalidity ratio."

The mechanism hinges on executability. Because CadQuery "can be executed directly without any external software dependencies," the reward needs no separate learned critic or human judge: a script is run through the OpenCascade kernel to produce a 3D model, and that rendered geometry is scored against the target shape by Chamfer Distance. The format reward separately "enforces the reasoning process and syntactic correctness of the generated code." So the two reward terms split the dual requirement the paper names up front — "syntactic correctness (from a programming perspective) and geometric plausibility (from a 3D modeling perspective)" — with the geometric half judged by deterministic render-and-compare rather than by any learned preference model.

This pairs with What drives CAD-Coder's improvement over supervised fine-tuning alone?, which breaks out why the reward stage, not SFT, produces most of the 6.54-CD result reported here. The automated construction of the 110K-triplet dataset also echoes a point made in Why does random tool sampling produce unrealistic synthetic training data?: both rely on a structural verification step — there, graph-based sampling for realistic tool combinations; here, execution and Chamfer-Distance checking — to keep automatically generated training data valid, though the excerpt gives no detail on the CAD pipeline's filtering steps beyond calling it "automated" and describing the result as "geometrically verified."

The excerpt does not specify how CD is computed (point-cloud sampling density, units), how the two reward terms are weighted against each other, or whether any human CAD practitioner evaluated the outputs beyond the automated metrics. The claim that this "unlocks new capabilities for LLMs" in CAD generation therefore rests entirely on Chamfer Distance and code-validity rate, not on any assessment of whether the resulting models would satisfy an engineer's design intent.

Inquiring lines that read this note 13

This note is a source for these research framings, grouped by the broader line of inquiry each explores. Scan the bold lines of inquiry; follow any specific question forward.

Can visual rendering-based rewards effectively improve code and layout quality? Does alignment training genuinely modify model behavior or only outputs? Do language models learn genuine linguistic structure or just surface patterns? Do AI coding tools meaningfully improve developer productivity and quality? What tradeoffs emerge between instruction following and other model capabilities? How important is reward engineering relative to pretraining for reasoning?

Related concepts in this collection 4

This note in its neighbourhood — explore the map, then jump to a related concept in the list below.

Concept map
13 direct connections · 81 in 2-hop network ·medium cluster Open in graph ↗

Click a node to walk · click center to open · click Open in graph to see this note in the full knowledge graph

your link semantically near linked from elsewhere

Related papers in this collection 8

Papers most semantically related to this note, ranked by cosine similarity in the embedding space.

Original note title

CAD-Coder rewards text-to-CAD generation by executing the generated code and measuring Chamfer Distance to the target 3D shape