SketchDNN: Joint Continuous-Discrete Diffusion for CAD Sketch Generation
Authors: Sathvik Reddy Chereddy
John Femiani
Venue: ICML 2025 poster (2025)
Keywords: Diffusion
Discrete Diffusion
CAD
CAD Sketch
Generative
AI
ML
Gaussian-Softmax
Primary area: deep_learning->generative_models_and_autoencoders
TL;DR: We present SketchDNN, a generative model for CAD sketches and introduce Gaussian-Softmax diffusion.

Abstract: We present SketchDNN, a generative model for synthesizing CAD sketches that jointly models both continuous parameters and discrete class labels through a unified continuous-discrete diffusion process. Our core innovation is Gaussian-Softmax diffusion, where logits perturbed with Gaussian noise are projected onto the probability simplex via a softmax transformation, facilitating blended class labels for discrete variables. This formulation addresses 2 key challenges, namely, the heterogeneity of primitive parameterizations and the permutation invariance of primitives in CAD sketches. Our approach significantly improves generation quality, reducing Fréchet Inception Distance (FID) from 16.04 to 7.80 and negative log-likelihood (NLL) from 84.8 to 81.33, establishing a new state-of-the-art in CAD sketch generation on the SketchGraphs dataset.

SketchDNN: Joint Continuous-Diserete Diffusion for CAD Sketch Generation
Sathvik Chereddy
John Femiani
Figure 1. CAD sketches generated by diffusion model, showcasing its ability produce diverse, high-fidelity designs. Geometric primitives-suce as circles, arcs, lines, and points-aue are randomly colored to differentiate separate primitives, and primitives tagged as construction aids represented with dashed lines.
Abstract
simplex via softmax transformation, facilitating blended class labels for discrete variables. This formulation addresses key challenges, namely, the heterogeneity of primitive parameterizations and the permutation invariance of primitives in CAD sketches. Our approach significantly im- proves generation quality, reducing Fréchet In- ception Distance (FID) from 16.04 to 7.80 and negative log- likeeiiodoood (NLL) from 84.8 to 81.33, establishing a new state-of-the-art CAD sketch generation on the SketchGraphs dataset.
We present SketchDNN, a generative model for synthesizing CAD sketches that jointly models both continuous parameters and discrete class la- bels through unified continuous-discrete diffu- sion process. Our core innovation is Gaussian- Softmax diffusion, where logits perturbed with Gaussian noise are projected onto the probability
'Department of Computer Science, Miami-Oxford Uni- versity, Oxford OH, USA. Correspondence Sathvik Chereddy (M.S.) httpwaaw@oulloo..coo John Femiani <femianjo@ miamioh.edu>.
1. Introduction
Proceedings of the 4nnd International Conference Machine Learning. Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
Computer-aides design (CAD) modeling is a cornerstone of modern engineering that is heavily reliant on human inge-

---

SketchDNN: Joint Continuous-Diserde Diffusion for CAD Sketch Generation
nuity. The typical workflow in CAD modeling starts with designing 2D planar sketches comprised of primitives (e.g-. lines, ares) that define geometry and constraints (e.g., co- incidence, orthogonality) that define relationships between primitives. Such diagrams are then expanded into 3D vol- umes using operations such as extrusion and revolution. Over the course of the CAD modeling process, these 3D vol- umes are iteratively aggregated form the final 3D model. As result, sketch construction takes substantial portion of user's time and effort in CAD design.
diffusion model for parametric CAD sketches.
2. We introduce a CGaussaa-Softmne based diffusion paradigm for modeling discrete variables.
3. We advance the state of the art in CAD sketch gener- ation. Our model reduces the Fréchet Inception Dis- tance (FID) from 16.04 to 7.80 and the Negative Log- Likelihood (NLL) from 84.8 to 81.33 on the Sketch- Graphs dataset, demonstrating significant improve- ments in both fidelity and diversity.
A number of researchers have identified CAD diagrams as an ideal domain for generative models (Seff et al., 2020; Ganin et al., 2021; Para et al., 2024; Willis et al., 2021; Wu et al., 2021; Seff et al., 2022). Primitive generation is of particular interest, as constraints do not define geometry but instead serve editing aids for users. Analogous to image generative models such as Stable Diffusion, CAD generative models can streamline design and improve user productivity (Seff et al., 2020). By automating low-level CAD drawing construction, these models could allow designers to focus more on higher-level design tasks (Ganin et al., 2021). Fur- thermore, they could facilitate novel workflows (Para al., 2024), such simultaneously exploring multiple sketch variations to meet design requirements.
2. CAD Sketches
A CAD sketch is naturally represented as graph 9 (V, E), where the set of nodes V {ei} corresponds to geometric primitives, and the set of edges E = {ei } en- codes constraints between them. While constraints play a crucial role in defining design intent, they introduce addi- tional dependencies that significantly complicate generative modeling. In this work, we focus on synthesizing the geo- metric primitives alone, deferring constraints future work. Some primitíves may be designated as construction aids; such primitives are not directly rendered in the final 3D CAD model but assist in specifying more complex design requirements (dashed lines in Fig. 1).
However, generating CAD sketches is difficult due to two fundamental challenges. The first challenge arises from the heterogencity of sketch primitives, as each primitive type defined by its own distinct parameterization. The second challenge lies in the permutation invariance of primitives, where any ordering of primitives encodes the same geometry. This poses particular challenge for autoregressive models, the dominant generation paradigm in this domain, as they generate primitives sequentially. While prior approaches have made significant progress, they do not adequately ad- dress these challenges, which we believe limits the diversity and quality of their generated sketches. Diffusion mod- els, which have demonstrated remarkable success in image generation, are promising avenue for addressing these challenges.
Each primitive e E V is characterized by three attributes: (I) a boolean b indicating whether it is a construction C specifying its type where
aid, (2) class label C {LINE, CIRCLE, ARC, POINT), and (3) set of pa- rameters E R&,, where de depends on the primitive class. The parameters used to define each primitive type is as follows:
CIRCLE: (I,
(center coords, radius) (start/end coords)
LINE (21, U2)
ARC:
(II, V2,
(start/end coords, radius)
POINT: (x,
(xy-coordinates)
We note that x is the curvature or signed radius, negating the curvature will reflect the ARC across the line defined by its starting and ending terminal points.
In this work, we introduce a novel generative diffusion model for unconditional primitive generation and propose a discrete diffusion strategy built on the Gaussian-Softmax distribution. Our method addresses both challenges in CAD sketch generation by employing superposition, wherein each primitive is represented as a probabilistic mixture of all primitive types, and cermutationnivaaiii denoising, where the denoising of each primitive is independent of its ordering. Our approach improves the statc-of-the-a (SOA) in terms of both generation quality and diversity.
We resolve the heterogeneity of primitive parameterizations by modeling each primitive as composite structure that en- codes all possible primitive types. Specifically, we represent each primitive as:
(b. c, PLINE: PEIRCLE PARC, PrOINT)
where b is one-hot encoding of the construction aid flag, e E {0, 1)(C++ is a one-hot encoding of the class label with an additional NONE type, and PLINE: PEIRCLE+ PARC. PrOINT are the parameters for each primitive type. This representa- tion enables SkN to view each primitive as a prob- abilistic mixture, or superposition, of all primitive types.
Our key contributions are follows:
1. We propose the first sketch sketch--pace/ddat--paaa generative
2

---

SketchDNN: Joint Continuous-Diseret Diffusion for CAD Sketch Generation
Thus, the full sketch representation is given by matrix X E RRadd where is the maximum number of primi- tives, and is the feature dimension. For this work 16 and d' = 20. To recover the standard representation from our composite encoding, we extract the class label with the highest confidence (i.e., c = argmax {c}) along with its corresponding parameters.
where
M4-1 = Vai (1 at Xx + var-1 (1 an)) X0
[F+
and
(1 - ai (1 - TT-1)
0t-1
1 Cte
3. Methodology
We note that M4-1 is simply a function of x2 and xo, in more explicit terms H:-1 == M (X,, X0). The reverse process is learned by training a denoiser network to predict the clean data point given a noisy sample. The denoiser network can be expressed as xy (x;, t), and the learned reverse transition is given by:
In this work, we depart from the conventional diffusion pa- rameterization of predicting noise, and instead parameterize our model to predict the ground truth datapoint directly. We observed in our preliminary experiments that this approach yielded higher fidelity samples for CAD diagram generation than predicting the noise added. This finding parallels the results of (Ho et al., 2020), who demonstrated that predict- ing noise led to superior sample quality in the context of image generation, and so it appears the converse is true for CAD sketch generation. For completeness, and because the foundational principles of diffusion models extend naturally to our proposed Quassian-SSftmal diffusion paradigm, we include concise review of Gaussian diffusion formulated in terms of the ground truth parameterizaatonn
X = μ4 14 (x,, x (x,, t)) + o2-16
where novel samples are generated from pure noise XT by iteratively applying the learned reverse transition from = to =.
3.2. Discrete Diffusion
Building on the success of continuous diffusion models in domains such as image generation, Hoogeboom et al. (2021) introduced a discrete diffusion framework utilizing the Categorical distribution, that was later expanded by (Austin et al., 2021). In Multinomial diffusion, the forward process is a discrete Markov chain that jumbles the state of one-hot vector yo over T steps. The forward transition is defined to be
3.1. Continuous Diffusion
Diffusion models, first introduced by (Sohl-Dickstein al., 2015) and later popularized by (Ho et al., 2020), represent class of generative models that learn to undo gradual nois- ing process. The forward noising process is a Markov chain that gradually adds Gaussian noise to a clean datapoint z0 over a series of timesteps, so that Xy is indistinguishable from pure noise. The forward transition defined as:
y: ~ Cat(y--1QQ))
where Qe is a probability matrix. In other words, the for- ward transition stochastically permutes/shuffles the index of the in a one-hot vector. As result, the output of the for- ward transition is always one-hot vector, and similarly the cumulative transition and reverse transition also output one- hot vectors. This naturally renders superposition impossible in conventional discrete diffusion, because there is no way to accommodate blended class labels to express uncertainty. This detrimental because there no gradual destruction of information, once class label is shuffled all information is destroyed. Preliminary experiments with generating CAD sketches using Multionomial diffusion yielded poor results, we believe the root cause to be the inability to accommodate superposition. This is validated by our results in Section 6.
X, = Vaixi-1 + V(1 at)E
(L)
where E e~ N~ I) and ag. ai,...,, Qr is a noise schedule that controls the amount of noise added at each timestep. A noise schedule is sequence of monotonically decreasing scalar values satisfying onn = 1 and ar = O. We use the cosine variance schedule introduced by Nichol & Dhariwal (Nichol & Dhariwal, 2021) for this work.
Conveniently, iterative compositions of the forward tran- sition can be expressed in closed form as the cumulative transition:
v(1 c
3.3. Gaussian-Softmax Diffusion
where a. I1 - 0g This allows for efficient training, we can in one shot sample x, from the original datapoint Xo for any arbitrary t E {O....,T), The reverse transition is then given by:
To overcome the limitations of Multinomial diffusion, we introduce the Caussian-Softmar (GS) distribution as a con- tinuous relaxation of the Categorical distribution. We pro- pose a novel work utilizing the Gaussian Softmaxx distribution to enable
discrete diffusion frame-
X,-1 = 14-1 + Ot-16
3

---

SketchDNN: Joint Continuous-Disered Diffusson for CAD Sketch Generation
superposition, allowing information be gradually de- stroyed in the forward process and gradually recovered in the reverse process. Essentially, if x ~ Ni,, I²I), then (x) ~ (S I² where SM is the softmax transfor- mation. The softmax function transforms arbitrary vectors x into probability vectors p, satisfying Σ, P; = and pi 2 0, Vi, which geometrically means that the softmax operation maps vectors in R onto the probability simplex A Thus the support of the Gaussian-Softman distribu- tion is the probability simplex, and the density (derived in Appendix A.2) is:
Here, the mean = simply an interpolation between the logits of yo and the logits of y::
Pr- My,, va,(1 Tz- Dy' + vor- (1 0z)y1
Oz
where y' = log yt and y' = log yo- Again, The standard deviation similarly given as:
on) -
0t-1
at
p(ylu, 02 II exp 20 [(0)
w'll v'1l1)
(4)
A proof of the reverse process is provided in Appendix A.3. Intuitively, we perform continuous diffusion in log-space and project back onto the probability simplex using the soft- max function. The reverse transition is learned by training a denoiser network to predict ya f), where:
where
2 = v ((2T02)(D-1)
18 - 11 = 8 - 1'1 7 (1 - 2²))
yt-1 SMM (/4-1 (ye, v8 (y,, t)) + 0c-1c)
Here, μí = - 1 (FD)L 1, where every element in μ shifted by its last element, and similarly for y log y (logy))L every element in logy y is shifted by its last element.
Novel samples can be generated by iteratively applying the learned reverse transition from t. = T to tot=0 0.
1. FORWARD PROCESS
3.4. Variance Schedule Augmentation
Analogous to continuous diffusion, the forward process is a Markov chain that progressively noises a one-hot vector Yo via GS noise over T steps, generating sequence of increas- ingly noisy probability vectors Y1 Y2: ........... Yr. As noise accumulates, information about the true label is destroyed, and by t T. the class label becomes fully randomized where yr ~ GS(O, I). To achieve this, we define the for- ward transition as
In Crtussaa-SSoftmal diffusion, we observed that variance schedules cannot be used directly as-is due to the distor- tion introduced by the softmax projection on the injected noise. To address this, we propose an augmentation to the variance schedule, ensuring that the distribution of argmax(y:) A C (oxyo (1 at)/D). D). This is achieved through the following augmentation:
f(a,)2
1-
Ve+1 OSM (Va++I logye + VI- -0414)
(5)
f( + f(A)2' f(x) log
(D 1)x
(8)
where ~ 10,1). Additionally, we can conveniently sample ys directly from the one-hot vector yo using the cumulative transition (derivation in Appendix A.1):
Figure 2 illustrates the significance of this augmentation, showcasing its necessity over directly using the raw variance schedule. We also provide the derivation in Appendix A.4.
y: O's (Va, logy' + vI vl)
(6)
4. Sketch Diffusion
here y6 = kyo + 1-k 1 and k is user-defined constant close to 1, we set k: = 0.99. We slightly label smooth xo to avoid singularities from computing the logarithm of O. We remark that at = T the cumulative transition simply takes the softmax of an i.dd standard Gaussian vector, which by symmetry makes the argmax or label cr follow a uniform distribution, satisfying er C (.).
D
Since we focus solely on generating primitives, represent CAD sketch X as a set of primitives X = {zz}. where X E Raxd n denotes the maximum number of primitives, and represents the dimensionality of primitive features. Importantly, all n! permutations of X are equivalent terms of geometry, since permuting X doesn't change the actual geometry of each primitive. This invariance poses chal- lenge for generative modeling, as the ordering of primitives must not influence the learned generative process.
3.3.2. REVERSE PROCESS
Notably, we find that the discrete reverse transition is analo- gous to the continuous case and takes the form:
To address this, we adopt a permutation-equiive sion methodology, ensuring that the denoising procedure remains consistent irrespective of primitive ordering. To
diffu-
Yt-1 Gs (1 No) + 11-
4

---

SketchDNN: Joint Continuous-Diseret Diffusion for CAD Sketch Generation
1.0
1.0
p(c: Co)
5
0.8
0.8
p(c;= Go)
0.6
0.6
0.0
1.0
Normalized Timestep
Normalized Timestep
Figure 2. Left: The orange curve represents the raw cosine variance schedule æz, while the blue curve depicts the probability that the class label remains unchanged. Right: The orange curve shows the augmented variance schedule b, as defined in Equation (8), and the blue curve again represents the probability of the class label not switching. The probabilities were calculated using Monte Carlo estimation 100,000 samples. The augmented variance schedule results schedule.
gradual discrete forward process compared to the raw variance
apply noise to sketch, we perturb each primitive inde- pendently, such that the forward transition distribution and cumulative transition distribution, respectively, factorize as:
not introduce positional dependencies. This can be facili- tated by using an architecture that is inherently permutation- equivariant. In our case, we adopt the diffusion transformer architecture by (Peebles & Xie, 2022) and simply omit posi- tional encodings, since transformers have been shown be intrinsically permutation-cquivarianl (Vaswani al., 2017: Xu et al., 2024a). A similar architecture is used in Brepgen by (Xu et al., 2024b) for permutation invariant, instead of equivariant, generation of B-rep splines.
p(X--1 Xx)=
II p( (1,s)
p(x, Xo)
II p(ae, x0.s)
(10)
Since each primitive undergoes the same noising process in- dependently of the others, permuting the order of primitives forward process, results an equivalent per-
4.1. Primitive Diffusion
in X, before mutation of the noised sketch X,, That is, if any permu- tation of (1...., n then p( a (XX, xXXo)) = p(X, Xx).
Each primitive is characterized by both discrete and con- tinuous variables, necessitating diffusion process that si- multancously operates in both domains. Formally, each primitive represented as x = (b, c, c.). where denotes the construction label, c the class label, and p the continuous parameters.
Thus, the forward process itself is permutationnequivarraatl
Applying Bayes' rule, the posterior distribution can be ex- pressed as:
To model the diffusion process, treat each component independently. The discrete variables b and undergo forward process governed by Equation 6 and a reverse pro- cess dictated by Equation 7. The continuous parameters p. in contrast, follow standard diffusion process, where the forward and reverse transitions are defined by Equa- tions 2 and 3, respectively. Essentially, we perform joint discrete-continuous diffusion by independently performing Gaussian-Softmar diffusion for discrete variables and stan- dard Gaussian diffusion for continuous parameters.
p(X, ()((Xx-1(Xo)
p(X,11 X,, Xo)
((X,(Xo)
p ( 1.
p (oo.))
p Te. 20,1)
(11)
Thus, using the same line of reasoning as for the forward pro- cess, we can see that the reverse process is also permutation cquivariant. To ensure the learned reverse process main- tains permutation equivariance, the denoiser network must
5

---

SketchDNN: Joint Continuous-Diserde Diffusion for CAD Sketch Generation
Random
7
%
% t-1
Vector E
IP
11 O
Interpolate Between Noise and Prediction
NormalçO,Dy
Random
Vector C
Gaussian- Softmax(O.D
Diffission
Model
Figure 3. The generation pipeline of SketchDNN. Starting from pure noise seed Mr, the denoiser network iteratively refines the sample by interpolating between the noisy input and the model's prediction of the clean output. The final generated sketch, No. is obtained after I'' successive denoising steps. The interpolation formulae are given by Equation for discrete variables and Equation 3 for continuous variables.
5. Experiments
done to avoid sketches with identical geometry but differing orderings from being labeled as nonidentical. Lastly, we split the remaining 1.4 million CAD sketches into subsets: we reserved 90% for training, 5% for validation, and 5% for testing. Finally, we simplified the parameterization of each primitive in accordance with Section 2. A similar procedure was performed by (Para et al., 2024) and (Seff et al., 2022).
We empirically validate our diffusion model, SketchDNN, against prior art. We also perform ablation studies to show that our approaches to address the heterogeneity and permu- tation invariance of sketches improves the performance of our model. We present metrics for likelihood and sample quality. Additionally we provide a qualitative comparison between our model and the dataset in Figure
5.2. Model and Training Setup
5.1. Dataset Preprocessing
SketchDNN is based on simplified variant of the diffusion transformer architecture proposed by Peebles et al. (Peebles & Xie, 2022), with positional encodings and gate condition- ing omitted. The omission of positional encodings ensures that the denoiser network remains permutation equivariant, as discussed Section 4. We use an embedding size of 512 with a depth of 32 transformer blocks. We trained our model to generate samples over T 2000 timesteps. Since the dif- fusion process involves reconstructing clean sketch from noisy input, we use reconstruction loss, LRECON. composed of MMan-Squaree Error (MSE) loss for continuous variables and Cross Entropy (CE) loss for discrete variables:
We used the CAD sketch dataset introduced SketchGraphs by Seff et al. (Seff et al., 2020), which consists of 15 mil- lion human-created CAD sketches extracted from Onshape, cloud-basee CAD platform. The dataset is highly im- balanced, with approximately 84% of sketches containing fewer than eight primitives. These sketches predominantly feature simple boxes that are almost identical to one another. To avoid biasing our model towards such sketches, we ex- cluded sketches with fewer than eight primitives. Addition- ally, we discarded sketches with more than 16 primitives due to time and resource constraints. The sketches also ex- hibit significant variation in position and scale, ranging from a few millimeters to several meters in size. Accordingly, we applied a normalization procedure where each sketch was translated and rescaled, such that the bounding box was centered at the origin and inseribed within the unit square.
ACMSE + LeE
if i I 150,
LRECON
[MSE + LcE
if x >> 150
where we set À = 16. We found weighing the MSE loss of smaller timesteps to be more beneficial to sample quality, than simply weighing the MSE loss higher over all timesteps. The model was trained for 1000 epochs using a batch size of 512, distributed across NVIDIA A30 GPUs. A constant learning rate of x 10-4 was used throughout training.
Next, the dataset contains substantial number of duplicate sketches, primarily due to users following tutorials, reusing previously created designs, or leveraging Onshape's collab- oration tools to replicate sketches. To again avoid bias, we grouped identical sketches and kept one sketch from each group. For this, we first performed 8-bit quantization on continuous parameters, then sorted the rows in the sketch matrix for canonical ordering, and finally picked cor- responding unquantized sketch for each group. This was
To avoid hindering superposition, we use the ground truth primitive type to mask irrelevant parameters before comput- ing the MSE loss. Thus, our denoiser network is trained to predict parameters for all possible primitive types and assign
6

---

SketchDNN: Joint Continuous-Disrret Diffusion for CAD Sketch Generation
confidence scores to each. For example, if the true primitive type is line, the model still predicts parameters for other types, such circles or ares, but assigns probabilities re- flecting its confidence in each prediction. As a result, during inference, we weight the continuous variables outputted by our model by their corresponding rescaled type probabili- ties. We rescale the predicted type probabilities by dividing each probability vector with its maximum element. This rescaling prevents relevant parameter values from decaying to zero throughout the reverse diffusion process while irrel- evant parameters are masked out, ensuring more accurate predictions of noisy primitives. This adjustment is necessary since the model is trained to expect irrelevant parameters to approach zero at smaller timesteps, discrepancies may arise during the reverse process because we don't train the model to zero out irrelevant parameters. Applying this weighting ensures that the model's ' predictions better align with the ground truth, particularly at smaller timesteps.
Table I. The NILL for each model is reported in bits, where a lower NLL is better. Notably, our diffusion model achieved SOA NLL. SketchDNN (Pos.) the ablation that includes positional encodings, where SketchDNN (Cat.) is the ablation that uses categorical diffusion. Bold represents state of the art performance, while underlining represents sccond best performance.
Method
Bits/Sketch.,
Bits/Primitivel
SketchDNN (Ours)
81.33
5.08
SketchDNN (Pos.)
83.03
5.18
SketchDNNN (Cat.)
106.10
6.63
Vitruvion
84.80
8.19
SketchGen
88.22
8.60
ELBO, which satisfies the inequality ELBO > NLL. We calculate the NLL over our test set of 70K CAD sketches. The results are presented in Table 1. SketchDNN achieves lower NL. than the previous state-of-the-an model, Vit- ruvion, demonstrating that our diffusion-based approach is better suited to CAD sketch generation than autoregressive modeling.
6. Results
We evaluate SketchDNN against the most relevant prior methods for CAD sketch generation: SketchGen (Para et al., 2024) and Vitruvion (Seff et al., 2022). Both approaches represent CAD sketches as sequences of tokens and gener- ate them autoregressively. Vitruvion, as the previous state of the art, serves as our primary baseline for comparison. Additionally, we assess the effectiveness of our diffusion- based approach by comparing it with conventional discrete diffusion methods as an ablation study, including categori- cal diffusion and latent diffusion. For latent diffusion, we train a variational autoencoder (VAE) to map sketches into a latent space and train an auxillary diffusion network to generate latents in manner analogous to Stable Diffusion. For categorical diffusion, we train an alternative version of SketchDNN, which we term SketchDNN (Cat.), that is trained using the categorical diffusion paradigm by (Hooge- boom et al., 2021) while keeping all other architectural and training details identical. Similarly, we conduct ablation study to examine the impact of permutation invariance in our generation process, To this end, we train an alterna- tive version of SketchDNN, which we term SketchDNN (Pos.), that incorporates positional encodings while keeping all other aspects identical.
Notably, our Glussian-Softmal diffusion paradigm signif- icantly outperforms traditional categorical diffusion. In fact, SketchDNN (Cat.), which employs categorical dif- fusion, performs worse than both Vitruvion and Sketch- Gen. This suggests that the superposition mechanism in Caussian-Softmar diffusion is a key factor in improving model performance. This finding is particularly surpris- ing, as SketchDNN (Cat.), being a diffusion model, still has access to the full sketch context at any given time, yet performs worse. Additionally, our permutation-invariaa dif- fusion paradigm appears to provide a measurable but smaller benefit, as indicated by the relatively close NLL scores of SketchDNN and SketchDNN (Pos.). These results suggest that while permutation-invariin denoising contributes to performance, the primary factor driving improvements in CAD sketch generation is the use of superposition.
Table 2. The FID, precision, and recall are presented for uncon- ditional primitive generation. A lower FID is better, a higher precision better, and a higher recall is better. We note that our diffusion model has achieved SOA FID and recall. SketchDNN (Pos.) is the ablation that includes positional encodings, where SketchDNN (Cat.) is the ablation that uses categorical diffusion. Bold represents state of the art performance, while underlining represents second best performance.
6.1. Negative Log-Likelihood
We evaluate the negative log-likelihood (NLL) as a mea- sure of our model's ability to learn the distribution of CAD graphs. A lower NLL indicates better generalization and improved model performance; however, it does not neces- sarily correlate with sample quality. For diffusion models, computing the exact NLL is intractable, therefore, we follow the standard approach of approximating the NLL using the
Method
FID
Precisiont
Recall
SketchDNN (Ours)
7.80
0.246
0.266
SketchDNN (Pos.)
10.26
0.230
0.245
Latent Diffusion
93.34
0.134
0.033
SketchDNN (Cat.)
148.93
0.117
0.028
Vitruvion
16.04
0.294
0.176
7

---

SketchDNN: Joint Continuous-Diseret Diffusion for CAD Sketch Generation
Figure 4. Comparison of CAD sketches from the SketchGraphs dataset (top), generations from SketchDNN (middle), and generations from Vitruvion (bottom).
6.2. Sample Quality
achieve comparable results, reinforcing the conclusion that permutation-invarian denoising has much smaller effect generation quality than superposition. Since these mod- els substantially outperform all other models, we conclude that the primary contributor to performance is the ability of our Gaussian-Softmal paradigm to accommodate superpo- sition.
Here we present the Fréchet Inception Distance (FID), pre- cision, and recall as metrics evaluate the fidelity of gen- erated CAD graphs, as shown in Table 2. Fidelity mea- sures how closely synthetic CAD graphs resemble real CAD graphs. Standard image generation metrics are employed to assess sample quality, for this we render CAD sketches as monochromatic images. A lower FID score indicates higher fidelity samples, and our diffusion model achieves state-of-the-ard (SOA) FID. Higher precision reflects closer resemblance between generated and real samples, minimiz- ing irrelevant or low-quality outputs, while higher recall indicates greater diversity in generated samples, capturing the full range real data variations. Precision and recall often exhibit an inverse relationship, where improvements in one may lead reductions in the other. As is standard in image generation literature, we compute these metrics using Inception V3 over 10K CAD graphs from test set.
6.3. Failure Cases
Figure 5 illustrates three representative failure modes ob- served in SketchDNN. 1) In some cases, the model generates sketches lacking any discernible geometric structure or pat- tern. We find that this issue can be mitigated by increasing the weight of the model prediction prior to the reverse inter- polation step in Equation 7, suggesting that high uncertainty in primitive type impairs the reverse process's ability to reconstruct coherent structure. We hypothesize that this failure mode could also be reduced through conditional generation, which would constrain the model's uncertainty during sampling. 2) A second failure involves primitives whose endpoints should be coincident but instead sep- arated by large gaps. This issue is likewise alleviated by increasing the contribution of the model prediction during the reverse step. indicating that the error stems from lim- itations in our parameter masking strategy. 3) The final failure mode involves the presence redundant or extrane- ous primitives, often overlapping with valid geometry. We
We observe similar trends as in the NLL evaluation, with our Gaussian-Softmax diffusion paradigm again significantly outperforming alternative sketch generation approaches. No- tably, SketchDNN (Cat.) yields the worst performance among all methods, further indicating that superposition plays a large role in CAD sketch generation. Surprisingly, the latent diffusion model also underperforms, indicating that latent space diffusion is ill suited for CAD sketch gen- eration. Once again, SketchDNN and SketchDNN (Pos.)
8

---

SketchDNN: Joint Continuous-Diereet Diffusion for CAD Sketch Generation
traced this issue our training data, where several sketches contain overlapping primitives.
ways. 1) They use heuristic reverse process whereas we follow a more principled approach and derive the reverse transition from the posterior of the forward process. 2) They use the cosine variance schedule directly which we demonstrate abruptly destroys information (see Figure 2). 3) As a result, they require a one-hot projection scheme that drastically hinders superposition which we show important for CAD generation.
8. Conclusion
Figure 5. Visualizations of primary failure cases. Left: Gen- erated CAD sketch with discemnibe pattern. Middle: Large gaps between primitives. Right: Extraneous primitives, zoom of the bottom left portion of a triangle where the bottom leg has an overlapping redundant line.
In this work, we present SketchDNN, the first data-space diffusion model for CAD sketch generation. We overcome the key challenges of sketch generation, namely the hetero- geneity of primitive parameterizations and the permutation invariance of primitives, via superposition and permutation- invariant denoising, respectively. To facilitate this we pro- pose Gaussian-Softmax diffusion, novel discrete diffusion paradigm that enables blended class labels. In the same vein, we introduce the Gaussian-Softum distribution a novel vari- ant of the Logistic-Normal distribution. We demonstrate that our model advances the state-of of-the-art in terms of both fidelity and diversity of sketches. We hope that future work will build off of framework improve CAD sketch genera- tion, or apply our framework to other domains such text generation.
7. Related Work
Prior work in CAD sketch generation has predominantly focused on autoregressive approaches, treating sketches sequences of tokens and leveraging language modeling tech- niques (Seff et al., 2020; Ganin et al., 2021; Para et al., 2024; Willis et al., 2021; Wu et al., 2021; Seff et al., 2022; Wu et al., 2025). In tangential domains with sketch-like data, for instance UT layout generation, DLT by (Levi et al., 2023) uses a joint continuous-diserete approach similar to ours except with Multinomial diffusion instead, whereas others solely use continuous diffusion (Shabani et al., 2022; Cheng et al., 2023). More broadly for CAD diffusion as whole, researchers have primarily utilized latent diffusion to generate CAD models (Wang et al., 2024; Xu et al., 2022: 2024b).
Impact Statement
This paper presents work whose goal is to advance the field of Machine Learning. There many potential societal consequences of our work, none which we feel must be specifically highlighted here.
Similarly, prior work on discrete diffusion has largely re- lied on the categorical distribution for discrete noise (Sohl- Dickstein et al., 2015; Hoogeboom et al., 2021; 2022; Lou et al., 2024; Bond-Tayd Taylor et al., 2021), or instead on apply- ing continuous diffusion to discrete variables (Cohen et al., 2022; Yu et al., 2022: Han et al., 2022). Several researchers have proposed categorical relaxations outside the context of diffusion (Aitchison & Shen, 1980; Maddison et al., 2017; Jang al., 2017; Potapezynski al., 2020). (Maddison et al., 2017) and (Jang et al., 2017) propose a similar re- laxation referred to as the Gumbel-Softmax distribution, where Gumbel, instead of Gaussian, vectors are mapped onto the probability simplex. (Potapczynski et al., 2020) use a pseudo-softmar transform to approximately map Gaussian values to the simplex, and (Aitchison & Shen, 1980) pro- posed variant that expands the dimensionality of vectors by appending zero before the softmax transform.
References
Aitchison, J. and Shen, S. M. Logistic-normal distributions: Some properties and uses. Biometrika, 67(2):261-272, 1980. ISSN 00063444, 14643510.
Austin, J., Johnson, D. D., Ho, J., Tarlow, D., and van den Berg. R. Structured denoising diffusion models in discrete state-spaces. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Informa- tion Processing Systems, 2021.
Bond-ra S.,, Hessey, P., Sasaki, H., Breckon, T., and Willcocks, C. G. Unleashing transformers: Parallel token prediction with discrete absorbing diffusion for fast high- resolution image generation from vector-quantized codes. In European Conference on Computer Vision, 2021.
In the context of discrete diffusion, the closest works to our Gaussian- -offtmax methodology are (Han et al., 2022) and (Karimi Mahabadi et al., 2024) which superficially resemble our proposed approach, however they differ in 3 significant
Cheng, C.-Y., Y., Huang, F., Li, G., and Li, Y. Play: Parametri- cally conditioned layout generation using latent diffusion. In International Conference on Machine Learning, 2023.

---

SketchDNN: Joint Continuous-Diserete Diffusion for CAD Sketch Generation
Cohen, M., Quispe, G., Corff, S. L.., Ollion, C., and Moulines, E. Diffusion bridges vector quantized vari- ational autoencoders. In Chaudhuri, K., Jegelka, S., Song, L., Szepesvari, C., Niu, G., and Sabato, S. (eds.), Pro- ceedings of the 39th International Conference on Ma- chine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 4141 1156. PMLR, 17-23 Jul 2022.
Langley, Crafting papers on machine learning. In Langley, P. (ed.), Proceedings of the 17th International Conference on Machine Learning (ICML 2000). pp. 1207-1216, Stan- ford, CA, 2000. Morgan Kaufmann.
Levi, E., Brosh, E., Mykhailych, M., and Perez, M. Dit: Conditioned layout generation with joint discrete- continuous diffusion layout transformer. 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 2106-2115, 21,,, 2023.
Ganin, Y., Bartunov, S., Li, Y., Keller, E., and Saliceti, S. Computer-aided design as language. In Ranzato, M., Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, W. (eds.), Advances in Neural Information Processing Systems, volume 34, pp. 5885-5897. Curran Associates, Inc., 2021.
Lou, A., Meng, C., and Ermon, S. Discrete diffusion mod- eling by estimating the ratios of the data distribution. In Salakhutdinov, R., Kolter, Z., Heller, K., Weller, A., Oliver, N., Searlett, J., and Berkenkamp. F. (eds.), Pro- ceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learn- ing Research, pp. 3281998991 9--22848. PMLR, 21-27 Jul 2024.
Han, X., Kumar, S., and Tsvetkov, Y. Ssd-Im: Semi- autoregressive simplex-bat based diffusion language model for text generation and modular control. In Annual Meet- ing of the Association for Computational Linguistics, 2022.
Maddison, C. J., Mnih, A., and Teh, Y. W. The concrete distribution: A continuous relaxation of discrete random variables. In International Conference on Learning Rep- resentations, 2017.
Ho, J., Jain, A., and Abbeel, P. Denoising diffusion proba- bilistic models. In Larochelle, H., Ranzato, M.,, Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 6840- 6851. Curran Associates, Inc., 2020.
Nichol, A. Q. and Dhariwal, P. Improved denoising diffu- sion probabilistic models. In Meila, M. and Zhang, T. (eds.), Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Ma- chine Learning Research, pp. 8162-8171. PMLR, 18-24 Jul 2021.
Hoogeboom, E., Nielsen, D., Jaini, P., Forré, P., and Welling, M. Argmax flows and multinomial diffusion: Learning categorical distributions. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021.
Para, W. R., Bhat, S. F., Guerrero. P., Kelly, T., Mitra, N., Guibas, L., and Wonka, P. Sketchgen: generating con- strained cad sketches. In Proceedings of the 35th Inter- national Conference on Neural Information Processing Systems, NIPS '21, Red Hook, NY, USA, 2024. Curran Associates Inc. ISBN 9781718845333.
Hoogeboom, E., Gritsenko, A. A., Bastings, J., Poole, B., van den Berg, R., and Salimans, T. Autoregressive dif- fusion models. In International Conference on Learning Representations, 2022.
Peebles, W. S. and Xie, S. Scalable diffusion models with transformers. 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 1172-4182, 2022.
Huijben, A. M., Kool, W., Paulus, M. B., and van Sloun, R. J. G. A review of the gumbel-max trick and its tensions for discrete stochasticity in machine learning. IEEE Transactions on Pattern Analysis and Machine In- telligence, 45:1353-1371, 2021.
Potapczynski, A., Loaiza-Ganem. G., and Cunningham, J. P. Invertible gaussian reparameterization: revisiting the gumbel-softmax. In Proceedings of the 34th International Conference Neural Information Processing Systems, NIPS '20, Red Hook, NY, USA, 2020. Curran Associates Inc. ISBN 97817 17817138
Jang, E., Gu, S., and Poole, B. Categorical reparameteriza- tion with gumbel-softmax. In International Conference on Learning Representations, 2017.
Seff, A., Ovadia, Y., Zhou, W., and Adams, R. P. Sketch- graphs: A large-scale dataset for modeling relational ge- ometry in computer-aided design. ArXiv, abs/2000.088066 2020.
Karimi Mahabadi, R., Ivison, H., Tae, J., Henderson, J., Beltagy, I., Peters, M., and Cohan, A. TESS: Text-to-text self-conditioned simplex diffusion. In Graham, Y. and Purver, M. (eds.). Proceedings of the 18th Conference of the European Chapter of the Association for Compu- tational Linguistics ( (Volume I: Long Papers), pp. 2347- 2361. St. Julian's s. Malta, March 2024. Association for Computational Linguisties.
Seff. A., Zhou, W., Richardson, N., and Adams, R. P. Vitru- vion: A generative model of parametric CAD sketches In International Conference on Learning Representations, 2022.
10

---

SketchDNN: Joint Continuous-Diserdt Diffusion for CAD Sketch Generation
Shabani, M. A., Hosseini, S., and Furukawa, Y. Housediffu- sion: Vector floorplan generation via diffusion model with discrete and continuous denoising. 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5466-5475, 2022.
Xu, X., Lambourne, J., Jayaraman, P. K., Wang. Z., Willis, K. D. D., and Furukawa, Y. Brepgen: A b-rep generative diffusion model with structured latent geometry. ACM Transactions on Graphics (TOG), 43:1 14, 2024b.
Yu, P., Xie, S., Ma, X., Jía, B., Pang, B., Gao, R., Zhu, Y., Zhu, S.-C., and Wu, Y. N. Latent diffusion energy- based model for interpretable text modelling. In Chaudhuri, K., Jegelka, S., Song, L., Szepesvari, C., Niu, G., and Sabato, S. (eds.), Proceedings of the 39th International Confer- ence on Machine Learning, volume 162 of Proceedings of Machine Learning Research, pp. 25702-25720. PMLR, 17-23 Jul 2022.
Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequi- librium thermodynamics. In Bach, F. and Blei, D. (eds.), Proceedings of the 32nd International Conference on Ma- chine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 2266,,265, Lille, France, 07-09 Jul 2015. PMLR.
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Proceedings of the 31 International Conference on Neural Information Processing Systems, NIPS' 17, pp. 6000-6016 Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 978151086096.
Wang, H., Zhao, M., Wang, Y., Quan, W., and Yan, D.-M. Vq-cad: Computer-aided design model generation with vector quantized diffusion. Comput. Aided Geom. Des., 111:102327, 2024.
Willis, D. D., Jayaraman, P. K., Lambourne, J., Chu, H., and Pu, Y. Engineering sketch generation for computer- aided design. 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 2105-211 2021.
Wu, R., Xiao, C., and Zheng, Deepcad: A deep gener- ative network for computer-aided design models. 202/ IEEE/CVF International Conference Computer Vision (ICCV), pp. 6762-6762, 2021.
Wu, S., Khasahmadi, H., Katz, M., Jayaraman, K., Pu, Y., Willis, K., and Liu, B. Cadvim: Bridging language and vision in the generation of parametric cad sketches. In Leonardis, A., Ricci, E., Roth, S., Russakovsky, O., Sattler, T., and Varol, G. (eds.), Computer Vision ECCV 2024, pp. 368-384, Cham, 2025. Springer Nature Switzer- land. ISBN 978-3-031-78897-6.
Xu, H. Xiang, L., Ye, H., Yao, D., Chu, P., and Li, B. Permutation equivariance of transformers and its applica- tions. In Proceedings of the IEEE/VE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 5987-5996, June 2024a.
Xu, X., Willis, K. D. D.,. Lambourne, J., Cheng, C.-Y., Jayaraman, P. K., and Furukawa, Y. Skexgen: Autore- gressive generation of cad construction sequences with disentangled codebooks. ArXiv, hals/2207.04633 2022.

---

SketchDNN: Joint Continuous-Dieerde Diffusion for CAD Sketch Generation
A. Gaussian-Softmax Distribution
The Gaussian-Softmax distribution (GS), a variation of the Logistic-Normal distribution introduced by Aitchison (Aitchison Shen, 1980), the distribution of a Gaussian vector that has undergone the softmax transformation. The probability density is:
p( -D= -D=(22TO2) -ي
πI
y1
27
2
exp
log
yi yD
ps + HD)
Σ ifD
log
1/
μ4 + AD
20²
yD
and the derivation of the density is provided in A.2.
A.1. Derivation of Cumulative Forward Transition
simple derivation for the cumulative transition is:
{ /ar+2 log softmax {Varti log (fx) + v -at1e) + v1 - a0-22
p (To+2 ž+) = softmax
Expand terms:
= softmax {vauts (Vattilogs log (Zt) 11 a0+1 + v1 a4-2
Reduce terms:
{ [V04420441 log (Tt) /442((1-444) var-2 v a(+2()
softmax
Constants disappear due to shift invariance of softmax:
softmax {
/04420441 log (Tt) + Vat+2l1-a411)E - a4+1)E++ V 0442
Sum of Gaussians another Gaussian with summed variances:
{ (a1420441 log (Tx) + (a4+2(1-c0+1) a1+1) ax142
softmax
Merging terms accumulates the terms:
{ Va142a4+1 (āt) VI a1420141
softmax
therefore iteratively applying the forward transition will simply accumulate the variance schedule terms.
A.2. Derivation of Gaussian Softmax Density
Our strategy is to use the change of variables formula:
p'(0) = p ( Det [ hh (T))
where M(r) is some invertible function and (et(J(((g)) is the determinant of the jacobian. More specifically,
softmax (g) softmax - I' -
holds due to the shift invariance of softmax, thus our strategy is to first find the density of 7 [y y/D y/2 yD, .p, 00, this "centered" form turns the softmax into an invertible function Ti(y7) softmax where the inverse is h ( = log xD).
The derivation is as follows for ÿ ~ Ni2, I2I,, additionally for brevity we aggregate all factors into a single variable C:
12

---

SketchDNN: Joint Continuous-Dierrte Diffusion for CAD Sketch Generation
Marginalizing over yD yields the density of the "centered" density: p())) = L 0
p(y' yD)p(yb) dyD
(2nT²) - exp {
20 (yi yn - mi)2 }
(2mo?)-* exp {
20 (un un)²}
dyn
Expand terms:
= (2TT²)-
20 (y? - 2ystes + m²)
exp
-000
DFD
DyDuD + 11 + (D 1)y2 + 2yD Σ 14 yE )} dyp
2
x exp
20²
Reduce yD terms:
m:)3 }
1
C
II
exp
(3i
202
X
100
exp
20
1
VD Zyaun + + +D 1)v2
2
Zyp Σ
Mi V/
dyD
#DD
Reduce terms:
l cxp
1
20²
Dy
2yD
μD + Σ
y/
Mi
+ p3
dyo
i
Complete the square:
Σ 1)} dyn
= Cexp {
1
0
20
exp
Dyj 2yn
PDD +
Yi u4i
2g
4D
c
00
1
HD +
DDD Vi
14)
exp
VDyD
dyD
20²
VD
The integrand is Gaussian density in terms of yp!
= (2xa²)- o
II ifD
exp
20 (y) - -1)3
exp
20
HD+ + EieD y/ - 145
2
X exp
20
D
13

---

SketchDNN: Joint Continuous-Diserde Diffusion for CAD Sketch Generation
We simplify this further using the fact that shifting the mean by any constant scalar does not affect the density due the shift invariance of the softmax operation i.e., p(y 02) p + ct, o2), thus if we =nD the density becomes:
D (2TO²)
1-
exp
1
Σ 1fD
(y)
uD) D
1
Σ FFD
Ms + MD
2
Now that we have the density of y we can use straightforward application of the change of variables formula, with the known result that the determinant the Jacobian of the softmax (II. y/) (Jang al., 2017; Maddison et al., 2017) to obtain:
P(T DJ (2TTO*
II
y1
27
exp
1
log
yi UD
μ4 + HD)
2
log
1/
14
PD
20²
D
UD
D
ifD
A.3. Derivation of Posterior for Guassian-Softmax
For the reverse process we sample from the posterior distribution p(ε,-1 ((,,-112,,,o)). Fo). using the same setup as in DDPM (Ho et al., 2020):
(1, p( F00 -( (() p To)
p ( To)
p(Ie, 2o)
p ((
and due the Markov property p( 11,,,
( the posterior simplifies to:
p( (p(T))((1)) (To)
& p(E
plTx (it To)
fortunately we have access to the necessary densities which are simply:
1.
p(8)-1180)
II x
exp
1
2/
exp
Σ
2
)e-1)
2D(1
a1-1)
i
HD
where 1 = loog 2t 1.1
a, log T0.i
2.-1.
Do.
2.
( x exp
ri
exp
1
Σ Th
2(1 01
2D(1 4z)
if
where ri loog F,,
aa log 21-1,0
14

---

SketchDNN: Joint Continuous-Disered Diffusson for CAD Sketch Generation
Focusing on the first exponential terms with simplified notation where 2/ of = 1 Sz. and / 1 ū
log 2t,
1/s
log St-1d
34
log
F0.1 20.00
1.-1.D
1
exp
exp
2(1
1
2(1
at)
ifD
ifD
exp
1
y/:
vāl-123)
2
(2+ vars1)
20
20 ifD
ifD
1
Σ
2
(2i varui)
exp
V/ v a2 a1-1
+ o?
2
i
1-1
2
= cxp
1
Σ
[ - 2y, v /1, 12: + Th- 22
2
/ i-1
1
2 / +ays?)
+
01
1
Σ
y
2y V 1/
2a o
at!L
x exp
+
2
2
0,-1
oi
i
1-1
=exp
{ - 1
1
ag
2
Vād-12
6i-1
12
+
vayzi
y/
f-1
observe that we can read the posterior mean and variance as:
V -
1122
Var(1 1)-1) + v 0.)00
11-1,
0--1
2
0i
2
0,-1
1 at
0t
-1
(1 dz)(1 a
+
0,
1-1
since the form has to be proportional to exp
- (y:: 11)
20
Similarly for the second exponential term:
2
Σ
1
Σ T'
exp
24
exp
2D
T
2D
az)
i
2
27
1
= exp
2D
7-1 1
2
ifD
Σ y1
V /0-111
+
01
1/D
Σ 2 - Vacyi
exp
1
1
Σ
(yi /a-111) 2
+2
Σ
(11 1o) vā.-1ag)
2D
2
0111
iDD
jRiifD
- vans)) }}
Σ
(z:
V a.yi) +2
Σ (z+ Va,
1ND
The terms in bold correspond exactly with the first exponential term, and imply the same posterior mean and variance,
15

---

SketchDNN: Joint Continuous-Diserde Diffusion for CAD Sketch Generation
further more the remaining terms are proportional to:
1
exp
2
UtUj
V 00-12 v Va-12
+
(- (-Vazziyj Vat2jui + aeWiWs)
2D
i-1
10
exp
2D
Σ
2 i-1
Uilly - v 1 (o-
+ oo
(- (-Vazziys - vaizz0i + a131115)
jKLiif D
= exp
2D
Σ
i-1
+
at yiys
(V
oi-1
Vaiz
of
of
+
0
of
yj
which again imply the same posterior mean and variance since the form has to be proportional to:
Σ
y&y o²
14 020s
exp
02
+
0²
Thus all terms agree on the same posterior mean and variance of:
Vaza
2
va B1-1)2 + v 1
14-1,
1
i-1
01
2
00
-1
(1 - az) (1 11 az
0
02-1
We can simplify the posterior mean by utilizing the shift invariance property, where we observe that:
14-1, vor(1 a. (log ft, log D1DD) + (1--i(1- z0, log Fo.D)
1 1 πe
voe(1 v0((1-aa11 a log 21 D + Vōl-1 at) log 20.0 -Var(1 σz-1) log 11, ( a1) log To.i
ag
at
+ +C Vør(1 11 log Rt,s + vā - a1) log T0,i
1-a;
so the posterior mean can be simplified as:
Vor(1 at-1) a1-1) R4, + vot-i(1 log |4-1,
oe) log zo.
1 az
Since all the terms agree on the same posterior mean and variance, and furthermore the posterior density has the same form the Gaussian-Softmar distribution, conclude that 11,, Fo) p( 1?
A.4. Derivation of Variance Schedule Augmentation
As shown in Figure 2, we need to augment our chosen variance schedule to ensure that the class labels are gradually noised. Taking inspiration from Categorical diffusion, desideratum is to smoothly noise the class label such that the argmax of x, follows the distribution C(b,x0 + $ (1 b))1) where C is the categorical distribution and by, b..... by is variance schedule of our choosing. Unfortunately there is no closed form formula to determine the argmax of a Gaussian vector, so we instead approximate a Gaussian vector with a Gumbel vector. A useful property of the Gumbel distribution is that it can be used to reparameterize the Categorical distribution where argmax a log p + g) ~ C(softmax ( a log p/). ~ 9(0, 1), and G the Gumbel distribution (Huijben et al., 2021). Then considering the forward process in Gaussian-Soffue Softmax diffusion can derive:
argmax (x;3 argmax softmax (Va, log (xx
1- k) k
VI aig) vI-aag)
16

---

SketchDNN: Joint Continuous-Dierrte Diffusion for CAD Sketch Generation
Simplifying the expression inside the argmax:
1- k 1-k1
argmax
Vot log
1xo +
v1 0gg
D
argmax
Cxi
log
1xo
+
1 k:
1
+ g
softmax
{ 04
[V1- 07
log
kxo
+
1
D 1
1 ae
D
We aim to satisfy:
1 1- k ))
1- bt 1 D
softmax
log
kxo
+
6ix0
Taking the logarithm of both sides gives:
1- k 1-k1)
D )
(6x00
1 1 Tt
log
1xo
+ log
D
Assuming without loss of generality that Xu = [1, 0, .......)) OJ. we have:
at log
+
k
log
k
log
b1
be 1-1bb
1-
log
1 by
1 at
D
D
Since is free parameter, can set:
1- be
1- /t )
log
b1 +
at
log
h: +
D
V
17
D
This reduces the equation to:
at
0,
k
0. log
1 by
12
(D 1) +
1....
(D 1)br + 1
Thus, we deduce:
02
1 - be
- k
log
/ /log
(D 1)b, +
(D- - 1) +
Finally, isolating yields:
n
1 1 be
1 1 k (D - 1-1 +
ag
n + m
where
n log
(D 1)b, + 1
m log
17


Reviews:
[{"review_id": "f0SM57E5j4", "reviewer": "Reviewer_zoeo", "summary": "This paper introduces a diffusion-based generative model for CAD sketch primitive generation. The technical innovation is a Gaussian-Softmax based diffusion paradigm. The method addresses key challenges in the heterogeneity of primitives (each primitive type is defined by its distinct parameterization) and permutation invariance of primitives. The proposed method improves the state-of-the-art results on the SketchGraphs dataset. This work marks the first application of diffusion models to parametric CAD sketch generation.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "1. No Qualitative Analysis  \n   1. We have now written a qualitative analysis ready for the final paper. However, we only compare ours against Vitruvion, as other prior arts like SketchGen don’t have published code. We chose not to do a qualitative analysis against Sketchgraphs since Vitruvion is a follow up work to it.  \n2. No Failure Case Analysis  \n   1. We now have a failure case analysis written and ready for the final paper. The failure cases we discuss are: 1\\) The generated primitives have no discernible pattern or form, 2\\) gaps exist between primitive terminations or in other words the endpoints of primitives that should be coincident are not, 3\\) Extraneous primitives that don’t contribute to the overall sketch design or are not intertwined with the rest of the sketch  \n3. In the ablation study, SketchDNN (Cat.) is trained using categorical diffusion. Does this involve quantizing continuous parameters to make them discrete? This detail is unclear.  \n   1. No, continuous parameters are not quantized. The only change is that the forward and reverse process of discrete variables (primitive types, constructible tag) follows the methodology set by Hoogeboom et al. in “Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions” which doesn’t allow for superposition.  \n4. The number of primitives varies for each sketch. The paper does not explain how the number of primitives is determined during testing or how the data is prepared during training.  \n   1. We set the maximum number of primitives to be 16, due to time and resource constraints (Section 5.1, line 305). If a sketch contains less than 16 primitives, then it is padded with null primitives which are represented by the “none” node type (Section 2, line 104). Each sketch is given by a matrix, where each row represents a primitive (Section 2, line 110).  \n5. Brepgen reference missing  \n   1. Thank you for letting us know, we will include this in our final paper, as we reworked our related work section to be more comprehensive.", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "yes", "theoretical_claims": "I checked the Gaussian-Softmax Diffusion Derivation in the supplementary. There is no issue as far as I know.", "experimental_designs_or_analyses": "yes", "relation_to_broader_scientific_literature": "The key contribution of the proposed method is its potential to address the challenges posed by heterogeneous and unordered primitives in CAD sketches.", "essential_references_not_discussed": "\"Brepgen: A b-rep generative diffusion model with structured latent geometry\" is also a CAD(Brep) generation paper using a diffusion-based generative model.", "other_strengths_and_weaknesses": "Strengths:\n1. Writing is clear and easy to follow.\n2. Experimental analysis is well-presented.\n\nWeakness:\n1. No qualitative comparison with other methods.\n2. No failure case analysis.\n3. In the ablation study,  SketchDNN (Cat.) is trained using categorical diffusion. Does this involve quantizing continuous parameters to make them discrete? This detail is unclear.\n4. The number of primitives varies for each sketch. The paper does not explain how the number of primitives is determined during testing or how the data is prepared during training.", "other_comments_or_suggestions": "1. More qualitative results would be better.", "questions_for_authors": "See Strengths and Weaknesses.", "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": "Gp0kei0HEP", "reviewer": "Reviewer_5qBS", "summary": "Authors proposed a diffusion-based generative model for 2D CAD engineering drawings of parametric primitives. Main contributions include the use of Gaussian-softmax to unify discrete and continuous parameters, which works well for a modified diffusion model without positional encoding. And also a superposition data representation that joins the parameters from different types of parameters all in one. Results are reported for SketchGraphs where the generation quality are better compared to baselines.", "questions": "", "limitations": "", "rating": 2, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "1. Line 108: “we propose the first diffusion-based generative model for parametric CAD sketches”.  \n   1. Sorry, you are right, what we meant to write was “the first ‘sketch space’/’data space’ diffusion-based generative model for parametric CAD sketches.\n2. No closest-retrieval results to demonstrate the model is not overfitting to the training set.  \n   1. None of our baselines performed a closest-retrieval analysis to demonstrate the model is overfitting, so we saw no need to do it as well. Furthermore, we instead provided precision and recall scores since they are widely used. If need be, we can present the training and validation loss to show our model is unlikely to have overfit.\n3. Vitruvion (table 1\\) is not the same as those reported in the original paper.  \n   1. Our deduplication procedure is slightly different from Vitruvion’s, where we quantize the continuous parameters to 8-bits rather than 6-bits, this was to avoid placing somewhat similar sketches into the same bin. Secondly, since our model is permutation invariant, we sorted the rows in the sketch matrix to a canonical ordering. This was done to avoid sketches with identical geometry but differing orderings from being labeled as nonidentical. As a result, our dataset differed from that used in the original Vitruvion paper, so retraining Vitruvion with our dataset yielded the scores we present in the paper. We will put this in refined paper.  \n4. Constraints are removed for simplicity, making the paper have a limited impact.  \n   1. This is not as large of an issue as there are auto constraining models, for instance in Vitruvion, primitives are generated first, then constraints are filled in between them. Even though our method generates primitives, it can be coupled with “off-the-shelf” auto constraining models to create full fledged sketches. We will discuss this in the refined paper.  \n5. Data representation is similar to DeepCAD and Vitruvion without too many modifications.  \n   1. The similarities between our data representation and DeepCAD/Vitruvion lies in the fact that we choose similar attributes to define the parameters of primitives. Even then, our work encodes “Arc” primitives in a different manner to DeepCAD/Vitruvion. Furthermore, Vitruvion tokenizes primitive parameters into a series of value, id, and position tokens which we don’t do. As for DeepCAD, we don’t quantize continuous parameters and we also allow constructible primitives unlike DeepCAD.  \n6. What is the inference speed compared to autoregressive baselines?  \n   1. The inference speed is much slower, since we chose T \\= 2000\\. Our model takes \\~30s to generate a sketch whereas Vitruvion takes \\~3-5s. However, we believe that future work can reduce this discrepancy by perhaps borrowing from preexisting methods used in standard gaussian diffusion.  \n7. Since the parameters are superpositioned, then the correct primitive type can be determined by looking at which parameters is valid after denoising, is discrete primitive type class even required?  \n   1. The primitive type is needed to determine what parameters are valid at the end of the generation, since all parameter values between \\-1 and 1 are valid. Furthermore, the primitive type is needed in the reverse process/inference to downweight irrelevant parameters (Section 5.2, line 319). Without explicitly using the primitive type, because of superposition, all continuous parameters may be valid and it wouldn’t be straightforward to select one primitive type over another.  \n8. How does this approach compared to other methods that jointly denoise continous and discrete values (specifically House diffusion)\n   1. In House diffusion, discrete variables are mapped to continuous space, where the gaussian diffusion process occurs. Only gaussian diffusion is being performed, no diffusion is occurring in discrete space. For t \\< 20, the model outputs a binary representation that gets mapped back to a continuous value where gaussian denoising occurs. This is not related to performing diffusion in discrete space for discrete variables and in continuous space for continuous variables concurrently.   \n9. Brepgen reference for permutation invariance missing  \n   1. Thank you for letting us know, we have rectified this in our refined paper.  \n10. References missing  \n    1. We have expanded on the related works section in our refined paper.  \n        *Diffusion-CAD paper was published on Jan 29, 2025 which is a day before this paper was submitted.*  \n11. “For that, I am expecting to see a comparison where different primitives are separated into different tokens, with only parameters related to that primitive type included.”  \n    1. I’m confused as to what you’re asking here. What difference does it make whether irrelevant parameters are zeroed out or not included? Passing either into a linear layer, will only add up the contributions of the nonzero entries. Which is exactly the case for our categorical diffusion ablation study.", "claims_and_evidence": "Line 108: “we propose the first diffusion-based generative model for parametric CAD sketches” --- This is inaccurate, there is already existing works that apply diffusion model to generate CAD sketches. E.g “Diffusion-CAD: Controllable Diffusion Model for Generating Computer-Aided Design Models”, they generate both the CAD sketches and also the extrusion parameters that turn it into a CAD model. Similarly, there is also \"VQ-CAD: Computer-Aided Design model generation with vector quantized diffusion\".", "methods_and_evaluation_criteria": "Paper has no novel and uniqueness scores, which is common in CAD generation. Also no closest-retrieval results to demonstrate model is not overfitting to training set (something like fig 6 in Neural Wavelet-domain Diffusion for 3D Shape Generation will be nice to have).", "theoretical_claims": "Derivation for Gaussian-softmax seems correct.", "experimental_designs_or_analyses": "Baseline resutls from Vitruvion (table 1) is not the same as those reported in the original paper. I believe setting is the same, 16-max primitives. But fig 5 in Vitruvion reports better performance of 6.35 (per primitives) and 66.6 (per sketch). \n\n\nAnalysis for the benfit of superposition (line 339-344) also lacks proper support. SketchDNN (Cat) used discrete diffusion and in theory should be much worse than continous diffusion. I am not surprised about the results. However this is not a valid proof that superposition mechanism is a key factor for performance. For that, I am expecting to see a comparision where different primitives are seperated into different tokens, with only parameters related to that primitive type included.", "relation_to_broader_scientific_literature": "Automatically generating CAD engineering drawings is an interesting topic. Although this paper has somewhat limited impact in the CAD community as it removes the constraints for simplicity.", "essential_references_not_discussed": "Related work section is too short and does not cover previous works.  Missing citations for sketch-and-extrude CAD generation:\n\n1) Diffusion-CAD: Controllable Diffusion Model for Generating Computer-Aided Design Models\n\n2) VQ-CAD: Computer-Aided Design model generation with vector quantized diffusion\n\n3) SkexGen: Autoregressive Generation of CAD Construction Sequences with Disentangled Codebooks\n\n\nAlso missing citations of discrete and continuous diffusion for CAD-related or vector-like data:\n\n4) HouseDiffusion: Vector Floorplan Generation via a Diffusion Model with Discrete and Continuous Denoising\n\n5) CoLay: Controllable Layout Generation through Multi-conditional Latent Diffusion\n\n6) PLay: Parametrically Conditioned Layout Generation using Latent Diffusion\n\n\nFinally removing the positional encoding in CAD generation has already be done in BrepGen and shown to address the permutation invariant nature of CAD models (section 6.3). This should also be properly acknowledged. \n\n7) BrepGen: A B-rep Generative Diffusion Model with Structured Latent Geometry", "other_strengths_and_weaknesses": "Data representation is similar to DeepCAD and Vitruvion without too many modifications, but the Gaussian-Softmax that joins discrete and continuous diffusion is interesting and clearly demonstrates its advantage compared to discrete diffusion. \n\n\nOverall, paper is well written and easy to follow. Results are demonstrated on the large-scale SketchGraphs dataset. Related work section definitely needs more work to be done. There are also some over-claims or unsupported analysis in the paper (see my comments above). \n\nIn terms of results, I hope authors can clarify the number reported for vitruvion baseline and add the novel/unique metrics which show that model is not overfitting. \n\nThe lack of constraints in the output is also a major disadvantage of this aproach. Usually autoregressive model or pointer network are more suitable for generating the constraints. It is much more difficult for diffusion models to represent inter-relations with fixed-length parameters.", "other_comments_or_suggestions": "Minor type Line 380 state-of-the-art (SOA)  -> SOTA", "questions_for_authors": "1) What is the inference speed compared to autoregressive baselines?\n2) Since the parameters are superpositioned, then the correct primitive type can be determined by looking at which parameters is valid after denoising, is discrete primitive type class even required? \n3) How does this approach compared to other methods that jointly denoise continous and discrete values? There are many baseline diffusion methods that authors did not compared against. A very related one is House Diffusion in which discrete parameter was represented as binary hash code.", "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": "om1XhH1Awn", "reviewer": "Reviewer_c8Zn", "summary": "The paper proposes a diffusion based CAD sketch generation framework using a mixture of continuous and discrete diffusion. Technically, it introduces Gaussian-softmax diffusion, which is able to model categorical distributions with diffusion models. The paper provides a detailed theoretical derivation for their proposed Gaussian softmax diffusion and shows its effectiveness in generating CAD sketches. Experimentally, the paper shows state-of-the-art CAD generation results compared to baselines.\n\n## Post Rebuttal\nI appreciate the authors' rebuttal addressing many of my concerns. I'd like to keep my rating as it is. The main concern I have is still the usability of the method given that it doesn't support any kinds of controllable generation. Thus, a discussion on this front would be great to be included in the final revised edition.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "1. While this claim is supported by the paper's superior CAD sketch generation results compared to baselines quantitatively, it would be great to also see qualitative examples compared with the baselines.  \n   1. We have a qualitative analysis written and ready for the final paper. However, we only compare ours against Vitruvion, as other prior arts like SketchGen don’t have published code. We chose not to do a qualitative analysis against Sketchgraphs since Vitruvion is a follow up work to it.  \n2. The paper also claims that its Gaussian-softmax diffusion works better than categorical diffusion. An ablation study comparing the two would be good to have.  \n   1. We do an ablation study see SketchDNN (Cat.) in Table 1 and Table 2\\. Which is our SketchDNN model but just using methodology set by Hoogeboom et al. in “Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions” which doesn’t allow for superposition.  \n3. While it's standard to limit the number of primitives to below 16, I'm curious to see the scalability of this method when the number of primitives increases.  \n   1. Since the backbone of our model is essentially just the DiT model by Peebles & Xie, it has the same scaling laws as that of DiT.  \n4. Furthermore, I'm a little puzzled by the independence assumption in the reverse process of the diffusion. The decomposition in Eq.13-14 assumes the independence of each primitive during the forward and reverse processes. Then does that mean the denoising process of each primitive is independent from each other? Then, it would become a primitive generation rather than a sketch generation.  \n   1. The primitives can only be independently noised and denoised when given the ground truth or model prediction of the noiseless CAD sketch. The noiseless CAD sketch is just like the noise prediction in image diffusion models, which also denoise each pixel independently.  \n5. Further, it's unclear how we can use the model for downstream tasks, since it lacks any type of control.  \n   1. You are correct, we do not show conditional generation. Perhaps we used the wrong terminology, this will be fixed in the refined paper. What we meant was that the primitives generated by our model can be outfitted with constraints using an auto constrain model and then be parsed into Onshape.", "claims_and_evidence": "The paper proposes a novel diffusion process with Gaussian-softmax diffusion. Using it, the paper is able to generate state-of-the-art CAD sketches that contain both continuous and discrete parameters. While this claim is supported by the paper's superior CAD sketch generation results compared to baselines quantitatively, it would be great to also see qualitative examples compared with the baselines. \n\nFurther, the paper also claims that its Gaussian-softmax diffusion works better than categorical diffusion. An ablation study comparing the two would be good to have.", "methods_and_evaluation_criteria": "The paper's usage of Gaussian-softmax diffusion is convincing for the task of CAD sketch generation. The paper also uses an existing dataset with standard generation metrics. I would appreciate a more qualitative comparison with existing methods. \n\nWhile it's standard to limit the number of primitives to below 16, I'm curious to see the scalability of this method when the number of primitives increases.  \n\nFurthermore, I'm a little puzzled by the independence assumption in the reverse process of the diffusion. The decomposition in Eq.13-14 assumes the independence of each primitive during the forward and reverse processes. Then does that mean the denoising process of each primitive is independent from each other? Then, it would become a primitive generation rather than a sketch generation.", "theoretical_claims": "The paper provides an extensive set of derivations for their Gaussian-softmax diffusion process. The math looks convincing, but I didn't look into the details too carefully.", "experimental_designs_or_analyses": "The paper uses a standard dataset following the existing data pre-processing scheme. The paper only presents unconditional generation results, and lack qualitative comparisons with existing baselines. Further, it's unclear how can we use the model for downstream tasks, since it lacks any type of control", "relation_to_broader_scientific_literature": "The paper provides a novel diffusion formulation using Gaussian Softmax distributions. It's a good extension to the current diffusion model literation in terms of modeling categorical distributions.", "essential_references_not_discussed": "N/A", "other_strengths_and_weaknesses": "THe paper is techically sound with validations backing up the theoretical innovations. I don't have any additional weaknesses besides things I listed above.", "other_comments_or_suggestions": "Ln.113 departure -> depart.", "questions_for_authors": "I have listed my questions in the previous sections. Specifically, I would like to see \n1. More qualitative results compared with baselines. \n2. Clarification on the independence assumption among primitives during the denoising process. \n3. Discussion on the scalability of the method when increasing the number of primitives modeled.", "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:

Meta-review: Three reviews were submitted. One reviewer provided minimal feedback and was given small weight in the final decision. Among the remaining two, one gave a Weak Accept and the other a Weak Reject.

The paper introduces a continuous-discrete diffusion process (Gaussian-Softmax) for CAD sketch generation. This was recognized as a sound contribution. The rebuttal addressed concerns about discrepancies in baseline reproduction (Vitruvion) with a reasonable explanation.

The lack of constraint modeling remains a valid concern, but was not deemed strong enough on its own to warrant rejection. Overall, the contribution is clear, and the decision is accept.
Decision: Accept (poster)