Fudan's FutureCAD Slashes Invalid 3D Design Errors from 47% to 1%
A new framework fuses LLM code generation with a B-Rep grounding transformer so text prompts can produce industrial-grade CAD with fillets, chamfers, and shells.
ProTakeaways
- FutureCAD unifies LLM CadQuery generation with a B-Rep grounding transformer for fillets, chamfers, and shells. Paper
- BRepGround uses UV-Net plus BERT with cross-attention to map text queries to specific faces and edges.
- New 140k real-world CAD dataset from ABC/Onshape, with 28k models using advanced operations.
- Qwen2.5-7B trained via SFT then GSPO reinforcement learning with Chamfer Distance rewards.
- Invalidity ratio drops from around 47% to 1.01% on the advanced subset versus retrained baselines.
- Code and dataset released on GitHub; ICML 2026 accepted.
Text-to-CAD has been stuck in an awkward split for years. You either generate a parametric construction history (interpretable, editable, but no way to reference a specific edge or face) or you synthesize a boundary representation directly (great geometry, no design intent, hard to reuse). A new paper from Fudan University and Shanghai Jiao Tong called FutureCAD tries to close that gap by letting an LLM write executable CadQuery code and, when a feature like a fillet needs to point at a specific edge, emit a natural-language query that a dedicated grounding transformer resolves against the live B-Rep.
Why parametric and B-Rep can't stay in separate lanes
In a real feature-based CAD workflow, the two representations are entangled. Advanced parametric operations such as fillet and chamfer require explicit selection of B-Rep geometric primitives, and the B-Rep itself is derived from parametric operations. That means to fillet the four vertical edges of a bracket, you have to name those edges, but those edges only exist after earlier extrudes and cuts have executed. Previous learning-based systems have side-stepped this by supporting only sketch and extrude, which is why so many text-to-CAD demos look like stacked prisms rather than actual manufactured parts.
FutureCAD frames the CAD model as a sequence of features where each feature is a tuple of operation type, parameters, and optionally a set of referenced primitives that must be resolved from the transient B-Rep state at execution time. The LLM writes the program; a second model resolves the references at runtime.

The trick: natural-language selectors inside CadQuery
The core mechanic is a text query embedded directly in generated code. Instead of predicting index numbers for faces or edges (which change every time an upstream operation modifies the geometry), the LLM writes something like:
filletQ(cq.Query("All circular holes on the surface."), radius=0.25)
At runtime, the extended CadQuery interpreter hands that string, along with the current B-Rep state, to BRepGround, a transformer that returns the actual set of faces or edges to modify. This plays to what LLMs are already good at: writing Python and describing geometry in words, rather than tracking a mutating index space they can't see.
Inside BRepGround
BRepGround is a multimodal encoder-fusion model. The B-Rep encoder uses UV-Net to extract face and edge features, passing them through a GNN and adaptive layer to produce primitive embeddings, while the text encoder uses pretrained BERT. A fusion stack then interleaves self-attention over B-Rep tokens with cross-attention where those tokens query the text embeddings, and an MLP head predicts a binary score for each face and edge.

Training pairs are mined from feature operations in the dataset that carry non-empty primitive references, with Claude 4.5 used to synthesize the textual descriptions that refer to those target primitives. A weighted binary cross-entropy loss handles the fact that any given query usually selects only a small fraction of the primitives in a scene.
A dataset that isn't just DeepCAD again
Most prior text-to-CAD work benchmarks on DeepCAD, which is almost entirely simple sketch-and-extrude shapes. The authors built a new corpus of roughly 140k real-world CAD models parsed from the ABC dataset via Onshape's FeatureScript and developer API, supporting sketch, extrude, revolve, fillet, chamfer, and shell. About 28k of those entries use advanced features. Each model is annotated with two levels of natural-language descriptions, an abstract one summarizing overall structure and a detailed one that captures dimensions and scale, generated jointly from renders and the CadQuery source to avoid the information leakage problems earlier work ran into when feeding raw sequences to a captioner.

They also rewrite each procedurally converted program using Claude 4.5 prompted with the CadQuery docs, then validate the rewrites by executing them and comparing rendered images, yielding roughly 80k additional samples with more idiomatic API usage.
Two-stage training with a geometric reward
The LLM backbone is Qwen2.5-7B-Instruct, trained in two phases:
- Supervised fine-tuning for 3 epochs at a 1e-5 learning rate on the paired description-to-CadQuery data, using standard causal LM loss.
- Reinforcement learning with Group Sequence Policy Optimization (GSPO), a sequence-level cousin of GRPO that computes importance ratios and clipping over whole responses rather than individual tokens. Eight candidate programs are sampled per prompt during rollout.
The reward is geometric: execute each sampled program, sample point clouds from the resulting solid and the ground truth, compute Chamfer Distance, and map it linearly into a [0, 1] score with tolerance t = 0.2. Programs that fail to execute get a reward of zero, which is what drives the invalidity rate down.
Results: the invalidity ratio is where it wins
The command-level F1 scores are competitive but not dramatically higher than CADFusion or CAD-LLaMA. The real story is validity and geometric fidelity on the advanced subset:
| Method | G-F1 | Median CD | Invalidity Ratio |
|---|---|---|---|
| CADFusion (extended) | 79.02 | 54.14 | 50.60% |
| CAD-LLaMA (extended) | 80.05 | 50.16 | 46.60% |
| FutureCAD | 80.54 | 31.12 | 1.01% |
Dropping the invalid rate from around 47% to 1% on models with fillets, chamfers, and shells is the headline. On the out-of-distribution Fusion360 test set, median Chamfer Distance drops from roughly 39 to 17, suggesting the RL stage is genuinely teaching parameter precision rather than memorizing the training distribution.
An ablation confirms both pieces matter. SFT alone leaves the model with a 42.67% invalid rate; adding RL but replacing BRepGround with point-based nearest-neighbor primitive selection drops it to 8.29%; the full system with semantic grounding gets to 1.01% with the best CD as well.
Where it still breaks
The failure mode gallery is honest about the limits:
- Spatial misalignment. Primitives are generated in the wrong relative positions, reflecting that LLMs remain shaky at precise 3D spatial reasoning.
- Missing refinement details. Fillets called out in the prompt sometimes get dropped, likely because refinement-related primitives are a minority class in the grounding data.
- Text-model inconsistency. The generated geometry occasionally contradicts explicit spatial descriptions in the input.
Getting it
Code and dataset are on GitHub, with the 140k-model corpus hosted on Google Drive. The paper has also been accepted to ICML. If you're building anything that generates manufacturable parts rather than decorative meshes, the grounded-selector pattern is worth studying regardless of whether you use their weights: it's a clean way to bridge a language model's symbolic output with a geometry kernel's stateful, index-shifting reality.