CADiff: Scaffold First, Denoise the Rest for CAD Program Generation
Abstract
Natural-language-to-CadQuery generation requires a model to produce executable programs whose parameters, feature implementations, and build logic remain consistent across distant code regions. Existing autoregressive methods resolve these decisions sequentially according to token order, while generic diffusion models jointly denoise program organization and implementation in the same masked space. We identify this mismatch between token-level uncertainty resolution and the different scopes of CAD construction decisions as the construction-level abstraction gap. To address it, we propose CADiff, a construction-first diffusion framework that resolves shared program organization before concrete implementation. CADiff first predicts a compact construction layout containing interface-level structure and implementation-span capacities, renders it into an anchored program canvas, and then performs anchor-aware bidirectional denoising over the remaining code. We further introduce CADConstruct, a construction-aware benchmark with dimension-grounded requirements, executable CadQuery programs, and explicit construction structure. Across easy, medium, and hard subsets, CADiff consistently outperforms strong autoregressive and diffusion-based baselines in executability, feature recovery, and geometric fidelity, with its advantage increasing on more complex programs. Ablations support the complementary roles of layout conditioning and dependency-aware denoising, while Stage-I diagnostics show over 98% canvas validity and budget coverage. Zero-shot evaluation on ExeCAD further demonstrates improved cross-dataset transfer over CADConstruct-trained baselines.
est. 32% chance this paper gets accepted at ICLR 2027.
What do you think this paper will get?
All positions stay anonymous.