Parametric Computer-Aided Design (CAD) is fundamental to modern 3D modeling, yet existing methods struggle to generate long command sequences, especially under complex geometric and topological dependencies. Transformer-based architectures dominate CAD sequence generation due to their strong dependency modeling, but their quadratic attention cost and limited context windowing hinder scalability to long programs. We propose GeoFusion-CAD, an end-to-end diffusion framework for scalable and structure-aware generation. Our proposal encodes CAD programs as hierarchical trees, jointly capturing geometry and topology within a state-space diffusion process. Specifically, a lightweight C-Mamba block models long-range structural dependencies through selective state transitions, enabling coherent generation across extended command sequences. To support long-sequence evaluation, we introduce DeepCAD-240, an extended benchmark that increases the sequence length ranging from 40 to 240 while preserving sketch-extrusion semantics from the ABC dataset. Extensive experiments demonstrate that GeoFusion-CAD achieves superior performance on both short and long command ranges, maintaining high geometric fidelity and topological consistency where Transformer-based models degrade. Our approach sets new state-of-the-art scores for long-sequence parametric CAD generation, establishing a scalable foundation for next-generation CAD modeling systems. Code and datasets are available at GitHub.
Figures & tables
Figure 1: CAD construction pipeline and hierarchical representation. Sequential Sketch and Extrusion operations form a 3D solid, which is encoded by GeoFusion-CAD into a hierarchical tree capturing geometry and topology.
Figure 2: Comparison between transformer-based CAD architecture and ours. (Left) The transformer-based method trains command and argument sequences separately. (Right) Our GeoFusion-CAD models the hierarchical CAD topology with G-Mamba blocks, mapping solid and hierarchical topology into a unified sequence.
Figure 3: Overview of GeoFusion-CAD. The framework consists of two embedding layers, a G-Mamba diffusion encoder, and a CAD decoder. Each parent node conditions its child node during the reverse diffusion process, enabling structured and coherent generation.
Figure 4: Architecture of G-Mamba Blocks. The block consists of a DWC module, a GSM-SSD layer, and an MLP, enabling geometry-conditioned multi-scale state transitions.
Figure 5: Visual results on different test ranges. Compared with others, GeoFusion-CAD produces coherent solids with fewer surface artifacts. Some subtle abnormities are marked in red circles.
Test Range
Model
ACC cmd↑
ACC param↑
ACC line↑
ACC arc↑
ACC Circle↑
ACC ext↑
COV ↑
MMD ↓
JSD ↓
Memory
FLOPs(256)
DeepCAD
DeepCAD
92.4
89.2
85.4
87.3
87.2
90.1
78.1
1.72
3.98
–
–
SkexGen
94.6
91.3
89.1
91.1
91.7
92.2
81.2
1.49
3.58
–
–
HNC-CAD
95.4
93.8
88.3
94.5
94.7
94.7
82.3
1.33
3.24
–
–
Ours
99.3
97.6
93.5
97.2
96.3
98.6
85.6
0.95
2.51
–
–
DeepCAD-240
DeepCAD
75.2
72.5
76.1
77.6
79.3
77.3
64.5
1.85
4.09
8197MiB
52.8G
SkexGen
81.4
78.3
78.1
81.8
81.6
81.7
68.9
1.78
3.97
11235MiB
91.2G
Table 1: Quantitative comparison and complexity analysis (× 102 ) under DeepCAD and DeepCAD-240 test sets. ↑ indicates higher is better, ↓ lower is better. All models are trained on the unified DeepCAD-240 dataset.
Model
ACC cmd↑
ACC param↑
COV ↑
MMD ↓
JSD ↓
w/o Tree
87.5
84.6
69.4
1.46
3.25
MLP
75.3
72.1
67.8
1.73
3.81
Transformer
82.6
81.3
69.1
1.55
3.67
Vanilla Mamba
89.2
87.6
72.7
1.19
3.05
Ours
91.2
89.3
73.9
1.12
2.97
Table 2: Ablation study on the DeepCAD-240 test set. ↑ indicates higher is better, ↓ lower is better. “w/o Tree” denotes the model trained without hierarchical encoding.
Sequence Type
Token Type
Token Value
Token Representation
Description
Structure & Control
pad
0
(0,0)
Padding Token
cls
1
(1,0)
Start Token
end
1
(1,0)
End Token
esolid
2
(2,0)
End Solid
esketch
3
(3,0)
End Sketch
eface
4
(4,0)
End Face
Table S1 : CAD sequence representation (Explicit Hierarchy without Revolution). Continuous parameters are uniformly quantized into [11,266] . Note the inclusion of Face-level hierarchy ( ef ) and explicit primitive parameters.
Figure S1 : Illustration of the sketch–extrusion sequence construction. Each CAD model is decomposed into a procedural chain of sketches and extrusions. The process begins with 2D sketch definition and proceeds through sequential extrusion operations, progressively forming a coherent solid structure. This sequence explicitly encodes design history, preserving both geometric and topological dependencies across modeling stages.
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
Dataset
Total
Avg. Length
1–40
40–60
60–80
80–160
160–240
DeepCAD [ 32 ]
178,238
15
44.58
55.42
–
–
–
DeepCAD-240 (Ours)
215,914
36.2
76.6
12.0
5.9
5.2
0.21
Appendix
Table S2 : Statistical comparison between the original DeepCAD dataset and our extended DeepCAD-240 dataset, including total samples, average command length, and sequence length distribution (%).
Figure S2 : Distribution of CAD command sequences lengths in the DeepCAD-240.
Figure S3 : Additional qualitative comparisons. Each row shows representative CAD samples generated by DeepCAD, HNC-CAD, and our GeoFusion-CAD, along with ground-truth models. GeoFusion-CAD consistently produces geometrically complete and watertight solids with smooth curvature and accurate local features, while baseline methods often exhibit surface distortions, missing connections, or inconsistent boolean joins in complex structures. These examples further demonstrate that the combination of hierarchical tree encoding and G-Mamba diffusion yields improved geometric stability and scalability across extended command sequences.
Model
ACC cmd↑
ACC param↑
ACC line↑
ACC arc↑
ACC circle↑
ACC ext↑
COV ↑
MMD ↓
JSD ↓
Flat Sequence (w/o Tree)
87.5
84.6
79.3
71.5
73.2
81.1
69.4
1.46
3.25
With Tree (Ours)
91.2
89.3
84.2
89.8
86.8
94.9
73.9
1.12
2.97
Appendix
Table S3 : Ablation on hierarchical tree representation on the DeepCAD-240 test set. ↑ indicates higher is better, ↓ lower is better.
Model
ACC cmd↑
ACC param↑
ACC line↑
ACC arc↑
ACC circle↑
ACC ext↑
COV ↑
MMD ↓
JSD ↓
MLP (replace G-Mamba)
75.3
72.1
66.8
60.5
63.7
68.2
67.8
1.73
3.81
U-Net (replace G-Mamba)
80.4
78.6
71.2
64.3
67.8
72.1
70.2
1.37
3.45
Transformer (replace G-Mamba)
82.6
81.3
74.9
67.6
69.8
76.3
69.1
1.55
3.67
Vanilla Mamba (replace G-Mamba)
89.2
87.6
82.1
78.5
82.4
89.1
72.7
1.19
3.05
Full (G-Mamba, Ours)
91.2
89.3
84.2
89.8
86.8
94.9
73.9
1.12
2.97
Appendix
Table S4 : Ablation on the G-Mamba diffusion block compared with standard alternatives. ↑ indicates higher is better, ↓ lower is better.
Figure S4 : Additional CAD modeling results generated by GeoFusion-CAD. The results cover a variety of industrial-style parts, including prismatic, rotational, and mixed-form geometries. The generated solids are watertight, structurally coherent, and geometrically precise, demonstrating the robustness and generalization of our approach.
Parametric CAD modeling represents 3D designs as editable, constraint-driven construction histories and develops methods to generate, reconstruct, and revise them.
Recent deep learning approaches seek to automate CAD creation by representing a model as a sequence of discrete commands and parameters, and then generating them using autoregressive models or continuous diffusion operating in Euclidean embedding space. However, continuous diffusion perturbs representations in a continuous Euclidean domain that does not reflect the inherently discrete and heterogeneous nature of CAD tokens, often producing perturbed representations that map to semantically invalid symbols. To overcome this limitation, we propose a cascaded discrete diffusion framework for CAD generation, which consists of a command diffusion for generating CAD commands and a parameter diffusion conditioned on CAD commands. Unlike isotropic Gaussian perturbation, the forward process of our approach operates directly over categorical token distributions using delicate transition matrices. For commands, we adopt an absorbing-state transition matrix that progressively corrupts tokens to a designated symbol; for parameters, we introduce specific transition matrices tailored to heterogeneous attributes: a Gaussian kernel for coordinate continuity, a scale-invariant kernel for dimensional values, and a prior-preserving kernel for boolean attributes. The reverse process is achieved by two denoising networks: a Transformer-based encoder for command recovery, and a parameter network with extra local self-attention for command-level interaction and cross-attention for conditional injection. Experiments on the DeepCAD dataset show that the proposed approach surpasses existing autoregressive and continuous diffusion models on unconditional generation metrics, while qualitative results validate effective controllability in conditional generation tasks. Source codes will be released.
Honghu Pan, Xiaoling Luo, Yongyong Chen +2
School of Artificial Intelligence and Robotics, Hunan University · College of Computer Science and Software Engineer, Shenzhen University · School of Computer Science and Technology, Harbin Institute of Technology, Shenzhen +1
Computer-Aided Design (CAD) generative modeling has a strong and long-term application in the industry. Recently, the parametric CAD sequence as the design logic of an object has been widely mined by sequence models. However, the industrial CAD models, especially in component objects, are fine-grained and complex, requiring a longer parametric CAD sequence to define. To address the problem, we introduce Mamba-CAD, a self-supervised generative modeling for complex CAD models in the industry, which can model on a longer parametric CAD sequence. Specifically, we first design an encoder-decoder framework based on a Mamba architecture and pair it with a CAD reconstruction task for pre-training to model the latent representation of CAD models; and then we utilize the learned representation to guide a generative adversarial network to produce the fake representation of CAD models, which would be finally recovered into parametric CAD sequences via the decoder of MambaCAD. To train Mamba-CAD, we further create a new dataset consisting of 77,078 CAD models with longer parametric CAD sequences. Comprehensive experiments are conducted to demonstrate the effectiveness of our model under various evaluation metrics, especially in the generation length of valid parametric CAD sequences. The code and dataset can be achieved from https://github.com/Sunny-Hack/Code-for-Mamba-CAD-AAAI-2025-.
Xueyang Li, Yunzhong Lou, Yu Song +1
School of Computer Science, Fudan University, Shanghai, China
Computer-Aided Design (CAD) models are defined by their construction history: a parametric recipe that encodes design intent. However, existing large-scale 3D datasets predominantly consist of boundary representations (B-Reps) or meshes, stripping away this critical procedural information. To address this scarcity, we introduce Zero-to-CAD, a scalable framework for synthesizing executable CAD construction sequences. We frame synthesis as an agentic search problem: by embedding a large language model (LLM) within a feedback-driven CAD environment, our system iteratively generates, executes, and validates code using tools and documentation lookup to promote geometric validity and operation diversity. This agentic approach enables the synthesis of approximately one million executable, readable, editable CAD sequences, covering a rich vocabulary of operations beyond sketch-and-extrude workflows. We also release a curated subset of 100,000 high-quality models selected for geometric diversity. To demonstrate the dataset's utility, we fine-tune a vision-language model on our synthetic data to reconstruct editable CAD programs from multi-view images, outperforming strong baselines, including GPT-5.2, and effectively bootstrapping sequence generation capabilities without real construction-history training data. Zero-to-CAD bridges the gap between geometric scale and parametric interpretability, offering a vital resource for the next generation of CAD AI.
Mohammadmehdi Ataei, Farzaneh Askari, Kamal Rahimi Malekshan +1