AI models learn to write CAD code that runs almost immediately — but take much longer to learn code that builds the right shape. Why?
What causes code executability to saturate while geometric precision keeps improving?
This explores why AI models that write CAD code (scripts that build 3D shapes) quickly learn to produce code that runs, but keep getting better for much longer at making the shape match the intended design, and what that gap says about how models learn.
This explores why, in AI-generated CAD code, 'does the script run?' tops out early while 'is the shape right?' keeps climbing. The corpus treats these as two different skills that come apart early in training. Supervised fine-tuning on example code is enough to get about 91% of scripts running, but the shapes only overlap the target by about 50% (measured as IoU). Adding chain-of-thought reasoning raises overlap to 61%, and reinforcement learning pushes it to 72%, while executability barely moves because it is already near its limit Can CAD code be syntactically correct yet geometrically wrong?. Copying examples teaches the grammar of CadQuery. It doesn't teach the spatial reasoning needed to place a hole in the right spot.
The main reason is the type of signal each skill gets. Executability is a pass/fail check on syntax and API use, which imitation picks up quickly. Once nearly every script runs, the check stops telling the model anything new. Geometric precision is a continuous target: the model can always be a bit closer to the intended shape. CAD-Coder makes that target trainable by running each generated script, building the resulting shape, and scoring its distance to the target shape (Chamfer Distance). That gives reinforcement learning a reward that keeps improving long after 'it runs' is solved Can executing generated code measure CAD generation quality?. CAD-RL goes further with three task-specific rewards plus chain-of-thought guidance. It reaches 99.63% executability, a gain of only about 3 points over CAD-Coder, but adds 8.3 points of IoU. The remaining room was in geometry, not syntax Can task-specific rewards outperform general pretraining for CAD code?.
The same pattern shows up outside CAD. In web accessibility, feeding a checker's violations back into code generation clearly beats plain prompting. Yet the hard cases, like keyboard navigation and focus management, stay unsolved, because passing an automated check is not the same as getting the design right Can feeding accessibility violations back into code generation improve results?. In agentic RL with code tools, trajectories that reach the correct answer can still be sloppy, full of tolerated errors. Training improves only when positive examples are filtered for quality, not just correctness Why do correct code trajectories teach models to tolerate errors?. In both cases, 'it works' sets a minimum bar, and the real progress comes from a signal that measures how well it works.
The takeaway: an executability plateau is normal, not a warning sign. If your reward only checks whether code runs, the model stops improving once it reliably runs. To keep improving, you need to execute the output and measure what it produces against the intended result. Be aware that the evidence here comes mainly from three CAD-specific papers. The broader claim that syntax saturates early while semantics keeps improving is suggested by the accessibility and code-agent work, not tested directly.
Sources 5 notes
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.
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.
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.
FeedA11y's ReAct-based feedback loop significantly outperforms zero-shot, few-shot, and self-criticism prompting by iteratively feeding evaluator results back into generation. However, it still struggles with nuanced ARIA constraints like keyboard navigation and focus management, suggesting evaluator feedback alone cannot substitute for domain expertise.
GRPO-RoC filters positive trajectories for quality while preserving diverse failures as negative signal, allowing a 14B model to reach frontier math performance in 510 RL steps, surpassing much larger models with cleaner reasoning.
Papers this line draws on 8
The research behind the notes this line reads — ranked by how closely each paper relates.
- From Intent to Execution: Multimodal Chain-of-Thought Reinforcement Learning for Precise CAD Code Generation
- CAD-Coder: Text-to-CAD Generation with Chain-of-Thought and Geometric Reward
- Generative Floor Plan Design with LLMs via Reinforcement Learning with Verifiable Rewards
- Breaking the SFT Plateau: Multimodal Structured Reinforcement Learning for Chart-to-Code Generation
- AutoPresent: Designing Structured Visuals from Scratch
- Human or LLM? A Comparative Study on Accessible Code Generation Capability
- rStar2-Agent: Agentic Reasoning Technical Report
- Online Intrinsic Rewards for Decision Making Agents from Large Language Model Feedback