Why can an AI write CAD code that runs perfectly but builds the wrong shape, like a hole in the wrong spot?
Why does general VLM pretraining fail at numeric constraint understanding in CAD?
This explores why AI models that are good at general image and code understanding still get the exact numbers wrong when generating CAD designs (dimensions, positions, proportions), and what actually helps. One caveat first: none of the retrieved notes test VLM pretraining on CAD numeric constraints directly, so this answer builds the explanation from nearby findings rather than from a single study.
This explores why models trained broadly on images and text produce CAD output that looks right but has the wrong numbers, and what the collection says closes that gap. The most useful starting point is a split that shows up early in training. Fine-tuning a model on CAD examples gets it to write code that runs 91% of the time, yet the shapes it builds match the target only about 50% of the time Can CAD code be syntactically correct yet geometrically wrong?. Writing valid CAD code and getting the geometry right turn out to be two separate skills. General pretraining teaches the first well, because CAD code looks like other code. It teaches the second poorly, because nothing in ordinary text or image data rewards a model for making a hole exactly 12mm from an edge.
The second piece is what happens when you add a signal that cares about the geometry. Asking the model to reason step by step raises shape accuracy to 61%, and reinforcement learning (RL) pushes it to 72% Can CAD code be syntactically correct yet geometrically wrong?. CAD-RL goes further with three rewards written specifically for CAD, reaching 99.6% executable code and beating the earlier CAD-Coder model on geometric accuracy Can task-specific rewards outperform general pretraining for CAD code?. So the numeric understanding isn't missing entirely. It sits there unused until something rewards precision. One caution: RL is known to sharpen patterns the model already has rather than teach new procedures. Fine-tuned models still drop sharply on slightly changed problems Do fine-tuned language models actually learn optimization procedures?, and RL tends to lock onto one output style from pretraining while dropping the others Does RL training collapse format diversity in pretrained models?.
The deeper explanation comes from work outside CAD. Language models don't actually run numerical procedures internally. When they see an optimization problem, they recognize it as similar to ones they've seen and output plausible-looking but wrong values Do large language models actually perform iterative optimization?. On constrained optimization tasks they plateau at about 55–60% of constraints satisfied, whatever their size or training Do larger language models solve constrained optimization better?. One proposed reason is architectural: models generate one token at a time and can't take back a number once they've written it, while constraint solving depends on dropping bad partial answers Why does autoregressive generation fail at constraint satisfaction?. A CAD part where every dimension depends on the others is exactly this kind of problem.
A related example: about 55% of GPT-generated room layouts in Holodeck had structural flaws such as wrong object counts, clustering or bad orientations, and needed human correction Why do GPT-generated room layouts fail so often?. That's a similar failure in a different field: spatial arrangements that sound sensible but break the numbers. Another note suggests part of the problem is that models don't bring up constraints nobody stated. Forcing them to list the unstated preconditions raised accuracy from 30% to 85% Do language models fail at identifying unstated preconditions?. In CAD, many constraints, such as clearances, wall thickness and mating surfaces, are exactly this kind of implied background.
The takeaway you might not expect is that the fix for CAD is not mainly a better vision model. It's adding something that can check the numbers: a geometry reward during training, or a solver at generation time. Without one, a model trained on general data will keep producing code that runs and shapes that are wrong.
Sources 9 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-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.
Even GRPO-trained models show sharp performance drops on out-of-distribution variants (N-1 test sets) compared to in-distribution problems, indicating RL optimizes template-matching rather than genuine problem-solving procedures.
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.
Research shows LLMs cannot perform iterative procedures in latent space. They recognize optimization problems as template-similar and emit plausible-looking but incorrect values, a failure mode that persists across model scale and training approaches.
Show all 9 sources
Across constrained-optimization tasks, LLMs converge to ~55–60% constraint satisfaction independent of architecture, parameter count, or training regime. Reasoning models do not systematically outperform standard models, suggesting a fundamental ceiling rather than a scaling gap.
The performance ceiling on constraint satisfaction problems is not a model-quality issue but an architectural limitation: autoregressive transformers cannot retract emitted tokens, while CSP solvers fundamentally depend on discarding invalid partial assignments. Symbolic solver integration works because it supplies what the architecture lacks.
About 55% of Holodeck's GPT-generated layouts contained structural flaws including under-population, clustering, and wrong object counts or orientations. OptiScene required manual filtering and correction before the layouts could train downstream models.
LLMs struggle not from lacking world knowledge but from failing to bring background conditions forward as relevant constraints. Prompting that forces explicit enumeration of preconditions raises accuracy from 30% to 85%, revealing the frame problem persists in statistical systems.
Papers this line draws on 8
The research behind the notes this line reads — ranked by how closely each paper relates.
- CAD-Coder: Text-to-CAD Generation with Chain-of-Thought and Geometric Reward
- Can Large Language Models Reason and Optimize Under Constraints?
- Beyond Accuracy: Evaluating the Reasoning Behavior of Large Language Models -- A Survey
- From Intent to Execution: Multimodal Chain-of-Thought Reinforcement Learning for Precise CAD Code Generation
- Echo Chamber: RL Post-training Amplifies Behaviors Learned in Pretraining
- Rethinking "RL Generalizes, SFT Memorizes": The Role of SFT Data
- Branch-Solve-Merge Improves Large Language Model Evaluation and Generation
- ZebraLogic: On the Scaling Limits of LLMs for Logical Reasoning