INQUIRING LINE

CAD-generating AI can write code that runs fine but still build the wrong shape — why are those two different skills?

How do format rewards and geometric rewards split the work of training CAD models?

This explores how CAD-generation models are trained on two separate goals, writing code that actually runs (format) and producing a 3D shape that matches the target (geometry), and which part of training handles each.


This explores how CAD-generation models learn two separate skills: writing code that runs, and producing the shape you actually wanted. These turn out to be different skills, learned at different stages of training. In the corpus, supervised fine-tuning alone gets CAD code to 91% executability, but the resulting shapes overlap the target by only about 50% (IoU, a measure of how much two shapes coincide). Adding step-by-step reasoning raises that to 61%, and RL post-training pushes it to 72% Can CAD code be syntactically correct yet geometrically wrong?. So the division of labor isn't really between two rewards. Imitating examples teaches the format quickly and cheaply. Getting the geometry right is the hard part, and that is where RL earns its keep.

The geometric reward is possible because CAD code can be run. CAD-Coder runs each generated CadQuery script, builds the 3D object, and scores it by Chamfer Distance, a measure of how far the generated surface sits from the target surface Can executing generated code measure CAD generation quality?. Its ablation shows where the gains come from. Mean distance drops from 74.55 with fine-tuning alone to 17.34 once the geometric reward is added, and to 6.54 with reasoning on top What drives CAD-Coder's improvement over supervised fine-tuning alone?. The geometric reward does most of the work. Planning then helps the model find different scripts that produce the same shape. CAD-RL goes further with three task-specific rewards, reaching 99.63% executability and 78.7% IoU, ahead of CAD-Coder on both Can task-specific rewards outperform general pretraining for CAD code?. Format still gets a reward at that stage, but mostly as a guardrail, so that chasing geometry doesn't break the code.

The same split appears outside CAD. ToolRL breaks its reward for tool use into a binary format check plus a separate correctness score, and beats supervised training by 15% Can reward decomposition beat supervised learning for tool use?. Its ablations add a warning: rewarding a surface feature like longer reasoning makes results worse, and letting reward weights shift during training helps models move from simple to complex behavior Do longer reasoning traces always improve tool-use performance?. Calibration work makes a similar point. A single pass/fail reward quietly gives up on a second goal (here, confidence that matches accuracy), and adding a dedicated term fixes it Does binary reward training hurt model calibration?. The lesson carries over: if you want two capabilities, give each one its own signal.

The less obvious point is that judging the output beats matching the code. On charts, models rewarded for how the rendered image looks held 96% code execution on an unseen benchmark, while supervised models trained to copy reference code fell from 69% to 49% Does visual reward training generalize better than code matching?. Many equivalent scripts can produce the same shape, so rewarding the shape teaches what matters and leaves the syntax free to vary. Compare text-to-image RL, which has no such check. Every learned reward model tested there fails to penalize geometric distortions and duplicated objects Do text-to-image rewards all miss the same structural flaws?. CAD has a measured ground truth that most generative domains lack.

One open thread: RL tends to collapse onto a single dominant output style learned in pretraining Does RL training collapse format diversity in pretrained models?, and broader RLVR research suggests it mostly unlocks abilities the base model already had What does reward learning actually do to model reasoning?. The corpus doesn't yet test whether geometric rewards teach genuinely new spatial reasoning or just help the model surface geometry it already knew.


Sources 11 notes

Can CAD code be syntactically correct yet geometrically wrong?

Supervised fine-tuning alone produces 91% executable CAD code but only 50% geometric IoU. Chain-of-thought reasoning raises IoU to 61%, while RL post-training pushes it to 72%, showing the two capabilities decouple during early training.

Can executing generated code measure CAD generation quality?

CAD-Coder trains LLMs to write executable CadQuery code, then uses GRPO with Chamfer Distance to the target shape as a geometric reward signal. This approach reduces mean Chamfer Distance to 6.54 and outperforms existing text-to-CAD systems while maintaining low code invalidity rates.

What drives CAD-Coder's improvement over supervised fine-tuning alone?

CAD-Coder's ablation shows SFT alone achieves Mean CD 74.55, adding GRPO jumps to 17.34, and including chain-of-thought reasoning reaches 6.54. The geometric reward directly optimizes 3D correctness, while planning helps capture equivalent solutions.

Can task-specific rewards outperform general pretraining for CAD code?

CAD-RL, trained with three domain-specific rewards and chain-of-thought guidance, achieves 99.63% executability and 78.7% geometric IoU under structured input, outperforming CAD-Coder by +8.3% IoU and +3.39% executability. This suggests hand-specified rewards can unlock latent reasoning in pretrained models for precise code generation.

Can reward decomposition beat supervised learning for tool use?

ToolRL decomposes rewards into binary format checking and correctness evaluation, achieving 17% improvement over base models and 15% over SFT on tool-use benchmarks. GRPO training outperformed PPO with the same reward design and generalized to unseen multi-hop QA.

Show all 11 sources
Do longer reasoning traces always improve tool-use performance?

ToolRL's ablations show that directly rewarding longer reasoning traces hurts performance by encouraging verbosity over correctness, while letting reward magnitude change during training enables models to transition smoothly from simple to complex behaviors.

Does binary reward training hurt model calibration?

Binary correctness rewards incentivize high-confidence guessing because they don't penalize confident wrong answers. Adding the Brier score as a second reward term mathematically guarantees joint optimization of accuracy and calibration without trade-off.

Does visual reward training generalize better than code matching?

On an unseen chart benchmark, RRVF-trained models maintained 96% code execution accuracy (down only 2 points from training data), while supervised fine-tuning dropped from 69% to 49%. The difference suggests rewarding visual match rather than exact code teaches more transferable principles.

Do text-to-image rewards all miss the same structural flaws?

Every tested reward model—aesthetic, preference, and consistency-based—develops its own failure mode, but all consistently fail to penalize geometric distortions, object duplication, and entity blending. A lightweight adaptive reward model trained on human-judged artifact examples can fill this gap.

Does RL training collapse format diversity in pretrained models?

Controlled experiments show RL consistently amplifies one format distribution from pretraining within the first epoch while collapsing alternatives. The winning format depends on model scale, not necessarily performance, and is largely hidden when starting from proprietary pretrained models.

What does reward learning actually do to model reasoning?

Research shows RLVR improves sampling efficiency within existing capability boundaries without expanding them. A single training example suffices for activation, and spurious rewards work nearly as well as correct ones for models with appropriate pretraining.

Papers this line draws on 8

The research behind the notes this line reads — ranked by how closely each paper relates.