arXiv:2610.39306cs.CVOct 2026

Manuscript Offprint

arXiv:2610.39306

CAD-WAM: Anticipating Geometry for Text-to-CAD Generation

Zhengyang Li, Weijie Zheng, Yuxin Cui, Sijie Wang, Wenjie Feng, Qiyu Kang

ABSTRACT

Generating editable computer-aided design (CAD) models from text requires selecting operations that produce the intended changes to the geometry constructed so far. An incorrect operation can compromise subsequent steps, making reliable multi-step generation challenging. Existing methods based on large language models (LLMs) primarily learn to predict commands, without explicit supervision of the geometric states those commands should produce. Inspired by world-action models, we introduce CAD-WAM, which couples geometry-conditioned action generation with next-state prediction. We define complete modeling operations as actions in a CAD domain-specific language (DSL) and encode surface point clouds of intermediate solids into compact latent states using a pretrained variational autoencoder. An LLM backbone generates the next action from the target description and current geometric state, while an auxiliary head on the same backbone predicts the next state to provide geometric supervision during training. We construct step-wise training trajectories from parametric CAD models in the DeepCAD dataset, pairing each trajectory with an expert-level textual description. At inference, each generated action is executed by a CAD kernel, and the resulting solid is re-encoded to inform the next decision. On the DeepCAD test set, CAD-WAM outperforms the task-specific baselines in geometric accuracy and output validity, with larger gains on models requiring more operations, and produces more accurate geometry than general-purpose LLMs prompted with the same DSL. Ablations further show that next-state supervision reduces mean Chamfer distance by 13.2% relative to an otherwise identical model trained only to predict actions. Code is available at https://github.com/Lzy-1037/CAD-WAM.

1 INTRODUCTION

Parametric computer-aided design (CAD) represents a model through a sequence of editable geometric operations rather than only its final shape. Generating such models from natural language can reduce the manual effort required for CAD modeling. Existing approaches generate parametric command sequences (Khan et al., 2024) or fine-tune large language models (LLMs) to produce executable programs in CAD scripting languages such as CadQuery and FeatureScript (Guan et al., 2025; Pyatov et al., 2026; Kolodiazhnyi et al., 2026).

Reliable multi-step CAD generation requires more than producing executable commands: each operation must also realize the intended change to the geometry constructed so far. An incorrect operation can alter the solid on which subsequent operations act, causing further deviations from the target. Our experiments also reveal an uneven error distribution: several baselines achieve low median geometric error, yet some outputs deviate substantially from the target (Figure 4). Existing methods incorporate geometric information through reinforcement learning with geometric rewards (Guan et al., 2025; Kolodiazhnyi et al., 2026) or step-wise generation conditioned on the current boundary representation (B-rep) (Qi et al., 2026). These approaches use geometry to evaluate generated programs or inform the next decision, but do not explicitly supervise predictions of the next geometric state. This motivates learning each modeling step through both its symbolic action and its intended geometric outcome, connecting operation generation with the evolving shape of the CAD model.

†Correspondence to: Qiyu Kang qiyukang@ustc.edu.cn.

World-action models provide a natural perspective on this formulation by coupling action learning with prediction of future observations (Tian et al., 2025; Zhu et al., 2025). Future prediction can provide additional supervision during training without making action generation depend on predicted states at inference (Ye et al., 2026). CAD offers a direct source of such supervision: executing expert programs yields the intermediate solids after each operation. These geometric outcomes can supervise the representation used for action generation, while the CAD kernel provides the actual geometry for subsequent decisions during inference.

Building on this idea, we introduce CAD-WAM, which jointly learns next-action generation and next-state prediction from the target description and current geometry. We design a CAD domain-specific language (DSL) that groups a sketch, its extrusion, and the associated Boolean operation into a complete modeling action, yielding a solid after each successful execution. We pretrain SetVAE (Kim et al., 2021), a variational autoencoder for point clouds, on surface point clouds of intermediate and final solids from the training split. Its encoder is then frozen to provide compact latent states that serve both as geometric inputs and as targets for next-state prediction. The Geometric State Embedding maps the current state to geometric tokens, which are processed together with textual tokens by a shared LLM backbone. The Action Head generates the next DSL action, while the State Prediction Head regresses the next latent state. Joint training allows next-state supervision to shape the shared representation used for action generation. At inference, each generated action is executed by a CAD kernel, and the resulting solid is re-encoded to condition the next decision.

To train CAD-WAM, we construct step-wise trajectories from DeepCAD, a dataset of parametric CAD models (Wu et al., 2021), by converting their construction sequences into our DSL and executing them operation by operation. Each trajectory is paired with an expert-level textual description released with Pointer-CAD (Qi et al., 2026). At each step, the description and current geometric state form the input, while the next action and resulting geometric state provide supervision. We compare CAD-WAM with task-specific baselines and general-purpose LLMs on the DeepCAD test set, applying a common geometric evaluation protocol to all available outputs. CAD-WAM achieves higher geometric accuracy and lower output invalidity than the evaluated task-specific baselines, with larger gains on models requiring more operations. It also produces more accurate geometry than general-purpose LLMs prompted with the same DSL. Ablations show that the latent-state model outperforms its textual-state counterpart and that next-state supervision reduces mean Chamfer distance by 13.2% relative to an otherwise identical model trained only to predict actions.

Our contributions are summarized as follows:

  • We introduce CAD-WAM, a text-to-CAD framework that couples geometry-conditioned action generation with next-state prediction, while using kernel-executed geometry as feedback during inference.

  • We develop an operation-level CAD DSL and a compact latent state representation, and construct step-wise training data that pair executable modeling actions with their geometric outcomes.

  • We demonstrate improved geometric accuracy over the evaluated task-specific and general-purpose models on the DeepCAD dataset, and establish the benefit of next-state supervision through controlled ablations.