Design-Specification Tiling for ICL-based CAD Code Generation
A new algorithm selects training examples to cover 100% of a design's requirements, improving AI-generated CAD code.
A team of researchers has developed a novel method called Design-Specification Tiling (DST) to solve a key bottleneck in using large language models (LLMs) for generating Computer-Aided Design (CAD) code. LLMs like GPT-4 often struggle with specialized domains like CAD due to scarce training data. The standard workaround, In-Context Learning (ICL), involves providing the model with relevant examples, but current strategies for picking those examples are flawed—they either pick similar but redundant examples or diverse ones that miss crucial design requirements.
DST introduces 'knowledge sufficiency' as a core objective. It works by breaking down a target CAD design specification into its multi-granular components (like shapes, constraints, and operations). The algorithm then selects a set of example designs from a database that maximally 'tile' or cover all these components. The researchers proved this is a submodular optimization problem and provided an efficient greedy algorithm with a strong (1-1/e) approximation guarantee, meaning it gets very close to the optimal solution.
Extensive experiments show that DST consistently and substantially outperforms existing exemplar selection strategies for ICL in CAD code generation. By ensuring the selected examples collectively satisfy all aspects of the design query, the method leads to higher-quality, more accurate code output from the LLM. This is a significant step toward making AI a reliable tool for engineers and designers in technical domains where data is limited but precision is critical.
- Proposes 'knowledge sufficiency' as a new objective for selecting examples in In-Context Learning (ICL), moving beyond simple similarity or diversity.
- The DST algorithm quantifies this by calculating a 'tiling ratio'—the proportion of a query's design components covered by selected exemplars.
- Provides a polynomial-time greedy algorithm with a (1-1/e) performance guarantee, proven to substantially improve CAD code generation quality in tests.
Why It Matters
Enables more reliable AI assistants for engineers by significantly improving code generation for specialized, data-scarce domains like CAD.