TL;DR
HierCAD advances text-to-CAD generation by breaking down flat autoregressive sequence generation into a structured, hierarchical reasoning process. By separating global part operations from local loop topologies and introducing a novel structure-alignment and parameter-grounding strategy, it eliminates common structural drifts and geometric parameter errors found in standard large language models.
What Problem Does This Paper Address?
Generating 3D Computer-Aided Design (CAD) models directly from natural language text is a powerful capability for digital manufacturing and engineering. Recent approaches leverage large language models (LLMs) to generate CAD sequences (like JSON strings) autoregressively. However, treating CAD generation as a flat token stream entangles highly diverse information: object composition, loop topology, and continuous geometric parameters.
This entanglement causes two main failure modes:
- Structural inconsistency/drift over long-horizon tasks, where the model loses track of complex multi-part or multi-loop sketches.
- Fragile parameter prediction caused by "shortcut learning," where the LLM spuriously copies previously generated valid numbers (like coordinates or radii) instead of grounding them in the text description.
Methods
HierCAD introduces a hierarchical reformulation of the CAD construction tree and pairs it with a unified learning strategy called Structure Alignment and Parameter Grounding (SAPG):
- Hierarchical CAD Reasoning: Instead of a flat sequence, the CAD construction tree is disentangled into multiple layers. It uses a Chain-of-Thought (CoT) approach with two explicit trajectories: an object-level global procedural reasoning sequence (handling parts and Boolean operations like New, Join, Cut, Intersect) and a part-level local topology reasoning sequence (predicting loop primitives like lines, arcs, and circles).
- Structure Alignment Learning: To ensure the final parametric CAD sequence matches the planned topology, HierCAD aligns the hidden representations of the topology trajectory and the final parametric CAD spans using a cosine distance loss ($L_{struct}$).
- Parameter Grounding Learning: To stop the model from blindly copying numbers, the authors apply structure-preserving parameter perturbations (anisotropic scaling and translation) to create negative examples. A ranking-based margin loss ($L_{param}$) forces the model to prefer the true text-grounded parameters over these perturbed but structurally plausible alternatives.
Datasets
The authors evaluate HierCAD using the DeepCAD dataset, utilizing the Minimal JSON format from Text2CAD and expert-level natural language descriptions re-annotated by CADmium.
Key Insights and Ideas
- Decoupling Structure from Geometry: Forcing an LLM to explicitly plan what shapes and loops exist before committing to where they are located (coordinates) drastically reduces autoregressive ambiguity.
- The Danger of Numerical Shortcuts: Autoregressive models are lazy; if a coordinate like
0.3544or0.0appears frequently, the model will copy it across unrelated fields (inter-field confusion) or collapse distinct endpoints to the same value (intra-field collapse). - Contrastive Perturbation as a Cure: By intentionally distorting the geometry while keeping the topology intact, the ranking loss teaches the model to actually read the text prompt for dimensions rather than relying on statistical co-occurrences of numbers in the training data.
Key Results
HierCAD achieves state-of-the-art performance across both sequence generation and 3D model reconstruction metrics:
- Sequence Generation: It improves the Arc F1 score to 79.43% (compared to CADmium's 75.68%), showing its strength in complex curves.
- Model Validity: It reduces the Invalidity Ratio (IR) to 1.45% (down from CADmium's 4.12% and Text2CAD's 3.40%).
- Geometric Accuracy: Reconstructed models show superior geometric fidelity, achieving the best Chamfer Distance (CD mean of 35.22) and a Watertightness of 89.79%.
Limitations and Future Work
Not discussed in the paper. The authors note that their framework is a step toward more reliable CAD copilots for engineering applications but do not detail specific failure modes or limitations of HierCAD itself.
Summary updated