让AI自动生成并优化CAD代码,通过执行后反馈改进设计。
RA-CAD: Learning Post-Execution Critique for State-Aware Text-to-CAD Generation

- 用生成-执行-批评-重写循环,让AI实时根据结果调整代码。
- 在两个数据集上,生成代码的准确率和几何质量都领先现有方法。
- 适合需要快速生成可编辑CAD模型的设计人员使用。
文本到CAD生成将自然语言设计意图转换为可编辑、可执行的参数化计算机辅助设计(CAD)代码,降低手动建模所需的专业知识与工作量。现有方法采用固定、外部提供或单独优化的批评机制来优化生成过程,但未能有效优化反馈的解读与修正动作的转化。为此,我们提出RA-CAD(用于CAD的ReAct Agent),一个状态感知智能体,通过生成-执行-批评-重写循环与CAD环境交互。每轮迭代中,RA-CAD执行当前代码并观察结果,基于设计指令、当前代码和执行反馈,生成显式的执行后批评作为中间策略动作。该批评可验证当前结果以终止流程,或提供修订导向指导以影响下一次重写。CAD代码预训练(CCB)通过监督微调建立基础参数化编码能力;反馈驱动智能体优化(FAO)随后应用轨迹级组相对策略优化,对策略生成的代码与批评序列进行优化,为完整交互轨迹赋予终端F1分数和切比雪夫距离奖励。这一设定使批评成为与结果对齐、可学习的策略决策,而非未优化的辅助输出。在CADFusion和Text2CAD数据集上的实验表明,RA-CAD在执行有效性与几何质量方面均优于现有方法及强大的专有语言模型,证明了所提状态感知文本到CAD智能体的有效性。
原文摘要 · Abstract (English)
Text-to-CAD generation translates natural-language design intent into editable and executable parametric computer-aided design (CAD) codes, reducing the expertise and effort required for manual modeling. Existing methods incorporate fixed, externally supplied, prompt-induced, or separately optimized critique mechanisms to optimize the generation process, but they do not necessarily optimize how feedback is interpreted and translated into effective corrective actions throughout the generation process. To bridge this feedback-utilization gap, we present RA-CAD (ReAct Agent for CAD), a state-aware agent that interacts with the CAD environment through a Generate--Execute--Critique--Rewrite loop. At each iteration, RA-CAD executes the current code and observes its outcome. Conditioned on the design instruction, current code, and execution feedback, the agent then generates an explicit post-execution critique as an intermediate policy action. This critique either validates the current result for termination or provides revision-oriented guidance that conditions the next rewrite. CAD Code Bootstrapping (CCB) first establishes fundamental parametric CAD coding capabilities through supervised fine-tuning. Feedback-Driven Agent Optimization (FAO) subsequently applies trajectory-level Group Relative Policy Optimization to both policy-generated code and critique sequences, assigning terminal F1 and Chamfer Distance rewards to the complete interaction trajectory. This formulation makes critique an outcome-aligned, learnable policy decision rather than an unoptimized auxiliary output. Experiments on CADFusion and Text2CAD show that RA-CAD achieves state-of-the-art execution validity and geometric quality compared with existing methods and strong proprietary language models, demonstrating the effectiveness of the proposed state-aware text-to-CAD agent.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。