Mamba-CAD: State Space Model for 3D Computer-Aided Design Generative Modeling

Xueyang Li, Yunzhong Lou, Yu Song, Xiangdong Zhou

TL;DR

Mamba-CAD introduces a State Space Model (SSM) architecture to generate complex 3D CAD models by handling significantly longer command sequences than previous Transformer-based methods. By combining a Mamba-based autoencoder with a Latent GAN, it achieves state-of-the-art results in reconstructing and generating intricate, industrial-grade CAD geometry.

What Problem Does This Paper Address?

In the world of Computer-Aided Design (CAD), 3D objects aren't just collections of pixels or points; they are "recipes" known as parametric CAD sequences. These sequences consist of a series of commands (like "draw a circle" or "extrude this shape") that define the design logic.

While recent research has used Transformer-based models to generate these sequences, they face a major bottleneck: complexity. Industrial-grade parts are fine-grained and require very long sequences of commands to define. Transformers, which have a quadratic computational complexity relative to sequence length, struggle to model these long-range dependencies efficiently. Consequently, existing models are often limited to generating simple, "toy-like" shapes. Mamba-CAD aims to bridge this gap by enabling the generation of much longer, more complex design sequences.

Methods

The authors move away from the standard Transformer architecture in favor of Mamba, a Selective State Space Model (SSM). Mamba is designed to handle long sequences with linear scaling, making it computationally superior for the "long-form" design logic found in industrial CAD.

The framework operates in three distinct stages:

  1. Representation: CAD commands and their parameters (coordinates, radii, extrusion heights) are discretized and embedded into a unified vector space, treating CAD design like a specialized language.
  2. Self-Supervised Pre-training: The authors design a Mamba-based encoder-decoder. The encoder compresses a CAD sequence into a compact latent representation, and the decoder learns to reconstruct the original sequence. This teaches the model the "grammar" of CAD.
  3. Generative Adversarial Training (Latent GAN): Once the autoencoder is trained, its parameters are frozen. A Generative Adversarial Network (GAN) is then trained to produce "fake" latent representations from random Gaussian noise. These fake representations are then passed through the Mamba decoder to "recover" entirely new, valid parametric CAD sequences.

Datasets

The researchers identified that existing benchmarks like DeepCAD (average sequence length of 15) were too simple for their goals. To push the boundaries, they introduced:

  • Mamba-CAD Dataset: A new collection of 77,078 CAD models derived from the ABC dataset. It features sequences up to 128 commands long with an average length of 38—significantly more complex than previous benchmarks.
  • DeepCAD: Used for baseline comparisons.
  • Fusion360 Gallery: Used to evaluate the model's generalization ability on unseen data.

Key Insights and Ideas

  • Mamba as a "CAD Language" Model: The paper treats CAD design as a sequential language. Because Mamba excels at capturing long-term dependencies in time-series and text, it is uniquely suited for the "design history" of a 3D object.
  • Linear Scaling is Key: By using SSMs instead of Attention mechanisms, the model avoids the memory explosion typical of Transformers when dealing with the 100+ command sequences required for industrial parts.
  • Latent Space Generation: Rather than generating sequences token-by-token (which can lead to "drift" and invalid geometry), generating in the latent space of a pre-trained encoder ensures that the resulting shapes maintain structural integrity.

Key Results

Mamba-CAD significantly outperformed Transformer-based baselines (like DeepCAD and HNC-CAD) across several metrics:

  • Reconstruction Accuracy: Achieved a command accuracy ($A_c$) of 99.96%, compared to 96.49% for the original DeepCAD model.
  • Geometric Fidelity: The Median Chamfer Distance (MCD)—a measure of how closely the generated shape matches the target—was reduced by nearly 80% compared to baselines.
  • Handling Complexity: For sequences longer than 60 commands, Mamba-CAD maintained an 85.18% validity rate, whereas DeepCAD dropped to roughly 51%.
  • Random Generation: In unconditioned generation, Mamba-CAD produced more "unique" and "novel" designs while maintaining higher geometric validity (Step Ratio of 74.13% vs. 62.76% for DeepCAD).

Limitations and Future Work

While a significant step forward, the authors acknowledge several limitations:

  • Command Vocabulary: The current model only supports basic primitives (lines, arcs, circles) and extrusions. It cannot yet handle complex curves like Bezier splines or common engineering features like "fillets" and "chamfers."
  • Unconditioned Generation: The current version generates shapes randomly. The authors suggest that future work should integrate other modalities, such as text-to-CAD or image-to-CAD, to make the generation process controllable for designers.
  • Representation Limits: The model focuses on Constructive Solid Geometry (CSG) and does not yet address Boundary Representation (BRep), which is another standard format in the CAD industry.

Summary updated

BibTeX
@inproceedings{li2025mamba,
  author = {Xueyang Li and Yunzhong Lou and Yu Song and Xiangdong Zhou},
  title = {{Mamba-CAD: State Space Model for 3D Computer-Aided Design Generative Modeling}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i5.32531},
}
Figure