Design-Specification Tiling for ICL-based CAD Code Generation

📅 2026-03-13
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Large language models face significant limitations in specialized domains such as CAD code generation due to scarce training data, and existing in-context learning (ICL) approaches struggle to select examples that adequately satisfy the compositional requirements of complex design specifications. This work introduces “knowledge sufficiency” as a novel optimization objective for ICL example selection and proposes the Design Specification Tiling (DST) method. DST extracts design components at multiple granularities, quantifies the coverage of candidate examples relative to the query’s requirements via a tiling ratio, and formulates the selection problem as a submodular maximization task, for which a theoretically grounded greedy algorithm is developed. Experimental results demonstrate that DST substantially outperforms existing strategies, significantly improving both the quality and specification compliance of the generated code.

Technology Category

Application Category

📝 Abstract
Large language models (LLMs) have demonstrated remarkable capabilities in code generation, yet they underperform on domain-specific tasks such as Computer-Aided Design (CAD) code generation due to scarce training data. In-Context Learning (ICL) offers a training-free alternative through task-specific exemplars. However, existing selection strategies prioritize similarity or point-wise diversity, often producing redundant selections that fail to satisfy the compositional requirements of complex CAD design specifications. In this work, we propose knowledge sufficiency as a principled objective for exemplar selection that aims to maximally satisfy all requirements within design specifications. To realize this objective, we introduce Design-Specification Tiling (DST), which quantifies knowledge sufficiency through a surrogate tiling ratio by extracting multi-granular design components and measuring the proportion of query components covered by selected exemplars. We demonstrate that maximizing this objective constitutes submodular maximization and provide a polynomial-time greedy algorithm with a (1-1/e)-approximation guarantee. Extensive experiments demonstrate that DST substantially improves CAD code generation quality, consistently outperforming existing exemplar selection strategies in ICL.
Problem

Research questions and friction points this paper is trying to address.

CAD code generation
In-Context Learning
exemplar selection
design specification
compositional requirements
Innovation

Methods, ideas, or system contributions that make the work stand out.

Design-Specification Tiling
In-Context Learning
Knowledge Sufficiency
Submodular Maximization
CAD Code Generation
🔎 Similar Papers
No similar papers found.