🤖 AI Summary
Large language models (LLMs) struggle with spatial reasoning and long-horizon planning in CAD program generation, often producing non-executable or geometrically inconsistent code. To address this, we propose AIDL—a solver-augmented, hierarchical domain-specific language—where symbolic spatial reasoning is delegated to a geometric constraint solver, while the LLM focuses exclusively on high-level structural planning and DSL code synthesis. Our architecture uniquely integrates few-shot prompting, program synthesis, formal verification, and visual consistency evaluation. Experiments demonstrate that AIDL significantly outperforms baselines such as OpenSCAD under few-shot settings, achieving substantial improvements in semantic fidelity, syntactic correctness, human editability, and support for downstream analysis tasks. This work establishes a novel paradigm for reliable, LLM-driven CAD generation grounded in rigorous geometric reasoning and verifiable program synthesis.
📝 Abstract
Large language models (LLMs) have been enormously successful in solving a wide variety of structured and unstructured generative tasks, but they struggle to generate procedural geometry in Computer Aided Design (CAD). These difficulties arise from an inability to do spatial reasoning and the necessity to guide a model through complex, long range planning to generate complex geometry. We enable generative CAD Design with LLMs through the introduction of a solver-aided, hierarchical domain specific language (DSL) called AIDL, which offloads the spatial reasoning requirements to a geometric constraint solver. Additionally, we show that in the few-shot regime, AIDL outperforms even a language with in-training data (OpenSCAD), both in terms of generating visual results closer to the prompt and creating objects that are easier to post-process and reason about.