CADmium: Fine-Tuning Code Language Models for Text-Driven Sequential CAD Design

1Chandar Research Lab
2Mila – Quebec AI Institute
3Polytechnique Montréal
4Ansys
*Equal contribution

Computer-aided design (CAD) is the digital construction of 2D and 3D objects, and is central to a wide range of engineering and manufacturing applications like automobile and aviation. Despite its importance, CAD modeling remains largely a time-intensive, manual task. Recent works have attempted to automate this process with small transformer-based models and handcrafted CAD sequence representations. However, there has been little effort to leverage the potential of large language models (LLMs) for sequential CAD design.

Contributions

To address these limitations, we introduce CADmium, a novel approach that reformulates CAD generation as a purely text-to-text task. Our contributions are as follows:

The CADmium Pipeline

CADmium Pipeline
CADmium reformulates CAD generation as a purely text-to-text task. First, GPT-4.1 generates natural-sounding yet geometrically precise descriptions of 176,017 objects using their construction sequences in minimal JSON, and up to 10 multi-view images rendered with Blender. Then, the Qwen2.5-Coder LLM is fine-tuned with LoRA to translate these descriptions back into CAD sequences.

CADmium vs. Text2CAD annotations

Annotation Statistics
Comparative analysis of CADmium and Text2CAD expert-level annotations. (a) Vocabulary growth as a function of token count demonstrates that Text2CAD has a limited vocabulary compared to CADmium. (b) Human-likeness, clarity, visual faithfulness given image renders, and completeness against the minimal JSON as measured by Gemma-3 12B indicates that CADmium descriptions tend to produce more natural-sounding albeit challenging descriptions. (c-e) Distribution of word counts, unique words, and digit lengths within numerical expressions per annotation shows that CADmium descriptions are more concise and diverse.

Performance on CADPrompt

CAD Prompt Results
Performance comparison on the human-annotated CADPrompt dataset. Metrics are calculated on the set of valid meshes generated by each model individually.

Annotation Prompt

Annotation Prompt
The user message contains the JSON description and the 10 multi-view renders of the 3D models, and instruct GPT-4.1 to generate a natural language description.

Generation Prompt

Generation Prompt
The system message specifies the JSON schema and constraints, while the user message contains the natural language description of the target CAD model.

BibTeX

@article{govindarajan2025cadmium,
  title={CADmium: Fine-Tuning Code Language Models for Text-Driven Sequential CAD Design},
  author={Govindarajan, Prashant and Baldelli, Davide and Pathak, Jay and Fournier, Quentin and Chandar, Sarath},
  journal={arXiv preprint arXiv:2507.09792},
  year={2025}
}
Chandar Research Lab Mila – Quebec AI Institute Ansys