Target-Guided Bayesian Flow Networks for Quantitatively Constrained CAD Generation

Wenhao Zheng, Chenwei Sun, Wenbo Zhang, Jiancheng Lv, Xianggen Liu

Abstract: Deep generative models, such as diffusion models, have shown promising progress in image generation and audio generation via simplified continuity assumptions. However, the development of generative modeling techniques for generating multi-modal data, such as parametric CAD sequences, still lags behind due to the challenges in addressing long-range constraints and parameter sensitivity. In this work, we propose a novel framework for quantitatively constrained CAD generation, termed Target-Guided Bayesian Flow Network (TGBFN). For the first time, TGBFN handles the multi-modality of CAD sequences (i.e., discrete commands and continuous parameters) in a unified continuous and differentiable parameter space rather than in the discrete data space. In addition, TGBFN penetrates the parameter update kernel and introduces a guided Bayesian flow to control the CAD properties. To evaluate TGBFN, we construct a new dataset for quantitatively constrained CAD generation. Extensive comparisons across single-condition and multi-condition constrained generation tasks demonstrate that TGBFN achieves state-of-the-art performance in generating high-fidelity, condition-aware CAD sequences.

Introduction

In Computer-Aided Design (CAD), models are represented as parametric sequences—a combination of discrete commands (e.g., "extrude", "fillet") and continuous numerical parameters. Generating these sequences automatically presents significant challenges: "modality duality" (mixing discrete and continuous data) and extreme "parameter sensitivity," where minor errors in early steps lead to catastrophic geometric failures. While existing models focus on qualitative generation, real-world engineering requires quantitative constraints, such as specific surface areas or volumes.

Conceptual illustration of the TGBFN process showing conditional guidance and Bayesian inference.

Methodology: Target-Guided Bayesian Flow Networks (TGBFN)

To address these challenges, the authors propose TGBFN, a framework built on Bayesian Flow Networks (BFNs). Unlike standard diffusion models that add noise to data, BFNs model the parameters of the data's distribution. This allows for a unified, differentiable space for both discrete and continuous CAD tokens.

Detailed architecture of TGBFN, illustrating the training and sampling pipelines alongside the Bayesian Inference module.

The framework introduces three core innovations:

  • Unbiased Bayesian Inference (UBI): Stabilizes generation by using parallel sampling paths to mitigate "exposure bias," where errors accumulate over long sequences.
  • Guided Bayesian Flow (GBF): A modular "Guidance Network" that steers the generation process toward specific physical targets (e.g., target volume) without retraining the base model.
  • Calibrated Distribution Estimation (CDE): Refines the conversion from internal continuous distributions back to discrete CAD commands, reducing output coarseness.

Dataset and Evaluation

The researchers constructed a new benchmark by augmenting the DeepCAD dataset (approx. 178k models). Using B-Rep analysis via the PythonOCC library, they calculated exact surface areas ($A$) and volumes ($V$) for each model, resulting in a curated dataset of 68,219 training instances pairing CAD sequences with physical properties.

Key Results

TGBFN demonstrates state-of-the-art performance in quantitatively constrained generation:

  • High Precision: In multi-condition tasks, TGBFN achieved a Mean Squared Error (MSE) of 0.4235 for area, significantly lower than standard BFN (1.1745) and DeepCAD baselines (12.708).
  • Strong Alignment: The Pearson Correlation Coefficient (PCC) reached 0.95–0.96, indicating that generated models' physical properties closely match user-defined constraints.
  • Efficiency: The UBI module reduced MSE by 75.6% with only a 5.7% increase in memory usage, proving the effectiveness of parallel sampling in fixing exposure bias.

Conclusion

TGBFN represents a significant advancement in CAD generation by enabling precise numerical control over geometric properties. By unifying discrete and continuous data in a Bayesian framework, it paves the way for automated engineering design that meets rigorous manufacturing requirements. Future work aims to extend this to more complex constraints like structural stress and longer assembly sequences.

Summary updated

Abstract

Deep generative models, such as diffusion models, have shown promising progress in image generation and audio generation via simplified continuity assumptions. However, the development of generative modeling techniques for generating multi-modal data, such as parametric CAD sequences, still lags behind due to the challenges in addressing long-range constraints and parameter sensitivity. In this work, we propose a novel framework for quantitatively constrained CAD generation, termed Target-Guided Bayesian Flow Network (TGBFN). For the first time, TGBFN handles the multi-modality of CAD sequences (i.e., discrete commands and continuous parameters) in a unified continuous and differentiable parameter space rather than in the discrete data space. In addition, TGBFN penetrates the parameter update kernel and introduces a guided Bayesian flow to control the CAD properties. To evaluate TGBFN, we construct a new dataset for quantitatively constrained CAD generation. Extensive comparisons across single-condition and multi-condition constrained generation tasks demonstrate that TGBFN achieves state-of-the-art performance in generating high-fidelity, condition-aware CAD sequences. The code is available at https://github.com/scu-zwh/TGBFN.
BibTeX
@misc{zheng2025target,
  author = {Wenhao Zheng and Chenwei Sun and Wenbo Zhang and Jiancheng Lv and Xianggen Liu},
  title = {{Target-Guided Bayesian Flow Networks for Quantitatively Constrained CAD Generation}},
  year = {2025},
  eprint = {2510.25163},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.25163},
}
Figure