Research map / Large language models / Reasoning and chain of thought
CAD-Coder: Text-to-CAD Generation with Chain-of-Thought and Geometric Reward
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Reformulates text-to-CAD as generating CadQuery Python scripts, training Qwen2.5-7B-Instruct with SFT, CoT cold-start, and GRPO using a Chamfer Distance plus format reward.
Problem
Text-to-CAD generation via command sequences suffers from hard-to-verify validity, limited operation sets, and poor interpretability; LLMs prompted directly often produce invalid or geometrically inaccurate CAD code.
Approach
Use CadQuery Python scripts as the target representation so outputs are executable and verifiable, then align the LLM with a geometry-based reward (Chamfer Distance) via GRPO after SFT and CoT cold-start.
Key results
- CAD-Coder reaches Mean CD 6.54 (x10^-3), Median CD 0.17, IR 1.45% on the Text2CAD test set, versus Text2CAD's 29.29 / 0.37 / 3.75%.
- Best LLM baseline GPT-4o had Mean CD 133.52 and IR 93.00%; Claude-3.7-sonnet had IR 47.03%.
- Ablation: GRPO without CoT gives Mean CD 17.34; SFT alone gives 74.55; full pipeline gives 6.54.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Add SFT to the GRPO-based training pipeline (ablation) | CAD-Coder · Text2CAD test set | Mean CD (×10^3): 76.20 -> 6.54 | Helped |
| Add CoT cold-starting (ablation) | CAD-Coder · Text2CAD test set | Mean CD (×10^3): 17.34 -> 6.54 | Helped |
| Add GRPO with CAD-specific rewards to SFT (ablation) | CAD-Coder · Text2CAD test set | Mean CD (×10^3): 74.55 -> 17.34 | Helped |
| Use 8K high-quality instead of 70K medium-quality SFT samples (ablation) | CAD-Coder · Text2CAD test set | Mean CD (×10^3): 9.89 -> 6.54 | Helped |
| Use only Chamfer Distance as the GRPO reward, removing auxiliary reward components (ablation) | CAD-Coder · Text2CAD test set | Training stability | Hurt |
Surprising findings
- Using only Chamfer Distance as the RL reward caused training to collapse after about 200 steps due to invalid code, so format and validity rewards are needed.
- An 8K high-quality SFT set outperformed the 70K medium-quality set (Mean CD 6.54 vs 9.89).
Limitations
- Struggles with complex multi-component structures and spatial alignment between sub-components.
- Misclassifies extrusion versus cutting operations.
- Thin structures and internal cavities cause sparse sampling and reward hacking.
Experimental setup
Datasets: Text2CAD CAD-Coder generated CadQuery triplets (110K)
Benchmarks: Text2CAD test set
Metrics: Mean Chamfer Distance Median Chamfer Distance Invalidity Ratio
Baselines: Text2CAD Claude-3.7-sonnet GPT-4o Deepseek-V3 Qwen2.5-72B Qwen2.5-7B
Builds on: GRPO Text2CAD DeepCAD CadQuery
Closest papers by meaning
- From Intent to Execution: Multimodal Chain-of-Thought Reinforcement Learning for Precise CAD Code Generation (AAAI 2026 · similarity 0.92)
- Clarify Before You Draw: Proactive Agents for Robust Text-to-CAD Generation (ICML 2026 · similarity 0.89)
- Text-to-CAD Generation Through Infusing Visual Feedback in Large Language Models (ICML 2025 · similarity 0.89)
- Generating CAD Code with Vision-Language Models for 3D Designs (ICLR 2025 · similarity 0.89)
- CAD-Llama: Leveraging Large Language Models for Computer-Aided Design Parametric 3D Model Generation (CVPR 2025 · similarity 0.88)
- Text2CAD: Generating Sequential CAD Designs from Beginner-to-Expert Level Text Prompts (NeurIPS 2024 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
