TL;DR
Plan then Act (PTA) is a novel bi-level framework designed to solve the "hallucination" problem in text-to-CAD generation. By first using a Large Language Model (LLM) to create a high-level operational plan and then employing a specialized "Actioner" to generate precise command sequences, this approach slashes the rate of invalid CAD models from over 70% (with direct LLM generation) to less than 1%, while significantly improving overall geometric accuracy.
The Challenge: The Semantic Gap in Text-to-CAD
Computer-Aided Design (CAD) is the backbone of modern engineering and digital design, but it comes with a steep learning curve. Designers must master complex geometric constraints, spatial reasoning, and parameter configurations.
While there has been a recent surge in LLMs capable of generating code, researchers found that even state-of-the-art models like GPT-4o struggle to generate CAD command sequences directly from text prompts. The core challenge is a "semantic gap": user instructions are often abstract (e.g., "a ring with a hollow center"), whereas CAD commands require extreme precision (specific coordinates, extrusion depths, and Boolean operations). Direct generation often leads to "hallucinations" where the model outputs commands that are syntactically correct but geometrically impossible or entirely unrelated to the user's request.
Introducing PTA: Plan then Act
To bridge this gap, the authors introduce PTA, which breaks the generation process into two distinct, manageable levels:
- High-level Stage (The Planner): A fine-tuned LLM (Qwen3-8B) acts as a "CAD task planner." It translates abstract user instructions into a simplified, chain-like operational plan (e.g., "1. Create coordinate system, 2. Draw a rectangle..."). This stage focuses entirely on the logic of the design rather than the specific numerical parameters.
- Low-level Stage (The Actioner): This stage takes the high-level plan and the original user instruction to generate the final executable CAD commands. The heart of the Actioner is the Requirement-Aware Mechanism (RAM).
As shown in the architecture overview, the RAM uses cross-attention to treat the operation steps in the plan as queries to "look up" specific dimensions and constraints in the original text. It then uses self-attention to ensure that subsequent steps (like cutting a hole) are contextually aligned with previous steps (like creating the base).
Datasets and Evaluation
The researchers evaluated their method using the Text2CAD dataset, which contains 170k CAD command sequences paired with 660k text instructions. These instructions are categorized into four levels of complexity to test the model's robustness:
- L0 (Abstract): Simple descriptions of the final shape.
- L1 (Beginner): Basic descriptions of individual parts.
- L2 (Intermediate): Descriptions including some operational flow.
- L3 (Expert): Detailed instructions with specific parameters and coordinates.
Key Insights
- LLMs are better at Planning than Acting: The study reveals that while LLMs are great at reasoning about what needs to be done, they struggle with the precise execution of CAD coordinates. Offloading the execution to a specialized Transformer decoder (the Actioner) makes the system much more reliable.
- Decomposition Reduces Invalidity: Direct generation from LLMs often results in "broken" models. By introducing the planning step, the Invalid Rate (IR)—the percentage of generated sequences that fail to produce a valid 3D model—dropped dramatically.
- Contextual Awareness is Vital: CAD modeling is a sequential process. A command to "extrude" depends entirely on the "sketch" created in the previous step. The RAM's use of self-attention allows the model to "remember" the state of the 3D object as it builds it step-by-step.
Key Results
PTA outperformed existing state-of-the-art methods (like DeepCAD and Text2CAD) and general-purpose LLMs across all metrics.
- Invalid Rate (IR): At the L0 (Abstract) level, GPT-4o had a staggering 70.35% invalid rate. PTA reduced this to just 0.63%.
- Geometric Accuracy: PTA achieved the lowest Chamfer Distance (CD), meaning its generated 3D models were the most geometrically similar to the ground truth.
- Qualitative Superiority: As seen in the visual comparison below, PTA correctly identifies and constructs shapes (like triangles and hollow rings) where other models often default to simpler, incorrect shapes or fail entirely.
Limitations and Future Work
Despite its success, PTA has a few hurdles to clear in future iterations:
- Rare Descriptions: The model still struggles with highly creative or uncommon metaphors (e.g., "shape of a water drop" or "stylized letter S"). Targeted data augmentation could help the model learn these rare semantic mappings.
- Input Pressure: While the system automates the plan, the quality of the final model still depends heavily on the clarity of the initial user instruction.
- Future Directions: The team aims to explore Multimodality-Conditioned CAD Generation, where the model could take both a sketch image and a text description as input to create even more complex and nuanced designs.
Summary updated