Computer-Aided Design (CAD) is the backbone of modern manufacturing, yet creating these models manually requires immense expertise. While "Text-to-CAD" aims to automate this by converting natural language descriptions into parametric sequences (the step-by-step instructions like "draw a circle, then extrude it"), the field faces significant hurdles in bridging the gap between logical syntax and visual intent.
The Challenge of Text-to-CAD
Previous Text-to-CAD models focused almost exclusively on the "code" (the sequential signal), ignoring how the final object actually looks. This approach struggles with two major issues:
- Multimodality: CAD is inherently both a sequence of commands and a visual object. Training solely on text sequences ignores the visual reality of the final rendered shape.
- Many-to-One Mapping: There are often dozens of different ways to write a command sequence that results in the exact same 3D shape. Training a model to strictly follow one "ground truth" sequence penalizes other perfectly valid ways to achieve the desired visual outcome.
Because the rendering process—turning code into a 3D shape—is non-differentiable, researchers cannot simply "backpropagate" visual errors back into the model.
The CADFusion Framework
To solve this, the authors introduce CADFusion, a framework built on LLaMA-3-8b-Instruct that successfully infuses visual feedback into the training loop. The training process acts as a carefully balanced "tug-of-war" between two alternating stages:
- Sequential Learning (SL) Stage: The model is fine-tuned on pairs of text descriptions and ground-truth CAD sequences. This teaches the LLM the "grammar" of CAD—how to format lines, arcs, and extrusions correctly so the code compiles.
- Visual Feedback (VF) Stage: To bypass the non-differentiable rendering problem, the authors frame visual evaluation as a Reinforcement Learning task using Direct Preference Optimization (DPO).
During the VF stage, the model generates multiple candidate sequences for a prompt, which are then rendered into images. A Large Vision-Language Model (LVM) acts as an automated judge, scoring the renders based on shape quality (realism), quantity (correct number of holes/parts), and distribution (natural arrangement). The LLM is then optimized to prefer the sequences that yield high-scoring renders.
Crucially, CADFusion uses Alternate Training. The researchers found that too much visual feedback makes the model "forget" how to write valid code (syntactic collapse), while too much sequential training makes the shapes look "unnatural" (semantic failure). Alternating between the two preserves the benefits of both.
Datasets and Automated Judging
The researchers utilized and expanded upon existing CAD data, primarily using DeepCAD as the source for raw parametric sequences. They created a new Text-to-CAD Dataset of 20,000 instruction-sequence pairs, using an LVM to draft captions that were later refined by humans.
For the VF stage, they generated a Preference Dataset of roughly 1,500 pairs per iteration. Because human annotation for 3D models is expensive and slow, using an LVM (llava-onevision-qwen2-7b) as a scalable judge was vital. This visual feedback acts as a powerful regularizer, helping the model understand the global structure of an object, whereas sequential learning often gets bogged down in local token-to-token continuity.
Key Results
CADFusion significantly outperformed both general-purpose models and specialized baselines:
- Visual Correspondence: On an LVM Score measuring how well the render matches the text prompt, CADFusion scored 8.96/10, compared to GPT-4o’s 5.13 and Text2CAD’s 2.01.
- Human Evaluation: In blind rankings, humans preferred CADFusion's outputs, giving it an average rank of 1.86 (where 1 is best), outperforming GPT-4o (3.22) and Text2CAD (2.97).
- Complexity Handling: Qualitative results show CADFusion successfully handling complex geometries like hexagonal holes within cylinders and "T-shaped" prisms, where previous models often produced oversimplified or invalid shapes.
Limitations and Future Work
Despite the leap in performance, the model still struggles with highly complex shapes requiring advanced spatial reasoning, such as rendering specific letters or words. Additionally, handling models with more than 8 separate items or extremely high curve counts (>50) remains a challenge, often leading to unrenderable sequences.
Furthermore, current LVM evaluators primarily rely on single-view images. Moving to multi-view or 3D-native evaluators could drastically improve the feedback loop in future iterations.
Summary updated