Learning Hierarchical and Geometry-Aware Graph Representations for Text-to-CAD

Shengjie Gong, Wenjie Peng, Hongyuan Chen, Gangyu Zhang, Yunqing Hu, Huiyuan Zhang, Shuangping Huang, Tianshui Chen

TL;DR

Generating complex 3D CAD models from text is notoriously difficult because a single error in a long sequence of code can ruin an entire assembly. This paper introduces Graph-CAD, a framework that replaces "flat" text-to-code generation with a three-stage process centered around a hierarchical, geometry-aware graph. By predicting the object's structure and constraints before writing a single line of code, and using a novel "progressive curriculum" to push its own limits, Graph-CAD achieves state-of-the-art results in structural integrity and geometric accuracy.

The Challenge of Text-to-CAD

Computer-Aided Design (CAD) is the backbone of modern manufacturing, but it usually requires professional expertise. "Text-to-CAD" aims to lower this barrier by allowing users to describe objects in natural language and automatically generating the corresponding 3D models.

However, current state-of-the-art methods treat this as a direct translation task: Text $\rightarrow$ Python Code (specifically Blender’s bpy API). This is a "long-horizon" task where errors compound. If a Large Language Model (LLM) miscalculates the coordinates for a table's base in line 5, the legs generated in line 50 will be floating in mid-air. These "flat" models lack an explicit understanding of assembly hierarchy (how parts relate to the whole) and geometric constraints (how parts must touch or align).

The Graph-CAD Framework

To address the cascading failures of flat decoding, the authors propose a modular, three-stage inference pipeline called Graph-CAD.

The three-stage Graph-CAD inference pipeline
  1. Geometry Decomposition: The model first transforms the text into a Geometric Decomposition Graph. Nodes represent parts (e.g., "tabletop," "leg"), and edges represent explicit constraints (e.g., "align bottom of leg to top of floor").
  2. Action Planning: The graph is parsed into a logical sequence of CAD operations. This step determines the "build order" to ensure dependencies are respected.
  3. Code Generation: Finally, the planned actions are translated into executable bpy code.

Pushing Limits with SAPCL

To train this system effectively, the researchers introduce Structure-Aware Progressive Curriculum Learning (SAPCL).

Structure-Aware Progressive Curriculum Learning (SAPCL) framework

Instead of training on a static dataset, the model enters an iterative loop designed to continuously expand its capabilities:

  • Exploration: An auxiliary LLM generates variants of existing tasks at three difficulty levels (Easy, Intermediate, Advanced).
  • Boundary Probing: The model is tested to find its "capability boundary"—the hardest level it can currently solve.
  • Synthesis: New training data is synthesized specifically at this boundary to challenge the model and expand its expertise.

Datasets and Evaluation

The researchers introduced BlendGeo, a new dataset containing 12,000 quadruplets: natural language instructions, geometric decomposition graphs, action sequences, and executable bpy code.

For evaluation, they utilized CADBench (both "Sim" and "Wild" versions), a public benchmark for text-to-CAD tasks. They also introduced new metrics to measure the "health" of the intermediate graphs: Node-Level Accuracy (NLA), Hierarchy-Level Accuracy (HLA), and Geometric Constraint Satisfaction (GCS).

Key Insights

  • The Graph as a Structural Prior: By forcing the model to commit to a high-level structure first, the search space for the final code is drastically narrowed. It’s the difference between "writing a story" and "following an outline."
  • Constraints Over Coordinates: Instead of guessing absolute XYZ coordinates, the model predicts relationships (e.g., "Face A touches Face B"). This is much more robust to small numerical errors.
  • Training at the "Edge": The SAPCL mechanism recognizes that not all data is equally useful. By identifying where the model starts to fail and generating "boundary examples," the authors significantly improved the model's ability to handle complex, multi-part assemblies.
  • Negative Transfer in Unified Models: The authors found that a single "do-it-all" model performed worse than their modular three-stage approach. They hypothesize that the different tasks (graph prediction vs. code syntax) interfere with each other during training.

Results

  • Superior Accuracy: Graph-CAD (using SAPCL) outperformed all baselines, including general-purpose giants like GPT-5 and Claude-4-1, on the CADBench benchmark.
  • Structural Integrity: The most significant gains were in Geometric Constraint Satisfaction (GCS). On the "Wild" dataset, Graph-CAD achieved a GCS of 0.8943, nearly doubling the performance of many end-to-end baselines.
  • Human Preference: In a blind study with 40 volunteers, Graph-CAD's outputs were preferred over 60% of the time for both visual appearance and geometric plausibility.
  • Ablation Success: Removing the graph decomposition stage led to a sharp drop in performance, confirming that the intermediate representation is the "secret sauce" of the framework.

Limitations and Future Work

While Graph-CAD represents a significant leap forward, it is not without limitations. The model still struggles with "organic" or extremely high-part-count objects, such as complex bicycles with many transmission parts. Additionally, because the process is multi-stage, it suffers from higher inference latency. Graph-CAD takes about 1.7 minutes per sample, whereas "flat" models are often sub-minute.

Future work will look into more efficient "blockwise" parallel decoding to reduce latency. The authors also suggest that as more powerful base LLMs and more diverse CAD datasets become available, the framework's performance on highly sophisticated designs will naturally scale.

Summary updated

BibTeX
@inproceedings{gong2026learning,
  author = {Shengjie Gong and Wenjie Peng and Hongyuan Chen and Gangyu Zhang and Yunqing Hu and Huiyuan Zhang and Shuangping Huang and Tianshui Chen},
  title = {{Learning Hierarchical and Geometry-Aware Graph Representations for Text-to-CAD}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=oKMomThD6n},
}
Figure