FlexCAD: Unified and Versatile Controllable CAD Generation with Fine-tuned Large Language Models
Authors: Zhanwei Zhang
Shizhao Sun
Wenxiao Wang
Deng Cai
Jiang Bian
Venue: ICLR 2025 Poster (2025)
Keywords: CAD generation
large language model
Primary area: generative models

Abstract: Recently, there is a growing interest in creating computer-aided design (CAD) models based on user intent, known as controllable CAD generation. Existing work offers limited controllability and needs separate models for different types of control, reducing efficiency and practicality. To achieve controllable generation across all CAD construction hierarchies, such as sketch-extrusion, extrusion, sketch, face, loop and curve, we propose FlexCAD, a unified model by fine-tuning large language models (LLMs). First, to enhance comprehension by LLMs, we represent a CAD model as a structured text by abstracting each hierarchy as a sequence of text tokens. Second, to address various controllable generation tasks in a unified model, we introduce a hierarchy-aware masking strategy. Specifically, during training, we mask a hierarchy-aware field in the CAD text with a mask token. This field, composed of a sequence of tokens, can be set flexibly to represent various hierarchies. Subsequently, we ask LLMs to predict this masked field. During inference, the user intent is converted into a CAD text with a mask token replacing the part the user wants to modify, which is then fed into FlexCAD to generate new CAD models. 
Comprehensive experiments on public dataset demonstrate the effectiveness of FlexCAD in both generation quality and controllability.

Published as a conference paper at ICLR 2025.
FLEXCAD: UNIFIED AND VERSATILE CONTROL- LABLE CAD GENERATION WITH FINE LINE-TUNED LARGE LANGUAGE MODELS
Zhanwei Zhang";
Shizhao Sun"t, Wenxiao Wang Deng Cai', Jiang Bian State Key Lab of CAD&CG, Zhejiang University
2 Microsoft Research
3 School of Software Technology, Zhejiang University
rzhanweizhang wenxiacwang] edu....uuuuuuuuuuuuu
edu.
sshissu, jiabia aabbia)emicroooff.. com, dengcai@cad. ju. edu en
ABSTRACT
Recently, there is a growing interest in creating computer-aided design (CAD) models based on user intent, known as controllable CAD generation. Existing work offers limited controllability and needs separate models for different types of control, reducing efficiency and practicality. To achieve controllable genera- tion across all CAD construction hierarchies, such as sketch-extrusion, extrusion, sketch, face, loop and curve, we propose FlcxCAD, a unified model by fine-tuning large language models (LLMs). First, enhance comprehension by LLMs, we represent a CAD model as a structured text by abstracting each hierarchy as se- quence of text tokens. Second, to address various controllable generation tasks in unified model, we introduce a hierarchy-aware masking strategy. Specifically, dur- ing training, mask hierarchy-awand field in the CAD text with mask token. This field, composed of a sequence of tokens, can be set flexibly to represent var- ious hicrarchies. Subsequently, we ask LLMs predict this masked field. During inference, the user intent is converted into CAD text with a mask token replacing the part the user wants to modify, which is then fed into FlexCAD to generate new public dataset demonstrate the ef-
CAD models. Comprehensive experiments fectiveness FlexCAD in both generation quality and controllability. Code will be available at httpttt://// //t::////hbhb cow. coom/microsen httmm//ccooooff/eecca.
(a)
Sketch- Extraion
(2) Paco
tei level
level
1d)
Spetch
@ Curve
5nd the theses part
Genertee CAD models
and te chessn part
Generbee CAD models
Figure Controllable CAD generation achieved by FlexCAD. shows the input: an original CAD model along with the part the user intends modify (highlighted in blue). The right side displays the output: multiple new CAD models with only the chosen part changed. Users have the flexibility to specify the part in any CAD construction hierarchies, ranging from coarse levels like sketch-extrusion to fine levels like curve (as illustrated from (a) to (f).
each figuri, the left side
Work done during an internship at Microsoft Research Asia. Corresponding author.

---

Published as a conference paper at ICLR 2025.
1 INTRODUCTION
A computer-aided design (CAD) model is a digital representation of a 2D or 3D object. It has been widely used across numerous industries, including architecture, product design and manufacturing, facilitating precise, efficient, and innovative development Ganin al. (202I): Khan al., (2024). In commonly used CAD tools like SolidWorks and AutoCAD, sketch-and-eree prevalent. This involves drawing 2D sketches and then extruding them into 3D shapes. Compared to other representations, such as Constructive Solid Geometry (CSG) Yu et al. (2024). B-rep Xu jct al. (2024), or voxel Li et al. (2023) and point cloud Khan et al. (2024)- formats, SEM, incorporating multiple CAD construction hierarchies including sketch-extrusion, extrusion, sketch, face, loop and curve (see Fig. Bl)). directly illustrates the drawing process of a 3D object. This allows for easy editing and reuse of CAD models, which is essential in CAD development.
modeling (SEM) is
Recently, there is an increasing interest in developing generative models to automatically produce SEM of CAD mode[" Specifically, DeepCAD Wu et al. (2021) focuses uncontrollable gen- eration, where a CAD model is generated from a randomly sampled vector. However, providing controllability, i.e. generating CAD models according to user intent, is crucial for the practical ap- plication of generative models. To address this, SkexGen Xu et al.] (2022) and Hnc-cad Xu et al.) (2023) implement disentangled codebooks to offer some levels of control. As each codebook en- codes particular construction hierarchy, their controllability is quite restricted. For instance, Skex- Gen does not allow selecting a specific sketch for modifications when a CAD model comprises multiple sketches, nor can it handle finer-grained hierarchies such as faces and loops. Hne-cad lacks control over the topology and geometry of curves. In summary, existing methods face challenges in providing adequate controllability across all CAD construction hierarchies. Additionally, they require separate models to deliver different types of control, which is inefficient and less practical.
The emergence of large language models (LLMs) offers insights for addressing these challenges. First, LLMs have exhibited remarkable success in handling diverse user queries with a single and unified model /Coung et al. (2024). This phenomenon not only occurs in natural language tasks but also extends to other areas with domain-specific fine-tuning, such as human motion generation Diang al. 2222) and crystal material synthesis Gruver al. (2024). Second, L.Mss might have acquired CAD-related knowledge during the pre-training by learning CAD-specific codes, such as JSCAD codes Makatura et al. (2023). Third, prior to the rise of LLMs, small transformer-based models were explored for tasks like uncontrollable generation and image-to-sketed translation in the 2D sketch domain Ganin et al. (202T), showcasing the possibility of LLMs from a different perspective.
In this work, we introduce FlexCAD, a unified model designed for controllable CAD generation across all hierarchies by fine-tuning L.Mss. As shown in Fig. [ FlexCAD receives the original CAD model along with the part the user wants to modify (highlighted in blue). Here, users can specify the part any hierarchy. FlexCAD then generates multiple new CAD models, altering only the selected part. To achieve these abilities, first, FlexCAD translates a CAD model into a concise and structured text (see Fig. 3). Specifically, in each sketch, the curve type (e.g.. a line) is directly represented as textual tokens. The numerical data indicating geometry (e.g., point coordinates in a line) is converted into decimal integers and then into textual tokens. A special token is added to mark the end of each hierarchy. Tokens from the finer-level hierarchy are concatenated to form the representation for the coarser-level hierarchy. We use a similar way to convert each extrusion. Consequently, unlike the one-hot representation used in Xu et al. 2022). FlexCAD provides a concise text representation of a CAD model, facilitating casier processing and understanding by LLMs. Second, FlexCAD introduces hierarchy-aware masking strategy to enable fine-tuning LLMs for various controllable CAD generation tasks (see Fig. 2 During training, we replace hierarchy-aware field, which contains a sequence of tokens in the CAD text, with a mask token. This field can be set adaptably to reflect various hierarchies. Then, we ask LLMs to predict the masked field. To achieve this, we design prompt templates for all hierarchies, where the mask tokens are tailored to match the corresponding hierarchies. These templates tuning of LLMs. In this way, we ensure that the generation tasks for all hierarchies are learned in a single and unified model. Besides, unlike Xu et al. 2202 2023) that requires multi-stage training, Flex achieves end-to-end training. During inference, a CAD model is represented as a CAD text with mask token replacing the part the user wants change. The masked CAD text is fed into the
uniformly sampled at each epoch during the fine-
In the following, we will use CAD model refer to SEM of a CAD model for brevity.
2

---

Published as a conference paper at ICLR 2025.
fine-tuned LLMs to get predictions. After infilling the masked text with these predictions, FlexCAD produces CAD texts that can be rendered into new CAD models. Overall, our contributions are:
We propose FlexCAD, unified and versatile model for controllable CAD generation across all hicrarchies, including sxetch-xxtrusion, extrusion, sketch, face, loop and curve. To the best of our knowledge, FlexCAD is the first to leverage LLMs for controllable CAD generation. It converts a CAD model into a brief, structured text and employs hierarchy- aware masking fine-tune LLMs for various controllable CAD generation tasks. We conduct extensive experiments on public datasets. Despite its simplicity, FlexCAD greatly improves generation quality and controllability. showing its effectiveness on the tasks presented in this work and indicating potential for other CAD generation scenarios.
2 RELATED WORK
CAD Model Generation. A CAD model represents a 2D or 3D object digitally, with far-reaching applications spanning multiple industries Li et al. (2024b). Existing CAD generation methods can be classified into three categories based on representations of CAD models Khan et al.) (2024): con-
structive solid geometry (CSG), boundary representation (B-rep) and sketch-and-extrude modeling (SEM). CSG combines primitives (e.g., cubes, cylinders, or spheres) via Boolean operations (e.g.. union, subtraction difference) construct CSG tree Laidlaw et al. (1986); Du al. (2018); Kania et al. (2020); Ren et al. (2021); Yu et al. 2022 2024). B-rep characterizes CAD model as graph Ansaldi et al. (1985), consisting of sets of interconnected faces, edges, and vertices Jayaraman
et al..
2023);
Wang et al. (2022): Jayaraman et al. (2023); : Xu et al. (2024).
Our work focuses on SEM, which directly models the drawing process of CAD model, i.e., drawing 2D curves to make sketches and then extruding them into 3D shapes. There are multiple construction hierarchies in SEM, such as sketch-extrusion, extrusion, sketch, face, loop and curve. Compared to CSG and B-rep, it enables easy editing and reuse of CAD models, which is critical in the CAD design process. For SEM of a CAD model, DeepCAD Wu et al. (202T) utilizes a transformer- based Vaswani et al. (0177) autoencoder for unconditional CAD generation. It merely designates controllable generation as a future application. Nevertheless, offering controllability, i.e., the ability to generate CAD models based user intents, is critical for enhancing the efficiency of CAD design workflow in practical applications. SkexGen Xu et al. (2022) proposes to disentangle the topology and geometry of sketches and extrusions provide some levels of control. However, does not allow choosing a specific sketch, face, loop or extrusion for editing when multiple options exist. Hnc-cad Xu al. (2023) exploits three codebooks based on VQ-VAE framework Van Den Oord et al. (2017) to control loop, sketch and extrusion level generation, respectively. While it offers finer control, struggles to manage the topology and geometry in the curve level. To sum up, despite significant progress, existing work face challenges in offering controllability across all construction hierarchies. Besides, they develop separate models to support different types of control.
Large Language Models (LLMss. LLMs have shown significant success recently Touvron et al. (0023; ; Liu et al. (2024). Fine-tuning LLMs has demonstrated notable versatility and efficacy Luo et [2.24 Chung et al. (2024); Roziere et al. 2023y: Ma et al. (2024); Zhang et al. (2024); Li al.
(2024a). Specifically, the fine-tuned LLMs have displayed exceptional success by simultaneouse handling various generation tasks within unified framework Wu al. (2024): Jiang et al. (2024);
Gruver et al. (2024); Zou et al. (2024). Moreover, L.LMs are generally pre-trained using extensive high-quality datasets with ciisssdiccpplnaryy and abundant knowledge WWnzek et al. 2020); Touvron et al.) (023). For example, LLMs may have acquired CAD-related knowledge by learning CAD codes, such as JSCAD codes Makatura et al. (2023). Encouraged by these achievements, we explore the potential of using LLMs to tackle the aforementioned challenges in CAD generation.
3 METHODOLOGY
In this section, we introduce FlexCAD, a unified model for controllable CAD generation across all construction hierarchies. As shown in Fig. T it receives original CAD model along with the part the user wants to modify (highlighted in blue), and generates multiple new CAD models with only the selected part altered. To achieve this, as illustrated in Fig. FlexCAD first translates CAD
3

---

Published as a conference paper at ICLR 2025.
Pha--taxddLa LLM
Brodcedd Tokone
TA Rendening
Okenss
Tokuua
Epoch
Protrained LLM
+ LoRA
Infillig
Training set
Unified Training
Epoch =1
Struclued Tect Repressmation
Hieracchy-awe awar Masling
Instructions + nswers
Prompls
Iistroctions
Prompls
dedind Mascing
S
Test
(a) The Training Process
(b) The Inference Process
The overall framework of FlexCAD. (a) Training process. Initially, a CAD model is converted into a structured text. Next, a hierarchy-aware masking strategy proposed to mask a specific field in the text with special mask token. This field is set differently at each epoch to reflect various hierarchies. Then, LLMs are fine-tuned to predict the masked field. (b) Inference process. The original CAD model is transformed into structured text with mask token replacing the part the user wants to change. The fine-tuned LLMs are provided with this masked text to generate diverse predictions, which are then converted into new CAD models by infilling and rendering.
Figure 2:
Loop
Sutriisa
CADANN
1i mare met 42.3 stave anc sazv ent- and-Jam0 earv -oop
GIICE SAST ILL wtase arc dap mnt
mub-ding
maae dap eat
2021
(a)
Figure 3: (a) An illustration for construction hierarchies of a CAD model. (b) Structured text repre- sentation for the CAD model shown in (a). The colors beneath the texts in (b) are used to indicate the relationship to construction hierarchies depicted in (a). e.g., blue for a curve and green for loop.
model into structured text (Sec. B.I). and then introduces hierarchy-aware masking strategy to enable fine-tuning LLMs for multiple controllable CAD generation tasks (Sec. 3.2)
3.1 REPRESENTING CAD AS STRUCTURED TEXT
Following the conventional definition of SEM of CAD model Wu et al. 2021 Xu et al. 2022 there are multiple construction hierarchies, illustrated in Fig. aa). A curvve i.e, line l, arc a, or circle c, forms the base level, represented by one, two, or four points respectively. Each point is denoted by its x and y coordinates. A 'loop' L denotes a closed path, comprising either a single curve (i.e., circle) or multiple curves (e.g., line-arc-line). A 'face' F is a 2D area, characterized by single loop or an outer loop with one or multiple inner loops acting as holes. A 'sketch' S is composed of one or multiple faces, sharing common extrusion command. An 'extrusion' E is command that extends a sketch from a 2D plane into a 3D body. A 'sketch-extrusion" SE represents single sketch-extrusion 3D body. A 'CAI) model' M comprises one or multiple SE entities. As shown in Fig. BB), we represent CAD model as a succinct and structured text. Specifically, in each sketch, we start by representing curve since it is the base level. The curve type (i.e., line, arc or circle) is represented directly as textual tokens. The point coordinates of the curve, which are numerical, contrasts with Xu et al. (2022) that uses binary representation for point coordinates. For example, when discretizing coordinates into 64x64 grid, Xu et al. (2022) denotes the center coordinate as ((0, 1, 1, 1], [0, 1, 1)), while we represent it as 311, Next, the curve is denoted as a sequence of textual tokens, with the first one indicating its type and the others representing point coordinates (the text with a blue background in Fig. 3())). Notably, we add a special textual token H end' to mark the end of each hierarchy, where E (curve, loop, face, sketch, extrusion). This is also different from Xu et al. (2022) where one-hot vectors are used as ending flags. We concatenate tokens of multiple curves to create the representation for a loop (the text with green background in Fig. b)). Then, we use similar way to form representations of other hierarchies, including face and sketch (the texts with red and yellow backgrounds in Fig. B()).. Furthermore, an extrusion can also be represented using textual tokens, with the first specifying its type (e.g., add or cut) and the others denoting its numerical attributes (the text with a brown background in Fig. (b)). Finally, complete CAD model is assembled by concatenating all the textual tokens
expressed as decimal integers and then converted into textual tokens. This
4

---

Published as a conference paper at ICLR 2025.
from its sketch-extrusions (the text with cyan background in Fig. B()), please see the meaning of numbers in the text in the appendix). Consequently, we convert a CAD model into a structured text, enabling efficient processing and comprchension by LLMs. Besides, our FlexCAD shortens the overall token length compared to Xu al. (2022). Moreover, this text is straightforward to parse and interpret, thereby facilitating the implementation of the below hierarchy-awe aware masking strategy.
3.2 FINE-TUNING LLMS WITH HIERARCHY-AWARE MASK PREDICTION
Instrctioon Below is desctpttin superaee whare command his been riplaeed with stiing "slothh esbraion maal)] Ideetch estreiaz mork)"
(b)
jisecbettnnoo mook] estrci- musk)
Benenate a string that sotle mpaace 1skmsh- ostuston mork (dottz entrason maskl" tn the CAD sequece:
Arzavnn 26...6.17.3 33.3 scave line 48.17 starre cod- ane 15,31,53 scurve cod-
souve 50or
31,31,11 daep. 24,1,1,,2333333311
doop
30.33. 31,31, 101.011111 1,2,,,2,,,,,, 21,31,31
Inairaation Rolow a gersi decorsoon
command ha been oggioee with strly "Joaedh makk"" 00.17 soarre SacP 40.--.0. stame aede-itee 16:45 scavee deop store etorch 31,,3,3,,,,,31.. A.O. A.I.A........................A
sepuece
(c)
art.6.11..1122 soume
Sell
Gesanate saling could
Talanii-acttiio pask?
Ansuen crdie.6.3 16311 31. 06.3, 31,11,00 spave and> doop mnt crrin 24,0,,3,,44. (.J. 31.38 spaie endo dhop endo dore reco -dotth, endo
Lid 3..33....3.,.3.... wWw.LAA...AA.....
soctuaton end>
Instratiiee
a CAD
opdiced with strin "lec makk]
(d)
endo 06.17
endi-line 18.45
deep
etoexh end-
and 30.33 13..1.11.111 MU.. 1. 31 cectusenn and> (lopp mask) llopp mask) endo eterthh and-
Ldd 31 38,38, 3,,33,,,,,,,,,1..1.33 A.S.L.A...............
31.1, saczuaton end>
Gementt string that could meplasn Toog mekkl [logg meek)" in the CAU seganoo
Arauunt crrde.1.33 S1, 18, 46, 31,44 spave ando doopp mnt 2r 4,11, 11,34,255,5, 38 sgrve endo deep ands
Instraation Edow is sasal descnston of CAD sequeece when ooe consrnsd has boen oplaned with the stiae "Jur mask] (Joe mak) (ore meek) Iime mask?
(e)
jure musk) Line makk junt masi) (iiee mack) soep <lace sannch 31 31 10000001100000 31.3 vosmustz, end>
16,32.18,33.3111 21,
scare ceco-doap deep cade 20,2 21.22.22200 30 31,30 souve cndo slog exdo stace end> seletch 38,,3889,,,,3 31,3,,3, A.A.I.
Masking Promot
Geaentee Ansuan 16,,3,3
could mplace mark [ime mask mork) [Ine mask? the GAD
Irn, H631 and (0,31.9 .9 ande Iin 16.40 and
Figure 4: (a) illustrates a CAD model and its structural diagram. (b), (c), (d) and (e) are four examples for prompt templates with the mask tokens designed to represent different construction hierarchies. The masked field for different hierarchies in the CAD model are highlighted in blue.
In the following, with the structured text representation (referred to as CAD text for simplicity), introduce how to fine-tune LLMs to develop a unified model for various controllable CAD gener- ation tasks. In general, during training, hierarchy-awan field in the CAD text is replaced with mask token. The field, which consists of a sequence of tokens, can be designed to reflect different CAD construction hierarchies. Next, LLMs are asked to predict the masked field (see Fig. 2a)). To accomplish this, we design different prompt templates, where the mask tokens are designed to align with the corresponding hierarchies (see Fig. 4). During inference, given CAD model, with a defined mask token, users can specify the part they want to modify (see Fig. (b)). Below, we further detail the design of prompt templates, the unified training and inference processes.
Prompt Template Design with Hierarchy-aware Mask. A prompt template includes an instruc- tion with a special mask token replacing a hierarchy-aware field, and an answer containing the to- kens of this field. Specifically, for the CAD level, we mask each internal sketch-extrusion with (stetch-extrusion mask]. In this case, other than the sketch-cxtrusion number, no information from the original CAD model is preserved. Fig. 4b) shows example. This allows us to freely generate CAD models with the expected number of sketch-extrusions during inference, facilitat- ing the creation of CAD models with varying complexity. For the sketch-extrusion, sketch and extrusion levels, we replace the relevant field with [sketch-extrusion mask]. [sketch mask], or [extrusion mask), respectively. Fig. 4cc) shows an example with one masked sketch-extrusion. For the face (loop) levels, given a face (loop), if it exclusively forms sketch (face), we mask this face (loop) with [ace mask] (doop mask)). In cases where multiple faces (loops) belong to the same sketch (face), we use a corresponding number of mask tokens to mask them all at once. Fig. d)) illustrates an example, where two loops are replaced by two mask tokens. With this strategy, the model learns to generate faces (loops) with varying numbers as described in different instructions. For the curve level, all curves of the same loop are masked with their type indicated in the mask token (i.e., line, are or circle). Fig. (( presents example where four curves (are-line-arc-line) belonging to the same loop are masked simultaneously. As the curve is the fundamental hierarchical level, the control of the topology and geometry of sketch comes from it. Specifically, once trained and given a loop, by keeping its internal curve type and number unchanged, we can only modify the geometry. Alternatively, by varying the type number of curves,
alter the topology.
5

---

Published as a conference paper at ICLR 2025.
Unified Training by Sampling Prompt Templates. At each epoch, for given CAD text, uni- formly sample a prompt template from the above seven hierarchies. The instruction in the template asks LLMs to predict the masked field autoregressively. Then, the cross-entropy (CE) loss between the prediction and the answer in the template is propaapaeee to update the L.M.s. To sum up, the advantage here is two-fold. First, by randomly choosing existing prompt templates at each epoch, we aim to establish a unified controllable generation model for various hicrarchies. Second, beyond the existing prompt templates, we can incorporate new templates that support other tasks, such as unconditional generation. Notably, we fine-tune LLMs using LoRA Hu et al. (2022) which allows a few parameters to be trainable while keeping most parameters fixed. This allows us to leverage the advantages of large-scale models while accelerating model convergence Hu et al. (2022).
Inference with User-defined Mask. During inference, CAD model is first converted to a CAD text, with mask token replacing the part that needs modification. This masked CAD text is then input into the fine-tuned LLMs to produce predictions. After infilling the masked text with these predictions, FlexCAD can provide various CAD texts that can be rendered into diverse CAD models. Notably, users do not have to strictly adhere to the masking pattern defined in the training process. For example, although the prompt template, used in training, masks all the loops tied to face simultaneously, this is not mandatory in the inference. Due to the strong generalization capability of LLMs, is possible to only mask single loop for local editing, illustrated in Fig. bb).
4 EXPERIMENTS
4.1 EXPERIMENTAL SETUP
Datasets. For consistency with prior work Xu et al. (2022) 2023), we evaluate our FlexCAD on the DeepCAD Wu et al. (202T) dataset. This dataset comprises 178,238 skefch-and-extrrsion se- quences, divided randomly into training, validation, and test sets in ratio of 90%-5%.-5%. To ensure data quality, we follow SkexGen Xu et al. (2022) to remove duplicate and invalid sequences. Subsequently, we convert all resultant CAD sequences into texts, as mentioned in Sec. 3.1
Implementation Details. We adopt the transformers Wolf et al. (202)) toolbox and select Llama-3- 8B Metal (2024) as the base LLM, which achieves superior performance among open-source LLMs. For the 8B model, we use LoRA Hu et al.] (2022) to fine-tune only 0.042% of their parameters, approximately 3.4 million. The LoRA rank and alpha are set to 8 and 32. The model is trained on four A6000 GPUs we employ the AdamW optimizer Loshchilov & Hutter (2018), set the batch size to 32, use a cosine annealing learning rate of 5 x 10- and train for 30 epochs. During the inference process, we set the sampling temperature 7 and Top-p at 1.1 and 0.9, respectively.
Metrics. We adopt metrics consistent with previous methods Xu et al. Generally, the metrics Coverage (COV), Minimum Matching Distance (MMD) and bensen-Shannow Divergence (JSD) measure generation diversity and quality on generated CAD models in comparison the test set. See their detailed descriptions in Xu al. (2023). Novel indicates the percentage of generated CAD models not present in the training set, while Unique represents the percentage of generated CAD models that appear only once within the generated set. Prediction Validity (PV) denotes the overall validity of predictions that can be rendered into 3D shapes rather than just 2D sketches or nothing. Realism denotes the realistic rate of generated CAD models compared to the training data, as assessed by human evaluators.
2022
2023
4.2 PERFORMANCE COMPARISION WITH EXISTING METHODS
Baselines and Tasks. We compare our FlexCAD with GPT-4o Achiam et al. (023), one of the most powerful closed-source LLMs, and two otate-of-the-art SaM-hased baselines: SkexGen Xu et al. (2022) and Hnc-cad Xu et al. (202)). Since SkexGen and Hnc-cad cannot simultaneously control CAD generation across all hierarchies as ours, we choose the sketch-level and extrusion- level controllable generation tasks for comparison following the principles below. First, they are common tasks that can be handled by each baseline. Second, there are official implementations of baselines for these tasks. For GPT-40, Hnc-cad and FlexCAD, given a CAD model from the test set, we randomly mask either a sketch or an extrusion and predict the corresponding masked field. Notably, despite our best efforts, SkexGen still has slightly different task settings compared to the

---

Published as a conference paper at ICLR 2025.
Table 1: Performance comparison on the DeepCAD test set. GPT-4o is enhanced with few-shot in-context learning. Specifically, each prompt comprises five exemplars randomly chosen from the training set. These exemplars include instructions and answers, following the format shown in Fig. Moreover, we obtain the performance values of SkexGen and Hnc-cad based on their official codes.
Best performances are in bold, and the accond-bests are marked by *.
Sketch-level
Extrusion
Method
COVt MMDJISDL Novelt Uniquet
PVT
Realism"
COVT
MMDJJSD Novelt Uniquet
PV1
Realism
GPT-4o 58.2%
1.34
1.43
69.7%
72.8%
62.3%
23.2%
53.3%
1.42
2.14
58.6%
65.3%
48.8%
19.7%
SkexGen 60.6%
1.27
1,51
90.7%*
93.5%
68.7%
34.8%
63.6%
1.23
1.44
89.3%
89.1%*
76.1%
35.2%
Hne-cad
62.4%*
1,21*
1,07
87.6%
92.1%
72.6%*
36.3%*
65.6%*
1.25*
1.38
86.2%
87.8%
79.7%*
38.0%
Ours 65.6%
1.19
0.82
92.1%
92.6%
93.4%
39.6%
68.5%
1.19
1.32
87.6%*
90.4%
93.3%
42.1%
CCAD mudels
Original
GPT-4o
Skexgon
Skerch-level
COE
C
Eine cad
Ous
GPT-4o
Skergen
Excrusion-leve
Unc-ead
Oun
Figure 5: Qualitative comparison results for four methods. The first row displays three original CAD models, where the color of each sketch-extrusion aligns with that in the corresponding structural di- agrams. In the following rows, given a CAD model, we randomly select its four newly predicted models for each method. The marks below the predictions are the corresponding masked and modi- fied sketches or extrusions. The red boxes illustrate some of the most unrealistic examples. The blue boxes indicate some of the most obvious cases, where multiple fields simultancously change in the same CAD model, rather than just the expected masked field.
above three methods. Specifically, when there are multiple sketches (or extrusions) in CAD model, SkexGen changes all the sketches (or extrusions) instead of the specified one.
Quantitative Comparison Results. We randomly selected Ik CAD models from the test set. For every method, we generated 10 predictions for each model, resulting in a total of 10k CAD models. For the metrics COV, MMD, and JSD that require subset of ground truths, we sampled 3k CAD models from the test set. The average scores across three runs are presented in Table [ Without fine-tuning, GPT-40 performs poorly. On the other hand, our FlexCAD outperforms the baselines
7

---

Published as a conference paper at ICLR 2025.
OBOOS
CAD level
Sketch-estrusion number
Sketch-estrusion number
Skescb-xtrration number
Sketch lovel
M
S
Sky
19N
Loop
GCCL
BB
Curve level
1O00
4 linca
lines
3 lines
lines +1 src
circke
eircle
lines
1 aec
Original
Figure 6: Our FlexCAD achieves controllable generation across different hierarchies, as introduced in 3.2 For the CAD level, produce CAD models aligning with the required sketch-extrusion number. For the sketch-extrusion, face and loop levels, the left side of each sub-figure shows an original CAD model along with its local structural diagram. The color of each highlighted field matches that in the diagrams. The right side shows the predictions with only the masked part being masked and edited. And the masked part is marked below the predictions. Similarly, for the curve level, below the predictions are user-defined curve type and number. Best viewed in color.
nearly all evaluation metrics, demonstrating significant superiority in generation quality and con- trollability. Particularly, FlexCAD achieves the most notable improvement on PV, reaching up to 20.8%-31.1 11.1% and 13.6%-44..5% in terms of sketch-level and extrusion-level controllable generation.
Qualitative Comparison Results. To illustrate the performance intuitively, we randomly selected three CAD models from the test set. As shown in Fig. [] the results clearly illustrate that FlexCAD greatly enhances the quality and controllability of CAD models compared to other competitors. Specifically, we tend generate well-structured CAD models that closely resemble real-world amples, contrasting with unrealistic models like the red boxes shown in Fig. 5 On the other hand, as shown in the blue boxes in Fig. [5] SkexGen cannot specify which sketch or extrusion modify, and Hnc-cad cannot preserve the integrity of the unmasked elements, even when recovering from the same codes. In contrast, we can mask any sketch or extrusion, ensuring that only the masked sketch or extrusion is modified while the remaining elements stay unchanged. This further confirms the effectiveness and superior controllability of our FlexCAD.
Human Evaluation. To evaluate Realism, for each method, seven crowd workers were shown 950 pairs of images from the generated data and the training data, following Xu et al. (2023). They were asked to judge which of the two was more realistic. As shown in Table for our FlexCAD, 39. 59.6% and 42.1 % the generated models are more realistic, These rates are the highest among all methods, further demonstrating the advantage of our FlexCAD.
4.3 ENABLING MORE CONTROLLABLE GENERATION TASKS
In addition the sketch and extrusion levels, our FlexCAD achieves controllable generation in other hierarchies, including the CAD, sketch-extrusion. face, loop, and curve levels. We provide some examples Fig. [6, where users can modify the specific fields of a CAD model according to their intent. Additionally, present detailed qualitative results across these hierarchies in Table 5 in the appendix. All the results together illustrate the effectiveness of our FlexCAD.
Furthermore, our FlexCAD can achieve iterative editing. For example, as shown in Fig. 7 a), starting from a simple CAD model, we iteratively edit it within newly generated -ketch-extrusion until the sketch-extrusion aligns closely with user requirements. On the other hand, shown in Fig. ((b), given a complex CAD model, we continuously adjust diverse hierarchy elements within different sketch-extrusions until they progressively match user specifications.
8

---

Published as a conference paper at ICLR 2025.
(b)
Two examples of iterative editing. (a) Based simple CAD model, a new sketch- extrusion is generated by adding a [sketch-cxtrusion mask] at the end of the CAD text. Similarly, four peripheral internal loops are created. Then, central quadrilateral loop is added and its geom- etry is altered. Finally, the new extrusion is adjusted to better match the original model. (b) Based on complex CAD model, modifications can be progressively applied various sketch-extrusions with the coop-extnasion-facc---r-----eeee level controllable generation to ultimately meet user needs.
Figure 7:
Table 2: Ablation studies for fine-tuning LLMs with different settings. Pre-trained denotes the initial pre-trained weights. Full and LoRA indicate full and a few parameters are train- able, respectively. Transformer-4M is small transformer-based Vaswani et al. (2017) language model. Its total number of trainable parameters is comparable to that our model with LoRA. and Llama-3-8B-Full denote training full parameters without and with the initial pre-trained weights, respectively. Llama-3-8B-Bll 3-8B-Instruct is an instruction tuned model in an 8B size Meta (2024). For Llama-3-70B Meta (2024), fine-tune only 0.023% of its parame-
ters, around 16.3 million. Best performances are in bold and the second-best bests are marked by *.
Model
COvt
MMD4
JSD4
Novelf
Uniquet
PVt
Transformer-4h (w/o Pre-trained, Full)
59.4%
1.37
1.02
85.8%
86.9%
80.2%
-lama-3--B--rom--Seraa (w/o Pre-trained, Full)
63.0%
1.23
0.91
89.7%
90.2%
89.5%
Llama-3-8B-Ful (w/ Pre-trained, Full)
66.4%*
1.20
0.85
92.6%
91.0%
91.7%
-aama----B--nstture (w/ Pre-trained, LoRA)
65.3%
1.22
0.89
91.4%
92.1%*
90.5%
Llama-3-8B (w/ Pre-trained, LoRA, A, ours)
65.6%
1.198
0.82
92.1%
92.6%
93.4%
Llama-3-70B (w/ Pre-trained, LoRA)
68.2%
1.13
0,84*
93.0%
91.8%
94.6%
Table 3:
Effectiveness analysis of the hierarchy-aware masking strategy and unified training. Random Masking denotes randomly masking 15%-50% continuous tokens within each CAD text, instead of the hierarchy-awe utilize the generic token [mask], rather than employing hierarchy-specifie mask tokens, such as [face mask), [loop mask] and etc. w/o Unified Training represents that we solely train a single
field. w/o dieraachh-sppeifa. Tokens indicates that when masking,
task, ie., the sketch-level controllable generation. Best performances are in hold.
Model
COVt
MMD
JSD1
Novelf
Uniquet
PVt
Random Masking
63.0%
1.25
1.02
88.2%
91.5%
90.6%
w/o Hierarchy-specific Tokens
63.7%
1.20
0.95
90.8%
91.7%
91.5%
w/o Unified Training
64.3%
1.17
0.89
91.6%
90.9%
92.2%
Ours
65.6 %
1.19
0.82
92.1% 1%
92.6%
93.4%
4.4 ABLATION STUDIES
We conduct several ablation studies evaluated on the sketch-level controllable generation as men- tioned Sec. 4.2 unless otherwise stated.
Settings of LLMss As shown in Table 2 without the pre-trained weights, both Transformer-4u and Baamna----B---ae -rom-Scratch achieve the lowest performances. This indicates that the pre- trained weights in LLMS contain valuable knowledge, which contributes to the performance gains. I.lam-3-SB--Full achieves performance similar that of our model. However, requires 80 hours to reach model convergence, compared just 20 hours for ours. This highlights the effectiveness of the LoRA strategy Hu et al. (2022). The performance of Llama-3-88 3-8B--Innttuc is slightly lower than that of our model. Conversely, the model scale increases significantly. Llama-3-707 achieves the best performance but more tine-consuming and costly (See Sec. A.6 the appendix).
Effectiveness of Hierarchy-Awand Masking, As shown in Table 3 Random Masking exhibits the lowest performance, underscoring the effectiveness of masking the hicrarchy-awar field. Further- more, the absence of hierarchy-specifi tokens leads to a performance decline. In essence, these

---

Published as a conference paper at ICLR 2025.
tokens potentially assist LLMs in accurately determining the level they are generating, conse- quently enhancing overall controllable generation performance.
Effectiveness of Unified Training. As depicted in Table without unified training, there is slight decrease in performance. In other words, when simultancously training multiple controllable generation tasks across various levels, the inter-task knowledge contributes to performance gains.
CONCLUSION
In this paper, we introduce a unified, versatile and user-friendly model, termed FlexCAD, which is particularly designed for controlling CAD generation across all hierarchies. To the best of our knowledge, we are the first utilize LLMs for controllable CAD generation. Specifically, we convert each CAD model into a brief and structured text and propose hierarchy-aware masking for fine-tuning- Our FlexCAD simple yet highly effective. Thorough qualitative and quantitative assessments conducted on public benchmarks confirm its effectiveness across all hierarchies.
ETHICS STATEMENT
The data used in this work is tailored for creating and modifying CAD models. Due its specialized nature, the misuse risk is naturally minimized, ensuring that the developed methods primarily benefit design and engineering tasks. In this work, we have invited crowd workers evaluate the quality of generated CAD models. We conducted this work in accordance with ethical guidelines to ensure that participants were treated fairly, respectfully, and safely throughout the process. We took steps to protect the privacy of crowd workers by not collecting personally identifiable information. The data annotated by the crowd workers was used only for research purpose related improving CAD generating techniques.
ACKNOWLEDGEMENT
In this work, Zhanwei Zhang, Wenxiao Wang and Deng Cai were supported in part by The National Nature Science Foundation China (Grant No: 62303406, 62273302, 62036009, 61936006), in part by Zhiyuan Laboratory (NO. ZYL2024022b).
REFERENCES
Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Ale- man, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.0 08774, 2023.
Silvia Ansaldi, Leila De Floriani, and Bianca Falcidieno. Geometric modeling of solid objects by using face adjacency graph representation. ACM SIGGRAPH Computer Graphics, 19(3):131- 139, 1985.
Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. Scaling cnttructionfiietuune lan- guage models. Journal of Machine Learning Research, 25(70):1-53, 2024.
Tao Du, Jeevana Priya Inala, Yewen Pu, Andrew Spielberg, Adriana Schulz, Daniela Rus, Armando Solar-Lezama and Wojciech Matusik. Inversecsg: Automatic conversion of 3d models to csg trees. ACM Transactions on Graphics (TOG), 37(6) 116, 2018.
Yaroslav Ganin, Sergey Bartunov, Yujia Li, Ethan Keller, and Stefano Saliceti. Computer-aided design as language. Advances in Neural Information Processing Systems, 34:5885-5897, 2021.
Nate Gruver, Anuroop Sriram, Andrea Madotto, Andrew Gordon Wilson, C. Lawrence Zitnick, and Zachary Ward Ulissi. Fine-tume tuned language models generate stable inorganic materials as text. In The Tweifth International Conference on Learning Representations, 2024, URL https: //openrevis net. wet./forrmmm www.rrrwwmmmmtooeoofofoooooo
10

---

Published as a conference paper at ICLR 2025.
Edward J Hu, yelong shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Con- ference Learning Representations, 2022.
Pradeep Kumar Jayaraman, Joseph George Lambourne, Nishkrit Desai, Karl Willis, Aditya Sanghi, and Nigel J. W. Morris. Solidgen: An autoregressive model for direct b-rep synthesis. Transac- lions on Machine Learning Research, 2023. ISSN 2835-8856.
Featured Certification.
Biao Jiang, Xin Chen, Wen Liu, Jingyi Yu, Gang Yu, and Tao Chen, Motiongpt: Human motion as foreign language. Advances in Neural Information Processing Systems, 36, 2024.
Kacper Kania, Maciej Zieba, and Tomasz Kajdanowicz. Joss--ne-unssupervied discovering of con- structive solid geometry tree. Advances in neural information processing systems, 33:8776-8786, 2020.
Mohammad Sadil Khan, Elona Dupont, Sk Aziz Ali, Kseniya Cherenkova, Anis Kacem, and Djamila Aouada. Cad-signet: Cad language inference from point clouds using layer-wise sketch instance guided attention. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4713-4722, 2024.
David H Laidlaw, W Benjamin Trumbore, and John F Hughes. Constructive solid geometry for polyhedral objects. In Proceedings of the 13th anmual conference on Computer graphics and interactive techniques, pp. 161-170, 1986.
Juncheng Li, Kaihang Pan, Zhiqi Ge, Minghe Gao, Wei Ji, Wenqiao Zhang, Tat-Seng Chua, Siliang Tang. Hanwang Zhang, and Yueting Zhuang. Fine-tuning multimodal LLMs to follow zero-shot demonstrative instructions. In The Twelfth International Conference on Learning Representations, 2024a. URI.httpa / /otttps://openreeeee ew net/ f 7q31
Pu Li, Jianwei Guo, Xiaopeng Zhang, and Dong-Ming Yan. Secad-net, net: Self-supervised cad recon- struction by learning sketch-extrude operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Puttern Recognition, pp. 16816-16826, 2023.
Pu Li, Jianwei Guo, Huibin Li, Bedrich Benes, and Dong-Ming Yan. Sfmead: Unsupervised cad reconstruction by learning sketch-based feature modeling operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 467 14660, 2024b.
Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. Advances in neural information processing systems, 36, 2024.
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Confer- ence on Learning Representations, 2018
Gen Luo, Yiyi Zhou, Tianhe Ren, Shengxin Chen, Xiaoshuai Sun, and Rongrong Ji. Cheap and quick: Efficient vision-language instruction tuning for large language models. Advances in Neural Information Processing Systems, 36, 2024.
Xueguang Ma, Liang Wang, Nan Yang, Furu Wei, and Jimmy Lin. Fine-tuning llama for multi-stage text retrieval. In Proceedings of the 47th International ACM SIGIR Conference Research and Development in Information Retrieval, SIGIR '24, pp. 2421-2425, New York, NY, USA, 2024. Association for Computing Machinery. ISBN 9798400704314.
Liane Makatura, Michael Foshey, Bohan Wang, Felix HähnLein. Pingchuan Ma, Bolei Deng, Megan Tjandrasuwita, Andrew Spielberg, Crystal Elaine Owens, Peter Yichen Chen, et al. How can large language models help humans in design and manufacturing? arXiv preprint arXiv:2307.14377, 2023.
AI Meta. Introducing meta lama 3: The most capable openly available Ilm to date. Meta AI, 2024.
Daxuan Ren, Jiammin Zheng, Jianfei Cai, Jiatong Li, Haiyong Jiang, Zhongang Cai, Junzhe Zhang, Liang Pan, Mingyuan Zhang, Haiyu Zhao, et al. Csg-stump: A learning friendly esg- like represen- tation for interpretable shape parsing. In Proceedings of the IEEE/CVE international conference computer vision, pp. 12478- 12487, 2021.
11

---

Published as a conference paper at ICLR 2025.
Baptiste Roziere, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, Xiaoqing Ellen Tan, Yossi Adi. Jingyu Liu, Tal Remez, Jérémy Rapin, et al. Code llama: Open foundation models for code. arXiv preprint arXiv:2308. 12950, 2023.
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302. 13971, 2023.
Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the 31st Inter- national Conference on Neural Information Processing Systems, NIPS 17, pp. 6000-6010, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 978151086096
Kehan Wang. Jia Zheng, and Zihan Zhou. Neural face identification 2d wireframe projection of manifold object. In Proceedings of the IEEE/CVF Conference Computer Vision and Pattern Recognition, pp. 1622-1631, 2022.
Guillaume Wenzek, Marie-Anne Lachaux, Alexis Conneau, Vishrav Chaudhary, Francisco Guzmán, Armand Joulin, and Edouard Grave. Ccnet: Extracting high quality monolingual datasets from web crawl data. In Proceedings of the Twelfth Language Resources and Evaluation Conference, pp. 4003 4012,40122200 2020.
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. Transformers: State-of-the-ar natural language processing. In Proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations, pp. 38 45, 2020.
Rundi Wu, Chang Xiao, and Changxi Zheng. Deepcad: A deep generative network for computer- aided design models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6772-6782, 2021.
Siyuan Wu, Yue Huang, Chujie Gao, Dongping Chen, Qihui Zhang, Yao Wan, Tianyi Zhou, Xi- angliang Zhang, Jianfeng Gao, Chaowei Xiao, et al. Unigen: A unified framework for textual dataset generation using large language models. arXiv preprins arXiv:2406. 18966, 2024.
Xiang Xu, Karl D.D. Willis, Joseph G Lambourne, Chin-Yi Cheng, Pradeep Kumar Jayaraman, and Yasutaka Furukawa. SkexGen: Autoregressive generation of CAD construction sequences with disentangled codebooks. In Kamalika Chaudhuri, Stefanie Jegelka, Le Song, Csaba Szepesvari, Gang Niu, and Sivan Sabato (eds.), Proceedings of the 39th International Conference on Machine Learning. volume 162 of Proceedings of Machine Learning Research, pp. 24698 -47244, 17-23 Jul 2022.
Xiang Xu, Pradeep Kumar Jayaraman, Joseph George Lambourne, Karl D.D. Willis, and Yasu- taka Furukawa. Hierarchical neural coding for controllable CAD model generation. Andreas Krause, Emma Brunskill, Kyunghyun Cho. Barbara Engelhardt, Sivan Sabato, and Jonathan Scar- lett (eds.), Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pp. 38443-3846) PMLR, 23-29 Jul 2023.
Xiang Xu, Joseph Lambourne, Pradeep Jayaraman, Zhengqing Wang, Karl Willis, and Yasutaka Furukawa. Brepgen: A b-rep generative diffusion model with structured latent geometry. ACM Transactions on Graphics (TOG), 43(4):1-14, 2024.
Fenggen Yu, Zhiqin Chen, Manyi Li, Aditya Sanghi, Hooman Shayani, Ali Mahdavi-Amiri, and Hao Zhang. Capri-net: Learning compact cad shapes with adaptive primitive assembly. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11768-17778 2022.
Fenggen Yu, Qimin Chen, Maham Tanveer, Ali Mahdavi Amiri, and Hao Zhang. D2esg: Unsuper- vised learning of compact csg trees with dual complements and dropouts. Advances in Neural Information Processing Systems, 36, 2024.
12

---

Published as a conference paper at ICLR 2025.
Renrui Zhang, Jiaming Han, Chris Liu, Aojun Zhou, Pan Lu, Yu Qiao, Hongsheng Li, and Peng Gao. LLaMA-adapter: Efficient fine-tuning of large language models with zero-initialized attention. In The Twelfth International Conference Learning Representations, 2024. URL https:
7 /poenreview.
Bo Zou, Chao Yang, Yu Qiao, Chengbin Quan, and Youjian Zhao. Llama-excitor: General in- struction tuning via indirect feature interaction. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 14089-14099, June 2024.
13

---

Published as a conference paper at ICLR 2025,
Appendix
Considering the space limitation the main paper, we provided more results and discussion in this appendix, which is organized as follows:
Section
A
Additional Implementation Details and Analysis.
Sec.
A.1
Meaning of Numbers in The CAD Text.
Sec. A.2
Detailed Results for Human Evaluation.
Sec. A.3
Quantitative results for Other Hierarchies.
Sec. A.4
Sensitivity Analysis of Key Hyper-paramenn parameters in Sampling.
Sec. A
Unconditional Generation Task.
Sec. A.6
Limitations and Future Work.
Section B: Additional Qualitative Results.
Fig.
T0
CAD Level Controllable Generation.
Fig.
Sketch-extrusion Level Controllable Generation.
Fig. 12
Extrusion level Controllable Generation.
Fig. 13
Sketch Level Controllable Generation.
Fig. 14
Face Level Controllable Generation.
Fig.
15
Loop Level Controllable Generation.
Fig. 16
Curve Level Controllable Generation.
Fig.
17
Unconditional Generation.
A ADDITIONAL IMPLEMENTATION DETAILS AND ANALYSIS
A.1 MEANING OF NUMBERS IN THE CAD TEXT.
Table 4: Effectiveness analysis of circle representation. To denote circle, Center&RRadius utilizes the center coordinates along with the radius, while Diameter uses two uniformly distributed points on the circumference that collectively define the diameter. Best performances in bold.
Model
COVt
MMD.
JSDI
Novelf
Uniquet
PVT
Rantur&Radius
63.2%
1.21
0.87
90.2%
90.9%
89.7%
Diameter
66.4%
1.20
0.87
90.7%
91.5%
90.3%
Four points (Ours)
65.6%
1.19
0.82
92.1 %
92.6% %
93.4%
In this part, explain the meaning of numbers in the CAD text, which builds upon SkexGen Xu et al. (2022). In sketches, two (three) points can actually form a line (arc). our work, a line, an are, and circle represented by one, two, and four points, respectively. Each point is denoted as its a and coordinates. Here, the second (third) point of a line (arc) is determined by the first point of the subsequent curve (or the first curve when loop is closed). Four points of circle uniformly distributed along the circumference. We implement two variants of circle representation. As shown in Table when evaluated on the sketch-level controllable generation task, our FlexCAD displays robustness across different circle representations, with Four points showing slight edge.
Each extrusion operation represented by 18 parameters: BYYTTRRRRRRSO..
B represents one of the three Boolean operations: add, cut or intersect. It occupies parameter.
indicates the displacements of the top and the bottom planes from the reference plane which sketch is extruded to form solid. It occupies 2 parameters.
represents the 3D translation applied to the extruded solid. It occupies 3 parameters.
R represents the 3D rotation of the extrusion direction. It occupies 9 parameters.
S represents the uniform scaling factor. occupies parameter.
represents the center of scaling 2D coordinate. It occupies parameters.
14

---

Published as a conference paper at ICLR 2025,
realisti:
mealatic
realisti
No rond
sélecting generated (sketch level)
sélacting
(ectrusion level)
Figure 8: Distribution of realism scores from human evaluators. These scores derived by comparing the generated CAD models produced by the four methods with the training samples.
A.2 DETAILED RESULTS FOR HUMAN EVALUATION
We present the detailed distribution of the Realism scores as mentioned Table I As shown the Fig. g the distributions for GPT-4o, SkexGen, and Hnc-cad are skewed towards the "less realistic' end. Conversely, our FlexCAD demonstrates primarily symmetric distribution, suggesting that the crowd workers struggle differentiate between the generated models and the training set.
A.3 QUANTITATIVE RESULTS FOR OTHER HIERARCHIES
Table 5: Quantitative results for controllable generation across other hierarchies. The detailed eval- uation setting is the same as that of Table [
Hierarchy
COvt
MMD4
JSD1
Novelf
Uniquet
PVT
CAD level
67.2%
1.14
0.77
92.6%
93.2%
91.8%
Sketch-extrusion level
65.3%
1.21
0.80
90.3%
89.7%
90.5%
Face level
62.9%
1.18
0.84
91.1%
90.9%
93.2%
Loop level
63.4%
1.15
0.81
88.3%
85.7%
90.5%
Curve level
59.1%
1.20
0.79
89.7%
91.5%
90.2%
In this section, we report the quantitative results across other hierarchies, including CAD, sketch-
extrusion, face, loop and curve levels. By combining the data from Table and Table we observe that there is not a significant difference in performance across all hierarchics. These results together illustrate the effectiveness of FlexCAD across all hierarchies.
A.4 SENSITIVITY ANALYSIS OF KEY SYPERRPARAMMTERS IN SAMPLING
Table Effectiveness analysis of key hyper-parameters, including the sampling temperature 7 and Top-p. Best performances are in bold and the second-bests are marked by
Model
COVT
MMDJ
JSDJ
Novel
Uniquet
PV
7 == 0.9
62.7%
1.20
0.84
92.0%
90.3%
96.7 %
r -= 1.1
65.6%*
1.19*
0.82*
92.1% %
92.6%*
93.4%
== 1.3
65.8%
1.12
0.78
91.9%
94.5%
86.8%
Top-p 0.8
62.9%
1.23
0.90
91.7%
87.8%
95.2
Top-p 0.9
65.6%%
1.19*
0.82*
92.1%
92.6%*
93.4%*
Top-p 1.0
68.3%
1.13
0.77
93.3 %
95.7%
89.0%
this part, we perform a sensitivity analysis on key hyperparameters in inference, including the sampling temperature 7 and Top-p. As shown in Table 6 either Top-p increases, the performance of the first five metrics exhibits improvement, whereas the performance of the last deteriorates. Essentially, higher values of Top-p lead to predictions that more random and varied, while the overall prediction validity PV declines. our experiments, we made trade-off by selecting the values of and Top-p guarantee that the PV value remains above 90%.
15

---

Published as a conference paper at ICLR 2025.
A.5 UNCONDITIONAL GENERATION TASK
Table 7: Performance comparison for the unconditional generation task. Each method generates
10k CAD models, which are then compared with randomly selected subset of 2.5k ground truth models from the test set. For the baselines, other than the metric PV, we derive the values of other
metrics from the original paper Xu et al. (2023), while the values of PV are obtained based on their
official codes. Best performances are bold, and the second-bests are marked by
Model
COVT
MMD4
JSD4
Novelt
Unique"
PVT
Realism
SkexGen 84.7%
1.02
0.90
99.1%*
99.8%
74.2%
46.9%
Hne-cad
87.7%
0.96*
0.68
93.9%
99.7%*
77.4%
49.2%
Ours
89.2%
0.91
1.53
99.3%
96.9%
90.5%
51.5%
Our FlexCAD can easily achieve unconditional CAD generation by simply adding a prompt template during training. Specifically, given CAD text, the instruction in the prompt template be as concise as 'Below a description of a CAD sequence:', while the corresponding answer is the whole CAD text. The quantitative and qualitative results shown in Table 7 and Figure T7 verify the effectiveness of our FlexCAD in unconditional CAD generation. Notably, as shown in Table JSD) exhibits the poorest performance. However, upon adjusting the sampling temperature Top-p to maintain the PV value at around 80%, the JSD value enhances significantly to 0.78.
A.6 LIMITATIONS AND FUTURE WORK
Inference time. We measure the inference time on one A6000 GPU (with batch size of 1) for the extrusion-level generation, averaging over 1,000 runs. The inference time of our FlexCAD (based on Llama-3-8B) is slightly higher than that of SkexGen Xu al. (2022) and Hnc-cad Xu et al.) (2022). at 0.56 seconds compared to 0.15 seconds and 0.38 seconds, respectively. Notably, and tested Llama-3-70B using four A100 GPUs (with batch size per GPU), yet the average inference time is still close to 3 seconds. Although LLMs demonstrate promising performance, they generally lack efficiency. while the task of controllable CAD generation is not particularly demanding in terms of real-time inference requirements, the slight increase in inference time of our FlexCAD (based on Llama-3-8B) is acceptable given the promising performance.
trained
Masking
5 lings
linos
linos
8
lines
Curve-lavel Controllable Generation
Figure 9: Failure cases. The generated CAD models display irregular polygonal shapes.
Failure cases. Despite the significant progress, our FlexCAD sometimes generates hallucinations. For example, when we implement curve-level controllable generation by replacing the original loops with 5, 6, 7, or 8 lines, our FlexCAD tends to generate plausible CAD texts. The CAD models produced from these texts typically exhibit irregular polygonal shapes, as illustrated in Fig. P In- terestingly, when the modifications are limited to 4 lines, the generated predictions tend to be more structurally regular, as illustrated in Fig. [6 We select loops composed of 4, 5, 6, or lines in the training set for analysis. The ratio is approximately 77. 77.9%-6.7. 6.2.%..%.55... 9.5%% 96.1.7%%447%% Consequently. the fundamental reason behind these hallucinations may stem from data imbalance, which could potentially be mitigated by collecting additional data.
Other limitations and future work. In this paper, we fine-tune LLMs to achieve controllable CAD generation. However, several unexplored domains warrant investigation. One such domain involves determining how LLMs can be effectively utilized for text-based generation tasks, such as providing descriptive text like "Create desk." generate corresponding CAD model. Since LLMs possess robust capabilities in controllable CAD generation and text comprehension. in future work, we aim to build advanced multi-modal L.L. tailored for the text-based CAD generation task.
16

---

Published as a conference paper at ICLR 2025.
Trsdruction: Below a pertial description of CA sequence where one command has been replaoed with the string "[skatch-extiieee mask]": [sietch-esttusion mask]
Generate a string thas could replace "[sketch ceaich--rttsse extrusion mask]" in the CA sequemoe:
Predictions
arc, 23,27,9,31 <cuvve end> are 23,35 23,3522, 25,38 <nurve end> 28,,28,39,1 39,31,53 <curve and> 34..34.99,37.3 <curve end> andd=arr,9,335,3,33
<curve eod> are 39,27, 27,3 37,37,2 24 ecurve and> arc,34 34,23,31, ecuve end> are, 28 23,25,24 <ouvee end> <doop and>
10.3le,00,11.66 16,25, 25,3222,1,16611
end> slopp end> cim 37,25,37,31,3,,,.
<curve end> <oop end>
(1
circle, 15,1,,,6,,,,1,,1111111 16,,,,,,,,,,,,,6,,11111 16,,1,,,,,,,,22222
<purve ends doop. end- circle 25,46,31,40,3 36,3,,,,, <cuvee end> <oop end> (rtle,40,31,6,,5,522..3 46,37 <purve, end> 4oop end> <face, and> <skttch end> 31, 1.1.........31100000000000000000
<extrusion_ end>
line,9.9 <purve end> 53,9 sourve end> line, 53,53 scurve and> 9.50.953 <turve end> <loop end> line, 14,17 <purve and> line 20,17
<ourve sod> line, 20,24 <ouvve end- 14,24 24 <ouvee end> <loop end= 14,38 <ouvee end> Line 20,38 ecuvve end= line 20, 45
/ <purve end> line, 14.45 scuve end> <loop <ourve sod> slopp end- line 42,38 erurve lnd-ling 42,45 <curve end> line 48.45 souvee end> line 48,38 ecuvee end> <loop and>> <face and> esketch and> add 2dd,,31,2,,31.33 31,,1,,1,1,,,00000 1.0.0.0.11..0..000... <ourve end> cloop end> 15,3,,,,,,1118,,2, 28,,,,2,,,,,18,,, <ouvve ends doop ends 14,,,,,,,,,,,,,,,,,,,,,
42, scurve end> (od.line.48) scuvve end> 48,24 ezurve und> line, 42,24
sextrusion end>
9,rcle 3,,,,,,,,,,,,,,,,3, <curve, end> doop end> cirsle.27,44 2,,,,,,,44 40,3,444444,111111.111 AB <curve end> doop end> 40,33, 44,27,47,31,44 <curve endo 4oop, end> <tace end> <sketch end>
1,0,62,31,31 <extrusion, end>
Text- to CDD Rendering
Sketch-extrusion number
33
Instruction: Below a pertial description a CAD sequennc where command has been replaced with the string" "sskech--ettusion mask]
[sletch-exttusion mask]";
[sketch extrusion mask] sketch-ecttnsion mask]
Generate a string that could replace "[sketc extrusin mask] (sketch extrusion mask]" in the CAD sequeace:
Predictions
drrele9,31,, 31,9,,,,33,,3,,1,,
scurve end> sloop end> <lace ends <sketch end> add 31,39,31,31 1111101110010010110000
<ectrusion, end> 2,6,9,16.16,16 16 <ourve end> line, 16,9 <ourve end> 46,46,9946 46,16 <cuvve end> line, 16 <curve end> 46,4,
(4)
<ourve end> line, 46,53 souve end> are 16.53, 13,163446 16.46 <curve ead> line. 9.46 46 <cuvve end> <loop ead> 1tt.:ee9.....111199333....
<ourve eod>> doop. end> eaace and> saketch end> add 31,31,,6,33 36,31,1,, 1,,33,11000000111111 1,0.10.00.1111111.1.11.11.1
<extrusion end>>
circle,9.31, 31, sourve end> <loop and> circle, 12,3,, 13,31,,,,11113.3 12,32322 ecurve end> <Joop end> 1911::177...811119..0... <purve <lopp end> circle, 1e 17,42,10,4,, 10,41, 18,411,8,8 <ourve end>> <loop end> 10,,1,, 12,31,13 <cuive end> <loop end> circle,30500 30.50,3,,50,11,, cincle,43,422 42,444 45,42, 44,43 <rurve
31, 49, 31,44932,50031.... 31,50 <rurve end> <loop end> circle/r,ee333 44,44441199. 19.19944 20,,4,,, <rurve end> <loop end>
dloop end> 49,31, 50,30,,2,,, 50,32 <zurve endo doop end> add,331,3.313311..11 1,000,0 1,0.0,0,1331.3311 3,3,1,3,31,33 eartrusion end> 31,3,,99,,,1,,,53333,,333 <sketch end> add,31,63,, 63,31, 31, 3,000,0,0000111 1.0.0,00.......0..3....
end> esketch end>
eruvve end> <loop end> <hice end>
<extrusion end>
1ine.6,11 <qurve end> 56 56 <ourve end> 16n5.56,51 sourve end l,ne,6,51 <rurve and> <lopp end> <face and> <sketch end- add,31,36,31,,11 1,0.0,0.....00 1,044,0,,,7,,000.7 cexttuuson and> 6.51,6.11 <curve end> 6,11 <zurve line.6.11 <nuree end> <axtrusion and>
16n5,56,51 <curve end> <loop end> <face end> ssketch end> cut, 19,31,30,11,66- 1,00001000000001111.1111111
Text CD Rendering
Sketch-extrusion number 22
Tredructione Relow a pertial description of CA sesuaence where one command has been replaced with the string" eetttch-eettusion mask] [sketch- extrusion mask] (skeich-ext eetrsseettiionn mask]":
[shetch- extrusion mask] (sketch extrasion mask] (skeeshheettsssssiii extrusion mask]
Generste a stzing that could replace "[sketch- extrusion mask] [skeich extrusion mask] [sketcl: extrusion mask]' in sequence:
Predictions
fircle,0,31,31,..c 11,.31,,33331.311.3 sourve end> eloop and> <lace end> <skettch end> add, 31, 311.131466611111111000000000 0.100 0.1.00........0........3...... 1,0,19,31,31
<extrusion, end> dircie, 31, 31, 9,53,31,31,5 <cuve end> <doop end> 21..233..1..3337.111....33 <curve ends <loop ead> <aace end> 0,000,000001100111 1,0,33,31,31 esctrusion ond>circle9,31.333 3,3 <cuive end> doop, ends <face end> <sketch end> add,31,55 35,55,,3, 31,31.3 1,10100000000111111111111 1,033311111 <extrusion_ end>
77)
<sketchh ead> add 43,,31,,,,3,,,1111
4,15 <cuive end> line, 58,15 <cuvve ends line. 58,47 <ourve end> line,4, <cuive end> doop. end> <iace ends <sketch ends
adr,31,44,3 31,,,11111 1,,00,1,,1,00,,0001111 1,0,0,00.11100 1,0,25,48,41 cestrusion end> 5,14 <rurve end> line.57,14 <rurve end> 17n4,57.48 <rurve end>
5,48 <cuvve end> <loop end> <face end> <sketch end> cut 18,31 31,66, 21,46,24,49 2,,0,, end> 12,9 ecuvve end> arr 50,5,,0001000 ecuive end> 53,12 enuree end> am,55,,50,52555 ar;, 12,53, 10,52 <curve end> 9,50.950 scuvve and> <loop and> chcce end> <sketch end> 26, 26, 46,24 10,00000111101111111111111001011 <evtnision end>
1,1,1,,2, exctrusion end> arc 12,10,10
(8)
end> 50,53 eruvee end>
line 5.14 <zurve and> 57 14 <ouree end> line fine.7..3 57,31 <curve end> lina,14,33 14,31 couvve end> lime 44 <curve and> 5, scuvve end>
doop end> <iace end> shetch eod> add 21,41, 31,,11,1..11 31,1,31,,11 1.0000000000011011 1.0.0.0.,66,,888 48,42 <extrusion end> line <ouve end> line 53.9 <curve end> 53,5. sauve end> line 0,53 <ourve and= doop end> <face end> esketch end> cut 36,3,,,,,,,,,,, 31,,1,31,,,,,,0000 1.0.0.0..111.00 10,10,60,37 exxtrusion end> arc. 12,22.32, ecurve end> line <cuive ood-line,38 38,56 56 <ourve end> line.32,56 32,56 <cuve end-
<loop and> <aae sed> esieetc end> 36,,,,,,1333, 1,000.0000001110..10 1,, 42,42 cartrusion end>
Rendering
Sketch-extrusion number 3
Figure 10: CAD level generation. Here, users can produce CAD models that match the required sketch-extrusion number. The marks of predictions align with those of the images (the same below).
17

---

Published as a conference paper at ICLR 2025,
Instruction Below a pertial description of CAD sequence where commend has been replaced with the string "ssketch-exinsion mask]": arc, 12,144,4,,1 scurve ends 50,14 ecurve and> 50,,50,46,31 56 <aurve end> lino, 1m,o,12,45 12,48 scurve end> <loop and> <face end> <sketch end> 3d1,33,55,31,31,,3 1,000,0
<ectrusion end> [sketch-eeinneeee mask] Generate a string thas could replace" estotch-estruiion mask]" 3 in the CA sequenoe:
Predictions
are 15,15,314
end> line 47.15 end> atc,4743 47,47,31,50 <sketch end> add 31,,,,,,,,,13,331
end> lin,
end> <loop, end> <face end>
(1
1,000,0001333,333 <axtrusion end>
arc,8.14,31,11 scurve ends
scurve
54,48,31,52
end> line. sruive, <loop
20,31 20,31,11,,,,,,,.0 ,1,220 22,022,31,31111 31,42 <nurve endo sloop end> <face ande ssketch und> add,31 (3,66,3,311,,,,,11 1.1.1.1...11111...11111
<axtrusion,
end> 31,7 suuve end> 52,.,52,18 souvve end 52n4, <curve end> 11,533155 scuvve end> 10,4, <curee end> doop end dane and> esketch end> out,22, 12,,1,,1,3,,,5,, 1,0.i,,,,,111,,,.,,, 1,22,11,31 cextrusion end>
10,e.10,19
ar; 15, 13,31,4 surve end> line,47,1 scurve end> an, 47,47..4 49,31, scurve end> line, 15,49 ecurve end> <loop endo <face end> cextussoo ends
(1)
<sketch end> 25,,25,,1,,,,,3, 1...1.00.0..0.000.00.0000010111.
arc, 10,19,31,7 <curve end> 52, 19 <cuvee end> anc anc 52,43,31,55 <puvve end> line 10,43 <ourve end> <loop end> endo doop, end> eface, end> <sketch und> add.31 31, 1...I........1.......0000 1,6,3,1
19,31,31,,9,433, 199,3,,1,,1,43 43,43 <extrusion_ end>
2,,01,,,,,0,,,,111333,3 <curve end> doop. end> clane end> circle 38,31,,4,, 20, <cuive end> <lnop ends d'ace end> <sketch, end> 10,0 1.000.000,3333313..0333331313133 1,3,,3,31 certrusion, end>
scuve, end> -oop end> <lace ends <sketch endl> cut 13, h0
<extrusion,
ar,,6, 1r.,6,1,,7133 souvve end> line, 12 <curve und> arc 25,23, 23 souvv end> line 25,29 -curve und> arc,36 29,36,27 <ouve end> <curve
line,38,25 snurve ar.51,
line.56, szurve am, am,,56,44,5544 <nuve
3rt.38.37,38. <curve end> 36n3.36,33 sourve end> are 25,33, 23,35 <zurve end> line, 23.37 <ouvve end> are, 11500, 20,7,A <ourve end>
6,44,6,44 szuree <loop <anee
21d,31,31,31,31,,33 1,000,111....0.0
1,0,0,0, 1,2,0,1,,,,,1,,,.. 22,31,331
<extruuion
Infilling & Text-bo-CAD Rendering
(
2
(4)
(6)
18
Masking
Controllable Generation
Instruction: Below pertial description CAD sequesice where one command has been replaced with the string"
[ssketch-extrusin eetrrseeeiiionn mask]":
[sketch- extrusion mask) 3,1331,,,,,,,,33, <curve end> <loop, ends <face end> <sketch, end>
31,5,,,,,,,,,,,,,,,,, 1,5,,, 1,0.1110011111111111111111111111 1,000,01111133333, <extrusion, end>
Generate string that could replace " extrusion mask]" in the CAD sequences Predictions
53,12 cruive sm,53,50,52,55 crurve ends 50,5, 50,53 ecuve. end> are, 12,53,10 53,10, 53,10,222 <cuvve, end> line, <curve end> doop end>
arc,9,1 9,,19,11,,0000 10,10 scuvve ends
ecurve arc,50,9,52, 9,52,10 scurve
14,,4 <ruvve ends
(9) <loop circle 14,,5.11, <cuvve end> cloop 48,15....12.50.1 12,50,14 <curve end> <inop ends circle 58,,5,,00,8,5511.11. (8,51,50,50,51 <ourve, end> <loop, end> dace ends <aketch end> 31, <extrusion, end>
(10 Line <cuvve end> 20.e <ouvve line. 42,9 doop end> <dane snd> sskeetch end> add 31,63,31,,11111333 010.1111111010101111111111.11111
ends 54.31
42,53 <euvve eud> line,20,55 end> <extrusion, end>
circle,9.31.33 9...9.111,,,,,.. 31,9.53.31.311 33,53 <ourve endo <loop mnd circie 22,31,1,,, 4,,,,,2, souvve end> <loop ands <fare end> <skestch end> add,31,63,31, 3,,,,,,,,,,,,,,,,,,3,, 31,31,,,,,,,1111113,,,,,,,,333,,
(1D)
0,00,, 1,0,0,0, 1,5831 <evtrusion end>
line.9,9 snurve ends line, 2.5, crurve ends 53,53 snurve, mnd> 53,9 sqarve ends dlopp mnd> <face end> <sketch end> 31,3,,,11,,1,,,,,, 1,000,0000000000000000000 1, 62,31,31 eectrusion end>
(12
30, 13 <ouve end> line 29,9
ends 23.933,950, <cuve ends 54.30 ecuvve end> arc 50,40 <cuvve end>
(139 line. 13,5, <curve end> ar. 29 12,49 couvve ends line 8,32 scuive end> doop ends 2,3,,,2,
4cuive end>
doop end> <lace end> sabetch eod> add 31,63,3,,, 63,31,31,311 1,,,,,1,,,,,,,,0111,, 1.000.1003.3.3333..33 cextrusion, end>
3,3,9.9,1111,,333311113 <extrusion, end-
end> <loop and> <face end> eskeetc end> add,31 62,311,31,3) 31,,1,1,11,000 1.000.....00.11.......1
(14)
are 9,1,9. scuve and> line, 15,9 sourve end> are 533,9 <purve end> 13, eourve end> are, mn,,53,,77,3,55 <ourve, end>> 47,53 line,9,0 9,47 scuvve end> dlop <lace ends esketch, end> 3,1,3,,,,,1,311.333 3,,,,,,1,11,,0000011 1,0.0.0.100.0000 1,000,0011,,,,333111111 1,36,31,31 eactrusion, end>
(15) <ourve 15,535,53.9.55 3,59
9,29,9,29 scurve und> 29, sturve endo line, sruvve end> 33,9 <nurve ends 1i,e,33,29 <qurve end> 53, scurve end> (6 line,53,33 scurve end> 33,33 <zurve and line.33 33 spurve end> 29,53 <ouvve end> line 29.33 ecurve end> 9,33 <zurve end> doop. end> eface, and> eskeetch end> add, 35,31,31,,31 1.0.0.1.0..00..33111.1. 1,31,11,3 oestrusion and>
Infilling & TText-to-CAD Rendering
(h)
(1C)
(11)
(12
(13)
(14)
(15)
(16)
Masking
Controllable Generation
Figure 11: Sketch-extrusion level generation. Given CAD model, users can mask any of its sketch- extrusions for modifications, The masked sketch-extrusioon are highlighted blue.
18

---

Published as a conference paper at ICLR 2025,
Instruction: Below partial deseription CAD sequeence where one command been replaced stringg [eectrusion mask]":
3,,99,9,,,111,,,.11113 souve end> <oop end> <lace, end> <sketch end> add. 31,3333111111111 31,,1,11,31,,00000 1,000000000000001101110000001001 0-10000111..........1.1 3,62,3333 <ectrusion, end> line 5.14 scurve end> 1n,8,7,144 <ourve line, 57,48 spurve end> bnn 1,0,5,46 souvve and> <loop, end> <tace <aketch end> [ectrusion mask]
Generate a stzing that could replace [extrusion mask]" in sequence: Predictions
10000000111331111111110000000000 000.0001111111111100000000011111 <extrusion, end>
00223311111551100000000000111110 cextrusion und>
wuB/6111111B01110000000000000111 eextrusion
(4)
cul, qul.1311111111100000010102.....3 eextrusion, end>
0M0.3317.3.111111000010000222233 <estrusion,
(A
0tt.1111310001110000000000222222 <extrusion and>
add, 0Bt1131144BBB1001111000001100000
and>
110.211.4..1113331110000000 1,000.111. eextrusion end>
Infilling & Text bo-CAD Rendering
(4
(E
Masking
Contzollable Generation
Tretructione Relow is portial description of CA soguence where one command has been replaced with the string" "[extruuionn mask]":
are 9,12,00011100 sourve end> line.12,9 scurve end> amc.00,9.3 52,10 scurve end>
<curve and> are 53,50,55, 20.52,55 ocurve end> 50,5.
snurvee end> are, are,ar,,,.... 12,53, 10,52 szuvee end> line,9.0 sourve end> <loop end> circle, 13,14,1 1,1,4,,,1,71. 63,1,,14,14 16 scurve ends <loop end> <lop end> snurve end> <loop and> <face and> ssketch end> add add,31, sourve end> <loop end> <face and> esketch end> (extrusion mask]
circle.13.48, 13.48.14,44 14,46, 16,48. 14,49 sourve
courve end> <lopp end> circle 46,48, eextrusion, end> 9.111..9..1111,.3333331333
Generate a string that could mpplace "I [entrusion mask]" in the CAD sequence:
Predictions
Cut 31, 0T1.231133..01111100000000000011
<extrusion,
(10 0U2233113.8.4110000000001221 <extrusion,
(LI)
00001113300411100000000000111111 suxtrusion
(12) 02222.11.22000011000000000000313 exttrssoon
18 adt3:1..8.003110000000001..32313 exxtrusion, end>
(1:) add adlJ:AA330041110000000022223333 <extrusion, and>
(15) 0000:/41100000111000000000011133 <urtrusion md>
(16
adf.33.4...338441111000100000011 <estrision end>
Infilling & Text-to-CAD Rendering
(
(10)
(11)
122
(K)
(1-)
(15)
(I6
Masking
Controllable Generation
Figure 12: Extrusion level generation. Given a CAD model, users can mask any of its extrusions for modifications. The masked extrusions are highlighted blue.
19

---

Published as a conference paper at ICLR 2025.
Irstrucioo:: Below a pertial description of CA sequence where one command has been replaond with the string "iskatch mask]":
[skotch 31...,.....11131...000000
and> <lopp end> <face end> 31.333....333333333 <estrusion and> circle.9.31.23 9.3.1e.931.31,,.333 3,,,9,53,31,311 31,31,533 cextrusion end> line, 10,19 <ruvve ande line,31, <turve ends 52, scurve, end> endo <loop und> <face sndo sssetch, end>
<sketch a0d,,,ddd,1,,,3333333 50,31,31 31,6,,
1,100.0001111,,,33
line, 52.43 end> lin5.31.55
end> line, 10.33
2u,,22,31,56, 0,,,,,,,,,,,444 31,,,,,,,,1,,,,0000, 1,1.0,1111,,,,,1111111 1,1,0,,,1113311111 1,,,11 erttrusion end>
Generate string that could replace "[sketch mask]" the sequence:
Predictions
8rc,,111, scurve end> 11,9 suuve end am,51, 5,,551, 33,9 saurve end> 53, <turve end> 53,5,3,,,,53,55 5,,553 sturve ends line,51,53 line,955 <cuvve ends doog (1) circle,11,55 11,00,1,,,,14444 1,,,12,,,,1,,00,111 12551 <ruvve end> doop end> 4Br 12,50, 1,,,,,2,,0 sturve, endo <lopp end> ssketch ends
<purve ar,,1,53,9.52
circle 11,12,12, 11,14, 12,12,,4 <curve, ends <loop, end>
circle 48,50,50, 56,51,50,00,11 <ouvve dlop. ends <aace
10.9
end> 31.7 <purve end> line.S2, souvv end> line, sourve end> 31,55 scurve end> 10,43 and>
<purve end> slop end> <face and>
arc,9,20,00, 10 <turve end> 20,9 sturve end> an, 42,9,222 10 scurve end> 53,2 scurve end 53,42,22,,2 sturve end> end>
line m2,422.5 scuvee
ar. 20,53,000
sourve end> 9.42 <rurve <lopp
unds
are 9,244,00221 <civve ends lin 13,20 scuve end> are 20,13,21,10 <tuve end> 24,9 <cuive end> 38.,3,,941.8 <cuvve end>
42.13 scuve end> are 29.49922000 20.52.21 sourve end> line. 33.24 ecuvve end> art 53.38.22, souve end> line 49, <curve end>
are 42.224 41,52 <curve ead> line.38 souve end> are 23,22,,,,22 <puvve ead> line 20, 20.49 <ouve end> are, 42,10,011 scuve endd> (,38,9.38 <curve and> <loop, end> <aace end> saketch end>
Infilling & Text Most-to-CAD Rendering
Masking
Controllable G Generation
replaced the string "skktcch mask]": lino.9. srurve end> 9,53 scuvve end> line, 53,53 scurve end> 13,9 <zurve end> <loop end eface end> <sketch und>
Instraction: Below a partial description CAD sequeace where command
add, 31,33,,,33.33 31,,,,1111, 1,000.00001000.00.000010 <curve end>> line,31,7 scuve end> line 52,19 quvve end> liae, 52,43 <ruvve end> lin5, 55 souvve, end> 10,42 scurve, end> <loop end> <iace end> <aketch, end 21,56,,1,6,,33... 1,.00. 1,000,1,,,,,22 <actrusion end> Generate a string that could replace (sketch mask]" in the CAD sequence: Predictione
<ertrusion end> [sketch mask] add.31,50,31. 50,31.31 23,11,1,,.110. 1.0.0.00..00000000000 12,31, eextrusion, ead> line
are 11,16, 13.12 stuvve ead> 16,e,16,1 16 <ouvve end> are 46,11, 11.11.00 49,19 <ruvve ends line,51, 16 <zuvve ends 5r,,51,46, <ruvve end> ecuvee end> ddop ead> 12,15, 14.13 end> 16.12 <ourve, end> ar 46, 12 48,13 scuive ends line 50, scavve eads ar,,50, ar,,50,47488, 48,,49 scuvve end> line, 46,50 <ruive, end>> 16,50,4,,,40 end> doop
Line, 46,51
end 16,31.13,30
end>
line, 12.47
<aae end> <sketch ead>
ar; 20,10 14,31, souvve end> 42, scurve and> are 42,48.31, 31,60 scurve end> line 20,48 scurve end> <loop end> <lace end>
(
<sketch ends
19 scuvee und> ima,1/ 31,7 souree end> inneb 19 ecuvve eng> t2, eourve end> 31,00 scurve end> imme 1043 doop ends line 11.19 couvve end> line 31,8 scuve end> line.51,
end> 51,44 ecuvve end> line 31,54
<purve end> line, 11.43 sourve endo dloop ands <fane endo eskeetc end>
are, 10,3,,00, <ouvv end> 13,311 scuvve end> arc,37, 13,529 <ouvve end> arc 45,33146,333 26,33 scuvve end> arc, 15,35,52,53
<curve, end> amt,3,, 37,49,37,15.. 19,31,52 scurve, ends 29, <cuvve, end> are, 17,35,16,33 <ouvve end> doop. ends <lace ends <sketch end>>
Infilling & Text-tt-CAD Rendering
(8)
Masking
Controllable Generation
sequence where command replaced string "[sketch mask]": lino.9,9 szurve, end> line, 9,53 souvv end> 53,53 ecurve end> 53,9 szurve end> <loop und> <face end> esketch und> <lopp
Tradruction:
partial description
4extnusion circler, 9,31, 1,,,3,331,,, certrusion and> [sketch mask) 2ut.22,31,56,311 1.000.11.00111111111100.00 1,31,2 sextrsson end> Generate a string that could replace [skntch mask]" CAD sequence:
313,3,,,,,,,,1,,,,133 1,
add,33,50,331311 3,,00, 1,000,00 1,000,000..0000.....00.10
Predictions
(
arc,3,45,31,1 <cuve end> Line. 55 ends ead> <lace, ends <aketch,
(10)
1,ne.9,9
and> 53,9
end> 53.53 und> line9,53 ends <loop and> <fare end> <sketch ends 50,,50,51,1,,11
arc a.,.8.5131,.1 scuvv end> line
end> 12,51 <ouve end> <loop, <lace end>
(11)
<sketch end>
21,1,31, <ourve end> line 41,11 couvv end> arc. n1..4111,,1,66 31,61 <ourve end> 21,51 end> doop end> <lace ends
(12)
<sketch end>
Infilling & Text- to CD-CAD Rendering
R
a00
(LD
(12)
Masking
Controllable Generation
Figure 13: Sketch level generation. Given a CAD model, users can mask any of its sketches for modifications. The masked sketches are highlighted in blue.
20

---

Published as a conference paper at ICLR 2025,
Instrctioon Below as pertial descrigtinn CAD sequencc where one commend been replaced with the string "[aae mask] [face mask]":
11,.11,7 <cuive, end> 11,,,51,7 <purve end> Line.51, 51,55 <cuve end> line, 11,55 scuvve end> <lop. end> <tace end> <aketch end> add,31,35,31,31.3 1,101,100000010,...101111 <ectrusion, end>
eectrusion, end> [face mask] [lace mask) <sketch ends
Generate a stzing that could replace "[aace mask] (face mask]" CAD sequence:
Prediction
line.0.26 mnd line, 16.26 end> 1636, end> 0.36,0.36 und> <loop, end> <face end> 4ine,46.66 end> Line, 62,26 <cuvve end> line, 62,36 scurve and> line, 46,36 <ourve end> doop end> <face end
62,31,56,,77 scurve end> <lopp <face and> line.17, 17,3 <zurve 45,3 <navve line 45,17 <ruvve 20,5l,23,,,,2000 23,57,29,51,,8, 31,,,,,,,,4,,,22,,, snurve, end> doop. end> darc and>
circle. airdle,0311,.222 0.31,,.25,12.31.6,,3 12,31,6,77 scurve, end> <loop end> <face end> circle,50,311 3,,5,,,,,,, 26,26,2,
iin2l.22.5.29003345..2.
und> end> <face, end> circle,
17,17 <zurve <loop endo <foce lime, snurve and> line,45,45 scurve, end> 45,5, snurve, end> 1,,5 scurve, end> <loop. end> <face ends
Infilling & Text tort-to--o CAD Rendering
Masking
Controllable Generation
where command replaced the "face mask]": line, li,c,11,7 courve end> 11,e,5,77 <cuive endo line,51,55 <rurve end> line, 11,55 sourve, end> <loop ends dace ends <sketch end> end> 17n1.17.11 ecurve end> line. 17.51 und> line,7,51
Instruction: Below partial description CAD
3dd,31,35,31, 31,,1,,,,,1,,,00 1.000.....0011..2,,...
cectrusion and> line,711 <curve ends doop, end> <face end> (aace mask] eskeich end> 411,,1,, 16,35,,,,,,,,,,000,,,, 1,0,0,0,,1 1,9,0,333 4extrusion, ends Generate string that could replace [face mask]" in CAD sequince:
Predictions
circle,35,31 15,,,,,,,,,,,,,,,5513 55,31 45,41 <zurve dlopp end> 1,3
starve <lopp
(6)
22,1,,,221,,,1,22,60,,, <zurve, end> <loop, end> <lace, end>
u,,,66,,31,3 <cuvve end> Line, 36,9 end> arc.36,53,31.33 end> line 26.53 ecuvve ends doop, end> end>
115,5,, <corve line,45,51 scurve <loog
Infilling & Text-to-CAA Rendering
Masking
Controllable Generation
Instruction: Below a partial descriptin of CAD sequeace where one command has been replaced with the string "[aace mask]":
11, and lin end> 51,5551,55 scurve and> line. 11,55
end> <loop end> <face end> <sketch end> <ectrusion end> (fäce mask] line 13 <curve and> line, 53.13 <purve end> 55n5,55,51 <ouvve end>
31,3,,,,,1,1111,,,,,,,,,,,
43,5) and> <loop end> <face <sketch end> add,31 41,10, 16,35, 1.0.0.1......... 1,0.0,0 1,9,0,333 sextrusion und>
Generate a string that could replace [face mask]" in the CAD sequence:
Predictions
( line.7.11 <curve and> line 16.11 sourve end> 16,27 scurve end> 1.27, <zurve und> <loop, end> <face end>
(10
line.7.11 end> 35,,,35,1
ends 3ine,35,51 <curve end> line,7,51 end> dlopp, end> daace end>
(11)
cirole, 1,31, 11,41 scurve cloop end> <face
ar. 13,7.15,5 <ourve, end> 17,7 <curve, and t1,3,7,,31 <aurve, end> are 15,55, scurve, end> 11n5, sourve, end> <loop end> <icce end>
(12
Infilling & Text-to teDtt Rendering
V
(10
(I)
(12
Masking
Controllable Generation
Figure 14: Face level generation. Given a sketch, users can mask one or multiple faces within it for modifications. The masked faces highlighted in blue.
21

---

Published as conference paper at ICLR 2025,
Instruction: slow partial deseription CAD sequence where command has been replaced with the string "Doop mask] Doop mask]": cextrusion, endo
dlop mask] Dloo mask] <lace end> ssketch end> add (1,,3,,,, (1,53,,5,,31110 11101.1111,,111,,000010110111110 Generate string that could replace "loop mask] (loop mask]" " in the CAD sequence:
Preelictione
lice, 7,31 scuve end>
end> scurve end> line, ecurve and> <oopp end> line. 10,31 ecurve end> 10,1,20.13 20.13 scurve, and> line 12,13 <curve, end> Line,52,31 sourve end> 42,49 end 20,49 ccurve eads <lopp end>
end> line 10.1
eads line.55,
(1)
art 12,99,9,,9 scurve end> 17,1,17.12 scurve, end> 45,12,3, <curve, end> 50, ecurve, end> a0,50, 45,55333 <curve end>
45,50 scurve are, 17,50,9,53 scuvve end> 12,45 ezurve und> <loop art, 1,,24, anurve line, 18,22 <curve art 25,2,4,,,55233 sturve end> line 45,24 <ruive end> 45,38,,55,,5 <ruvve ende line, 44,40 <ourve, end> are, 10,40,17, sturve ends
line.17. 17,30 <puvve end> <loop und>
9,3cle9,31,, 3,,31,,,,,,,3, 51,,,,3,,,,,1,,,1,, <ourve doop end> line, 15,30 <curve end>
sourve end> line.39,11 souvve end> 47,30
szurve und> line, 1n,,,9944 scurve end> 23.4. scurve end> <loop and>
9,3,,e,9,1,311, 3,,,,,,,,,,,,,,,,1,,,,,, 3,,,,,3,31,,1,,3 31,53 <curve doop. end> line,19,25 19,25 <cuvve, end> 24, <zurve ends line.38, 38, <cuvv ends 43,25 end> line, 43,37 <curve end> line,38,45 <cuive end> 24,e,24,55 <cuive, end> line, 19,37 end> <loop end>
(4)
Infilling & Text-bo- Rendering
Masking
Controllable Generation
Instruction: Below is partial description of CAD sequence where one command has been replaced with the string "[loop mask]": end> <loop, end> <aac ends <sketch, end> add, 31,3,,,,,,1,,,,,0000
dloop mask] circle, 15,31,31, 15,7,,,3, sextrusion, ends
Gemerate striag that could replace "lloop mask]"
sequeace:
Prediction tiones
(5)
are 8,30,31,11 scurve end> 14.e,54.30 scuvee ecurve and> line, 52,18 eado line. <ourve end> line, <curve ends line, <purve and> <coup end> end> line. 21,9 ecuvve mdd <cuvve end> arc poc,21,53,9,,5 souvve end> lime9,41 <cuive end> doop_ end>
<curve und> 11ne,11,55 spurve end> line,8,52 <ourve end> <loop. end>
lice, 10.18
end>
(6)
2,,,9,219,99
sruvee ends line <ourve ends are 53,41,, courve ends line, 41,53
o...9.16,15155 end> 16,1169931.10 scurve end> am, 47,15
end> 13,13,,6,52.3
end> amo.3,46,44.47
ecuvve end> arc. 16,53,31,52 souvve end> arc, arc,16,53,. 16,53,15,47 <ouve end> ar. 9646 10,31 <ouve, endo doop and>
Infilling & Text-bo CAD Rendering
Masking
Controllable Generation
Irstructione Relow partial description CAD sequence where one command has been replaord with the string "[Ioop mask]":
8,10 end> line 54,10 und> line, 54.5,44.2
end> line, 8,52 end> <loop endo (loop mask] <face, end> <sketch end>
2dd,31,53,31.3 33,3333,11,,,,,, 1,,,,,,1..,0000 11111.0..0111.00..... 1.0.0.0.1,58,,.,,, 4uxtrusion end>
Generate string that could replace 'looop mask]" the CAD sequence:
Preelictione
(5)
line.18 18 <ouvve end> 18, ecuvve end> 1i.e.44.44 <ourve, end> dd. 44.18 <ourve end> <loop end>
end> line. 27,22 ecuvve end> are 15,31113 <nuvve end> 15ne,35, end> line,35,22 (10) <curve. end> arc, 24,22,26223 <cuvve end> line <cuive, ends arc, 47,36,66,9 ecuvve end> line 44,40 <cuive ends line.35, end> 27,
arc,15,26, 26,26,166 16,23 <curve end> line, 18,22
end> arr,35,47,31,66 39,499 <cuive. end> doop. ends
end> 2ine,27,47
end> 1,,00,,,,,6.33
end> 15,3,
art, 1r,,3,15 15,11 scurve and> 1i,9,17,2 17,12 <curve end> arc, 1,,17,18,200 snurve and> line 21,21 <curve end> are 41,21,1,,,44 21,24,2 spurve end> <nurve Iine,45,50 are ar,45,,4 arc,45,45,44, 45,44,4 scurve and> line44,44 41, snurve end> arc 21, snurve and> line, 17,45 spuvee end> are, 17. 1,550,5,51 scurve end>
(I))
45,17 <carve 45, 17,4711 <nuive
<zuvve
<loop mnd>
122 are, 24,124,888 18.3 31,13 scurve end> line,38 38.10 <curve cod> ar0.38 44.31.49 cruvee end> line 24 souve end> doop and>
Infilling & text-b-CAA Rendering
(
(10)
(11)
(12)
Masking
Controllable Generation
Figure 15: Loop level generation. Given a face, users can mask one or multiple loops within it for modifications. The masked loops are highlighted in blue.
22

---

Published as conference paper at ICLR 2025,
Instruction Below a partial description of CAD sequence where one command has been replaced with the string "Jere mask] [Line mask] [arc
mask] [line mask]";
18,2 acurve end> line, 44,2 <turve ends Line, <cuvve end> line, 18,60 ezuive end> <loop, end> [are mask] [line mask] (erc mask] [line mask] 4oop endo <aace end- <aketch end> add.31, 1,,1,,1,,,,,,,00000 1.0.0.00..110111..10.000. 4..10,88,311, eextrusion, ead>
Generste a stzing that could replace 'aa mask) [line mask) (arc mask] [line mask)" in the CAD sequence:
Predictions
29,123,
end> line,33
end> 31,,3,,5,31,511
end> 29,45
end>
28, 10,31,8 sturve end> line,34,11 34,10 10 scurve end> am, 34,534,52,31555 <curve end> 26,52 scurve end>
art 15,31,15 end> line,38, 18 <curve end> 31,,3,,4,31147
endo line, <rurve end>
arc, 25,31, scurve end> lino.36, 36, <curve end> arc, 46,,36,,,33,,5 <curve end> 26no, 26,47 <curve end>
Infilling & Text- CDD Rendering
2 arts lines
Masking
Controllable Generation
Tredruction: Relow pertial description CAD sequence where command has been replaced with the mask] [line mask] [are mask] [line mask] (are mask] (line mask] [art mask] [line maskl':
end> line, 18,60 ends <loop end> mask] [line mask] (arc mask] (line mask] (are mask] (line mask] [arc mask] [line mask] <loop end> <face end> eaketch, and> 34, 31, 3,100,,,,,0 1,0-0,,,,,,,88,,,000 <evtrusion end>
Fine. 18,2 end> line, 44,2 <curve end> line 44,60
Generate a string that could replace "[ar mask] [line mask] [are mask] [line mask) fare mask] [line mask] [are mask] [Dine mask]' the CAD
sequencn::
Predictions
arc 28, 13,25, 11 sturve end> 28,8 <curve, end> arc,34, 3rr,34,8,37, 11 souve end> line,34,13 sourve, und> amc,34,49, 44,,3,,1 <ourve end> end> line.28,
line, 34,54 scurve end> 28,5,5555,
end>
am,36, 19,39,31 <nuvve line,36,43 snuvee a6,,36,50066.5 <curve 33,5, scuive, end> arc 29,55,,,99,5,22 29,55,26655 <ouvve end> line,26,50 scuvve, end>
27, 27,33,33311 scarve
17,1,27,19
arc 21.8.....2 sourve end> line 24,5 sourve end are ar..38.5 5,4066 <purve end> line 41,8 sourve end> 41,47,40 <ourve end> line. 18.53 szurve
<curve ar..24.53,2,,5
line 21,47 <puree end>
ar: 26,226111.,.. scurve endo 26,6.26, scurve arc36 6,39. ezurve 36n1,36.11 <zurve end> are, 26,,36,2,,00.2 26,30,28 <zurve und> 16.31 23,28 2,,2,,,,, snurve end> 26,26 szurve, ends
88
<zurvee end amt, 26,31
Infilling & Text-to-CAl CD Rendering
4 arcs lines
Masking
Controllable Generation
Instruction: Below partial destription CAD sequence where one command has been replaced with the string" [[ine mask] [line mask] [line mask] [line mask]":
ecurve <loop end> mask] [line mask] [liee mask] [line mask) <loop, end> <lace end> <aketch end> add.31,34.33 34,31,31,33 1,0001000000000000 1,0,0 1,0,8,31.33 esstrusion, end>
line, 18,2 scurve and> 44.2 <cuvve line <cuvee end>
Generate a string that could replace "line mask] [line mask] [line mask] |line mask] in CAD sequence:
Predictions
23,7 snuvee and> line,99,7 <ourve, end> 39,5, ccurve end> 23,55 <nurve end>
(10 26,e,26,20 20 ecuvv, end> line 36,20 scuive, end> line,36,42 96,42 <ruve, end> line,26,42 <curve ends
24,7 scurve 38, suarve line.38.31 scurve end> 24,3.24.31 <zurve
(22 line, 19.3 scurve und> line, 43,3 sourve end> 43,59 scurve end> line, 19,59 szurve und>
Infilling & Text- to CAD Rendering
4 lines
1
(LD
Masking
Controllable Generation
Figure 16: Curve level generation. Given loop, mask all curves within it and specify the curve type and number of newly generated loops. The masked curves are highlighted in blue.
23

---

Published as a conference paper at ICLR 2025,
Instruction: Belowis a CAD sequine
Predictins
a,29,26,,4 14,14 sturve andb-an; <tuvve 3194 <tuve 33,,5,1 <auve and-orr55:068844
"curve end and <cuvve an
a 11.31 doop add>
dirce, 25,0,,222,2 sauve endp-doop anbddrde 11377,,, 22,33,22,22222202 2237,, 16,42 <tuve end> <oxp and>
18,2,18,,,2221..22 16,231
and> doop axld 18 3,,,,, <cuve end>doop endxd 4, 21,55,25,0
end 4oop and 16,39 <uuve ent> doop exi>
4624,51
36
drdle.11
4eop and> 3tce::0,.77.663315533333.8 <uive end>doop and <face axt seatch end 31, 111.
end>
line5,113 <turv and-line 13 surve anb-inn 59 sture end
end lime <uvee end doop amdb
<curve endo <oop and fae and sketch
3.3333111.. exxmusion ando
drdle9331 9,33,313311 011,31,53333333111 stuve drop cnb- 10000110011111.1111.1 extrusion and> ar; 13,422,11 stave
sarve ent>stog end>-fare end sletch an
33,3,1,43,31,1,,,
13,20 surve endran:21 25,25, suave and 29,1,31,, stave axb surve 11ne41,21 stuve (t sarve end- 4942 stuve and-ar 41,7,, stuvve 3, surve and-
(3
ar: 29/19 11,41,25,,50 eavve 1id-lme21.41 suve and doop and 31dde55..11.27,..... 10,3,,33 10.35 <urve endp-loop and-
1..1,, 57,3, sarve end--lopp and fao and <dottch addd
=extusion and
9, end 169
enblline 16
emd-line 13 scurve end> line
end-line5339 ends
line 16 <avve andling 2, <uuve end 19 -uuve line 46 <arve axb-line53.55 53,53 <cuve and 46
end>line.953 sauve end> 9 <tuve end> 13,46 <uuve andlline 13,16 surve end>ling 9,16 suve and doop end dixe end sketch a02- ands
end 46,4
end line, 1649 surve anbliine 1653
1,033148114
ar,7,28,,1111 end 55,28 euve andann.11,5 51,,1,1,44 <uve end-line 11,51 sume ent> doop ad-
55
2ucle,6,28,11.1 22,3,,2,,,,,2,,22 31,2,,33, suuve and doop and daoe anb sketch end> adddddd.3 37 100000001100001111111 1,0503111
<extrusion ext>
line99
exd-iie5333 cuve exbline.99: <uvve end>-doop ende-facee slatch exts 1,31,,,,,,, 1,0001 1,000 6,,33,311 sestnsionn enbling 11,7 scave entiinng 11,55 sture end-inng,),5 surve endb-ine,51,7 fap and slatch and-ad, 37,
(6
<cuve ando d0op
42,31,31 <mumusio end-
20930, <cuve and 42,9 curve end 42,
<uuve end and-ling 40.14 <uuve 35,35, cuve end>
line.35,17 17 <uuve an 35,2,44 34,23 suee and lim.,333...44 3524 stave end 35 stuve 56, strve 277
<cuvve end 27 curve and an 23 <uuve end-line 27.2 surve aub-a:27.1127..6 <auve and-lime2 1420, <uvve end 20ne
(7)
<cuve end
end doop end arde w.w.88866333...888 <cuve end- ent-
2rdee29,52.311, 31,30,0000,00 30,330 3,,55 cuvee end doop and fao and skatch end 31,2 m0
<xttusion end-
drde9331,33 31,33333333311111333333333333333 3, surve anb-doop end daee and sheth 31. 31, 110.00011100010000020000
(8) <dduuiio end-lin <uvv and line 25 cuvv end 50.2 suvve exd-line $132 <ouve axb>line <ourve end>
line 12,50 <uvve ent doop axt> dase ext sketch ent-adl 31, 10000100000000000000000001110010 1,037,113311 <ednusoon end-
1
exbliine
axbliiee 42 <uve ends line suve exd 60,2 <urve axb-line
end>
(9) <lop end 911 1,,,,, 15,2512,2111,, 15,37 sueve enb drpp end=-ircee 47,25 scuve ent>-dopp emb-sfoo mnd <satch axd>ad,,3 31,46,,,1111 31,00111100011000 10107,7,3111111 4adruson end>
a,,0,31 3,,2 surve end 6,3 surve and 28 suive 62, <urve edb 62, surve exbline; <tuvve end doop ends :aae end saacch end add 31,13,,11, 10001000000001000000000111101101 1,20 14,34 exnusion end
(10)
line,4,4 14 end-line, 5R 14
58,
end 4,48 end end> line, 19,21
end--ine,,2221
(11) <tuvve end end-line 22,26 surve end ling 19,25 carve dotp andllin scuve and line 25,36 suuve end lnb end line 21
4oop end 43,33 28,5,,33331 33,11,11,,3 a33,,31,43,3,,3,,,,, 31,00111110001.11101 1,000,00011100000000111000010100 1,00,,001000110...010. 1,26144,2 <attusion, and>
and doop and daoe and slatch and-
line7,11 <uvve enb-line <uvve exb-line,5111 <nive end> 55 cuve aab-lline,6.77 <uvve and 36,3
(12) <turve end> ont>line,55.3 snive enb line, 4urv m15 <aive ente 7,55 <cive ents 7,35 stuve ends l1,,, endlling 7,27 endp-doop end dire end esatth and 453.11111......1.....00000
und-lina211.2 1,0,28 14,45 4edrusion enb
Text to CAD Rendeing
(4)
@
(9)
(10)
(11)
(12)
Figure 17: Unconditional CAD generation. Here, users can generate CAD models without any conditional limitations.
24


Reviews:
[{"review_id": "tM8FQEhwsn", "reviewer": "Reviewer_zSTF", "summary": "This paper proposed, flexCAD, a unified and versatile model for controllable CAD generation across all hierarchies using LLMs. FlexCAD addresses various limitations in existing CAD generation models. Previous models typically lack comprehensive control across CAD hierarchies and require separate models for different tasks. The proposed model leverages a structured text representation of CAD models and a hierarchy-aware masking strategy to control the generation across various levels (e.g., sketch, face, loop, extrusion). Experiments show that FlexCAD outperforms existing models on various metrics. \n\nContributions: \n- FlexCAD is the first to leverage LLMs for controllable CAD generation. \n- FlexCAD greatly improves generation quality and controllability, showing its effectiveness on the sketch-level and extrusion-level controllable generation tasks.", "questions": "- Can the authors provide some analysis on why full model fine-tuning performs worse than LoRA on some metrics? \n- For FlexCAD, does it use few-shot or zero-shot at inference time?", "limitations": "", "rating": 3, "confidence": 2, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "- FlexCAD improves generation quality and controllability in some metrics and demonstrates its effectiveness on the sketch-level and extrusion-level controllable generation tasks.", "weaknesses": "- Novelty is limited. The training methods being used are very standard tuning methods for LLM. \n- FlexCAD is the first to leverage LLMs for controllable CAD generation (based on the author's statement). Previous baseline \"SkexGen: Autoregressive Generation of CAD Construction Sequences with Disentangled Codebooks\" and \"Hierarchical Neural Coding for Controllable CAD Model Generation (ICML 2023)\" already use transformer architecture. \n- It would be stronger if FlexCAD can show improvement with larger margin given FlexCAD is not the best among all metrics. \n- No discussion on ethics and potential risk of this research.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "RYKHCfASLQ", "reviewer": "Reviewer_DaWS", "summary": "This paper proposes a unified CAD generation model that leverages large language models with a hierarchy-aware masking strategy, achieving fine-grained controllability across multiple CAD construction hierarchies and outperforming existing methods in generation quality and user-intent alignment. \nIn detail, FlexCAD represents CAD models as structured text, transforming CAD construction hierarchies into sequences of text tokens, which improves comprehension by LLMs. During training, the hierarchy-aware masking replaces specific fields in CAD text with a mask token, enabling the model to predict missing parts based on user intent.\nThe model demonstrates significant performance improvements over existing methods like SkexGen and Hnc-CAD.", "questions": "1. During training, what is the average mask ratio per training sample, and is there any observed relationship between performance and the mask ratio?\n2. Given that a single masked input can produce multiple possible outputs, as shown in Figure 5, which output is selected for the final evaluation?", "limitations": "", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 2, "strengths": "1. The proposed FlexCAD model effectively enables controllable CAD generation across all hierarchies, addressing a significant gap in CAD modeling by unifying control within a single framework. It achieves superior performance on the DeepCAD dataset compared to existing baselines, highlighting the method's robustness and effectiveness.\n2. The paper is well-organized and clearly written, making the methodology and contributions easy to understand and follow.\n3. The authors provide extensive ablation studies to analyze the impact of LLM pre-training and hierarchy-aware tokenization. These experiments demonstrate that fine-tuning pre-trained LLMs with LoRA yields the best results, underscoring the advantages of leveraging pre-trained models for CAD representation—a promising insight for future research in CAD and design automation.", "weaknesses": "1. The evaluation is limited to the DeepCAD dataset, which restricts the generalizability of the results. Testing FlexCAD on additional CAD datasets would better demonstrate its robustness and adaptability across diverse design scenarios.\n2. The paper lacks references to relevant recent work, such as “OpenECAD: An Efficient Visual Language Model for Editable 3D-CAD Design” and “CadVLM: Bridging Language and Vision in the Generation of Parametric CAD Sketches,” which address related challenges in CAD generation and infilling. Including these would strengthen the context and positioning of the work.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "NIxb7GIv0S", "reviewer": "Reviewer_4Ahh", "summary": "This paper presents FlexCAD, a unified model for controllable CAD generation, enhancing the ability to generate CAD models based on user intent. Unlike existing methods requiring separate models for different controls, FlexCAD enables controllable generation across multiple CAD construction hierarchies (e.g., sketch, extrusion, face). The authors fine-tune large language models (LLMs) and represent CAD models as structured text, abstracting each hierarchy into a sequence of text tokens for better comprehension. A hierarchy-aware masking strategy is introduced, masking specific fields during training to predict the masked parts based on user input during inference. In general, this paper is well organized.", "questions": "- Does the proposed method inherit some advantages of LLMs, such as instruction following and in-context learning? \n\n- The proposed method assumes users skilled at the defined hierarchies so that they can transform their intent into mask-based instructions during inference. Can users express their intent using natural language and then the transformation task is given to LLMs?\n\n- Does the fine-tuned model strictly follow the grammar of CAD structured text? If not, is there any failure case which may not be parsed into a valid CAD model? How about the percentage? \n\n- Compared with prior work, is there any drawback to using LLMs? How about the efficiency?", "limitations": "", "rating": 6, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "+ Novel use of LLMs for CAD design\n+ The authors propose a unified framework based on fine-tuning LLMs to bridge LLMs and CAD models, including dividing CAD models into multiple hierarchies and representing CAD models with sequential tokens and \n+ The authors introduce a hierarchy-aware masking strategy to achieve controllable generation based on the mask-and-prediction method\n+ Experimental results show the proposed method achieves good results and verify the effectiveness of each component", "weaknesses": "- The motivation of using LLMs for CAD generation is not very clear. The authors are recommended to clarify why LLMs are the good choice to do this task. \n\n- The ablation study in Tab 3 is clear to make a comparison among different foundation models, pre-training, and fine-tuning. However, could LLaMA-3 do CAD generation in a zero-shot manner? How helpful is the proposed fine-tuning method compared with the zero-shot setting?\n\n- The evaluation for prompt-result alignment is unclear, e.g., intent understanding and instruction following. \n\n- Some experimental details may be missing, e.g., the instructions used to prompt GPT-4o to generate CAD models.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "", "claims_and_evidence": "", "methods_and_evaluation_criteria": "", "theoretical_claims": "", "experimental_designs_or_analyses": "", "relation_to_broader_scientific_literature": "", "essential_references_not_discussed": "", "other_strengths_and_weaknesses": "", "other_comments_or_suggestions": "", "questions_for_authors": "", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Decision: Accept (Poster)