RA-CAD: Learning Post-Execution Critique for State-Aware Text-to-CAD Generation
Text-to-CAD generation aims to translate natural-language design instructions into editable, executable CAD code, but existing methods rely on fixed or externally supplied critique mechanisms that do not optimize how feedback is translated into corrective actions. RA-CAD (ReAct Agent for CAD) addresses this by introducing a state-aware agent that interacts with the CAD environment through a Generate--Execute--Critique--Rewrite loop. At each iteration, the agent executes the current code, observes the outcome, and generates an explicit post-execution critique as an intermediate policy action. This critique either validates the result for termination or provides revision-oriented guidance for the next rewrite.
The agent is trained in two phases: CAD Code Bootstrapping (CCB) first establishes fundamental parametric CAD coding capabilities via supervised fine-tuning, followed by Feedback-Driven Agent Optimization (FAO) which applies trajectory-level Group Relative Policy Optimization to both code and critique sequences. Terminal rewards based on F1 score and Chamfer Distance are assigned to the complete interaction trajectory, making critique an outcome-aligned, learnable policy decision rather than an unoptimized auxiliary output. Experiments on CADFusion and Text2CAD demonstrate that RA-CAD achieves state-of-the-art execution validity and geometric quality compared with existing methods and strong proprietary language models, showing the effectiveness of the proposed state-aware text-to-CAD agent.