betaFeedback

WorksComputer Science

PartPO: Part-Level Policy Optimization for Shape-to-Program Generation

Abstract

We present PartPO, a reinforcement learning method for generating structured shape programs from 3D point clouds. Existing shape-to-program models are trained with supervised learning on procedurally generated data and generalize poorly to more diverse shapes, while reinforcement learning from execution feedback assigns a single scalar reward to a long program that builds many parts, making credit assignment difficult. PartPO instead builds on a core property of the task: shape programs are self-describing, with each semantically named part produced by its own code block. It segments each generated program by its parts and applies part-level rewards only to the code of the corresponding part, a category reward only to the object name, and a shape-level reward to the whole program. The required part supervision is obtained without manual annotation, by grounding part names on target meshes with an open-vocabulary segmentation model prompt-tuned on the model's own outputs. Applied to MeshCoder, PartPO improves reconstruction accuracy and execution success on ShapeNetCore and ABO over the base model, rejection-sampling fine-tuning and trajectory-level RL, and generalizes to the unseen HSSD dataset. Code will be released at https://github.com/HannuoZ/PartPO.

Introduction

Generating structured shape programs from 3D perceptual inputs aims to translate a point cloud or mesh into executable code that reconstructs the observed object [5, 17]. Unlike meshes or implicit fields, a shape program is compact, editable and interpretable, which makes it a valuable representation for shape editing, reverse engineering and 3D structure understanding. Recent work frames this task, like related CAD generation problems [10, 19], as code generation with multimodal large language models (MLLMs).

MeshCoder [5], for example, defines an expressive domain-specific language (DSL) in Blender Python whose programs are self-describing: they name the object and each of its parts, and pair every part name with the code block that produces that part’s geometry. Such models are trained with supervised learning on 3D object–program pairs that are generated procedurally [27].

However, these methods struggle to generalize to more diverse or out-of-distribution data, such as human-authored 3D assets. Paired training data are limited because they must be generated procedurally, and the model is supervised only by code: it never observes the mesh obtained by executing its programs during training. Token-level losses encourage programs that resemble the training code, but they do not tell the model whether the executed shape actually matches the input. To improve the visual program inference capability of MLLMs, recent work uses reinforcement learning (RL), typically with GRPO [11, 31, 39], and rewards each program by comparing its executed output with the target image or shape [10, 17, 28]. These methods, however, face a credit assignment challenge: for long, structured and compositional programs, they assign a single scalar reward to each trajectory. Because this reward is sparse and delayed, available only once the whole program has been generated and executed, it is hard to identify which tokens contributed positively or negatively [4, 12, 15]. A program with accurate legs and a misplaced backrest receives one score for all of its tokens (Figure 1), so the advantage of each part is confounded by the quality of the others and partial progress goes unrewarded, which prior work identifies as a source of imprecise credit assignment and reduced sample efficiency.

Figure 1. Two programs generated for the same chair. A shape-level reward RshapeR_{\mathrm{shape}} scores each program as a whole (left bars): the lower program is penalized for its misplaced back decoration, and so are its correct legs, seat and back. PartPO adds a part-level reward RpartR_{\mathrm{part}} (right bars) that scores each part block by its own geometry, so only the faulty block is penalized.

To address this challenge, we propose PartPO, an RL method that uses the self-describing structure of shape programs for fine-grained credit assignment. PartPO segments each rollout into its object-name line and named part blocks, and routes each reward only to the tokens that produce what it evaluates: a part-level reward, comparing each generated part with the same-named part of the target, acts on the code of that part block; a category reward acts on the object-name line; and a shape-level reward, measuring geometric and semantic similarity to the input, acts on all tokens to preserve overall reconstruction quality. Because the segments come from the program itself and all rewards are verifiable geometric comparisons, PartPO needs neither a learned reward model nor additional rollouts. Its part supervision requires no manual annotation either: PartPO prompts an open-vocabulary segmentation model [1] with the part names in MeshCoder’s own programs and lifts the resulting multi-view masks to 3D, so it applies to datasets that provide only meshes with category labels.

Applied to MeshCoder, PartPO improves over the base model and outperforms rejection-sampling fine-tuning and trajectory-level RL on ShapeNetCore and ABO. It reduces the Chamfer distance of MeshCoder by 53% on ShapeNetCore and 60% on ABO, and raises the execution success rate on ABO from 58.6% to 97.8%. Trained only on ShapeNetCore, it also generalizes zero-shot to the unseen HSSD dataset, raising the success rate from 81.3% to 89.2% and reducing the Chamfer distance by 14%.

Our contributions are as follows:

  1. We propose PartPO, an RL method for structured shape program generation that introduces part-level advantage estimation to overcome the limitations of trajectory-level RL methods.

  2. We design a set of complementary rewards that mirror the program structure, including shape-level, part-level and category rewards, and build part supervision for the part-level reward without manual annotation.

  1. Experiments on three datasets show that PartPO outperforms trajectory- and segment-level RL baselines, and part-level evaluation and ablations confirm that its gains come from more accurate parts and structure-aligned credit assignment.

Related Work

Structured Shape Representations. Primitive-based methods abstract shapes into compact parts: SuperDec [6] fits superquadrics to point clouds, PrimitiveAnything [38] generates primitive assemblies learned from human-crafted abstractions, and PartCrafter [21] generates an object as semantically meaningful part meshes. They output part geometry rather than executable programs. CAD methods instead recover construction sequences: Deep-CAD [36] models sketch-and-extrude sequences, and CAD-Recode [29], cadrille [17] and CAD-Llama [19] generate executable CAD code with language models; for text-to-CAD, CAD-Coder [10] applies GRPO with a Chamfer-distance reward and CADFusion [34] uses preference optimization on rendered models. These operation sequences, however, neither name parts nor model their relations. Shape programs make this structure explicit: Shape2Prog [32] captures repetition and symmetry with loops over primitives, aDSL [35] designs a DSL with semantic part classes for LLM agents working from text or images, and MeshCoder [5] translates point clouds into Blender Python programs that pair every named part with the code block producing it. Such models are trained mainly by supervised learning on procedurally generated pairs; PartPO adapts them to more diverse data with RL and exploits their part structure for credit assignment.

RL from Execution Feedback. RL [11, 30, 31, 39] has become a standard way to post-train code models with execution feedback, e.g., with a unit-test critic in CodeRL [18] or multi-turn refinement in RLEF [8]. For visual code, the executed output can be compared directly with the target: RLRF [28] rewards rendered SVG code by reconstruction and semantic similarity, and cadrille [17] rewards CAD code by its geometric agreement with the target shape. These methods assign one scalar reward per trajectory, which makes it hard to tell which parts of a long, multi-part program are right or wrong.

Fine-Grained Credit Assignment. Denser signals for RL of language models usually come at an extra cost. Process reward models score intermediate steps but require human step labels [20], labels from Monte Carlo (MC) completion [33], or an implicit reward model learned online [4], and Fine-Grained RLHF [37] relies on segment-level human annotations. SPO [12], VinePPO [15] and TreeRL [13] estimate segment- or step-level values from additional MC or tree-search rollouts, which in our task means many extra Blender executions; GiGPO [7] avoids extra rollouts but assumes that environment states recur across trajectories, as in multi-turn agent tasks. In 3D, MetaSpatial [26] modulates object-level advantages with physics-aware penalties for scene layout generation. PartPO instead takes its segments from the program’s own part structure and verifies each part by geometric comparison with the target, requiring no human annotation, learned reward model or extra rollouts. Whereas recent open-world methods segment parts directly in 3D [23, 24], we follow PartSLIP [22] in lifting prompt-tuned multi-view 2D predictions to 3D, but tune the prompts on the policy’s own executed programs instead of annotated shapes.

Method

Overview

Shape-to-Code Generation. Given a point cloud P∈RN×6\mathcal{P} \in\mathbb{R}^{N \times6} (coordinates and normals), the goal is to generate an executable program y=(y1,…,yT)y = (y_1, \ldots, y_T) whose execution yields a mesh M(y)\mathcal{M}(y) that reconstructs the input. MeshCoder [5] addresses this task with a language model that writes Blender Python code. A point cloud encoder EE maps P\mathcal{P} to SS shape tokens Z=E(P)Z = E(\mathcal{P}), which are inserted between a text prefix and suffix, x=[prefix;Z;suffix]x = [\text{prefix}; Z; \text{suffix}], and a Llama-3.2-1B model [9] generates yy by next-token prediction. The output program has a fixed structure: a preamble, an object-name line # object name: <name>, and a sequence of part blocks. The kk-th part block bkb_k starts with a header # part k: <part name> and extends to the next header; we denote its part name by n(bk)n(b_k) and the sub-mesh it produces by Mk\mathcal{M}_k. Blocks with the same name form one part, Mn=⋃k:n(bk)=nMk\mathcal{M}_n = \bigcup_{k:n(b_k)=n} \mathcal{M}_k. MeshCoder is trained by supervised fine-tuning on synthetic shape–program pairs from Infinigen-Indoor [27], and its reconstructions degrade on human-authored assets such as ShapeNetCore [2], ABO [3] and HSSD [16], whose geometry and part layouts differ from the procedural training distribution.

Addressing Credit Assignment. Since Blender execution is not differentiable but each training shape has a ground-truth (GT) mesh, we adapt MeshCoder with group relative policy optimization (GRPO) [31]. Standard GRPO gives one scalar score to all tokens of a rollout, so in a program of over a thousand tokens a well-built part and a misplaced one receive identical credit. PartPO instead parses each rollout into its object-name line and part blocks, compares each executed part with the same-named GT part (Sec. 3.3), and adds each score only to the advantages of the tokens that produced what it evaluates.

PartPO. An overview of PartPO is shown in Figure 2. We use three kinds of reward (Sec. 3.2). The shape-level reward RshapeR_{\mathrm{shape}} is a scalar that measures how closely the whole generated shape matches the target, both geometrically and semantically. The part-level reward RpartR_{\mathrm{part}} acts on each part block and measures how close the generated part is to the corresponding GT part. The category reward RcatR_{\mathrm{cat}} acts on the object-name line and measures whether the object category is identified correctly. Writing a rollout as y=(yname,b1,…,bK)y = (y_{\mathrm{name}}, b_1, \ldots, b_K), where bkb_k here denotes the kk-th block and y<ky_{<k} all tokens preceding it, we write the expected part-level reward of block kk given its preceding context as Rˉk(θ;x,y)=Eb~k∼πθ(⋅∣x,y<k)Rpart(x,y;b~k)\bar{R}_k(\theta; x, y) = \mathbb{E}_{\tilde{b}_k \sim\pi_\theta(\cdot\mid x, y_{<k})} R_{\mathrm{part}}(x, y; \tilde{b}_k), and define the expected shape-level, category and part-level rewards of an input xx as

Figure 2. Overview of PartPO. For each point cloud, the policy samples G programs, which are executed in Blender and scored by a shape-level reward (vs. GT shape), a category reward (vs. category label) and part-level rewards (vs. GT part points, obtained once per shape with prompt-tuned SAM 3 and multi-view voting, left). Each advantage is added only to the tokens it evaluates (bottom), so the misplaced stretcher is penalized without penalizing the other correct parts.

Jshape(θ;x)=Ey∼πθ(⋅∣x)Rshape(x,y),\mathcal{J}_{\mathrm{shape}}(\theta; x) = \mathbb{E}_{y \sim\pi_\theta(\cdot\mid x)} R_{\mathrm{shape}}(x, y),
Jcat(θ;x)=Eyname∼πθ(⋅∣x)Rcat(x,yname),\mathcal{J}_{\mathrm{cat}}(\theta; x) = \mathbb{E}_{y_{\mathrm{name}} \sim\pi_\theta(\cdot\mid x)} R_{\mathrm{cat}}(x, y_{\mathrm{name}}),
Jpart(θ;x)=Ey∼πθ(⋅∣x)∑k=1K(y)Rˉk(θ;x,y).\mathcal{J}_{\mathrm{part}}(\theta; x) = \mathbb{E}_{y \sim\pi_\theta(\cdot\mid x)} \sum_{k=1}^{K(y)} \bar{R}_k(\theta; x, y).

The training objective is

JPartPO(θ)=Ex∼D[Jshape+λcJcat+Jpart](θ;x),(1)\mathcal{J}_{\mathrm{PartPO}}(\theta) = \mathbb{E}_{x \sim\mathcal{D}}\left[\mathcal{J}_{\mathrm{shape}} + \lambda_c \mathcal{J}_{\mathrm{cat}} + \mathcal{J}_{\mathrm{part}}\right](\theta; x), \tag*{(1)}

where

Rpart(x,y;bk)=λ1Rsem(x,y;n(bk))+λ2Rgeo(x,bk).(2)R_{\mathrm{part}}(x, y; b_k) = \lambda_1 R_{\mathrm{sem}}(x, y; n(b_k)) + \lambda_2 R_{\mathrm{geo}}(x, b_k). \tag*{(2)}

We optimize Eq. (1) with GRPO. For each input xx, we sample a group of GG programs {y(i)}i=1G\{y^{(i)}\}_{i=1}^{G} from πθold\pi_{\theta_{\mathrm{old}}} and normalize the shape-level reward Rshape(i)=Rshape(x,y(i))R_{\mathrm{shape}}^{(i)} = R_{\mathrm{shape}}(x, y^{(i)}) within the group,

Ao(i)=Rshape(i)−mean⁡jRshape(j)std⁡jRshape(j)+ϵ.(3)A_o^{(i)} = \frac{R_{\mathrm{shape}}^{(i)} - \operatorname{mean}_j R_{\mathrm{shape}}^{(j)}}{\operatorname{std}_j R_{\mathrm{shape}}^{(j)} + \epsilon}. \tag*{(3)}

The part-semantic, part-geometric and category rewards are converted into advantages A1(i)[n]A_1^{(i)}[n], A2(i)[k]A_2^{(i)}[k] and Ac(i)A_c^{(i)} in the same group-relative manner (Sec. 3.2). PartPO combines them into a token-level advantage for the tt-th token of rollout ii:

At(i)=Ao(i)+1[t∈body⁡(bk(t))](λ1A1(i)[n(bk(t))]+λ2A2(i)[k(t)])+1[t∈name⁡]λcAc(i),(4)A_t^{(i)} = A_o^{(i)} + \mathbf{1}\left[t \in\operatorname{body}(b_{k(t)})\right]\left(\lambda_1 A_1^{(i)}[n(b_{k(t)})] + \lambda_2 A_2^{(i)}[k(t)]\right) + \mathbf{1}\left[t \in\operatorname{name}\right]\lambda_c A_c^{(i)}, \tag*{(4)}

where k(t)k(t) is the part block containing token tt. Part headers, the preamble and the end-of-sequence token receive only AoA_o, as do rollouts that fail to execute. With the probability ratio rt(i)=πθ(yt(i)∣x,y<t(i))/πθold(yt(i)∣x,y<t(i))r_t^{(i)} = \pi_\theta(y_t^{(i)} \mid x, y_{<t}^{(i)})/\pi_{\theta_{\mathrm{old}}}(y_t^{(i)} \mid x, y_{<t}^{(i)}) and the clipped per-token term

ℓt(i)(θ)=min⁡(rt(i)At(i),clip⁡(rt(i),1−ϵ,1+ϵ)At(i))\ell_t^{(i)}(\theta) = \min\left(r_t^{(i)} A_t^{(i)}, \operatorname{clip}\left(r_t^{(i)}, 1-\epsilon, 1+\epsilon\right) A_t^{(i)}\right)

the final objective is the PPO-clip surrogate of GRPO with token-level advantages, normalized by the total number of tokens N=∑i=1G∣y(i)∣N = \sum_{i=1}^{G} \lvert y^{(i)} \rvert in the group:

JGRPO(θ)=E[1N∑i=1G∑t=1∣y(i)∣ℓt(i)(θ)],(5)\mathcal{J}_{\mathrm{GRPO}}(\theta) = \mathbb{E}\left[\frac{1}{N}\sum_{i=1}^{G}\sum_{t=1}^{\lvert y^{(i)}\rvert}\ell_t^{(i)}(\theta)\right], \tag*{(5)}

where the expectation is over x∼Dx \sim\mathcal{D} and {y(i)}i=1G∼πθold(⋅∣x)\{y^{(i)}\}_{i=1}^{G} \sim\pi_{\theta_{\mathrm{old}}}(\cdot\mid x). We omit the KL penalty. During RL, the SFT weights and the point cloud encoder are frozen and only newly added LoRA parameters [14] are trained.

Rewards for Shape-to-Code Generation

Our rewards are computed automatically by executing the generated program and comparing the result with the GT shape, so no human annotation is needed. They evaluate the program at three granularities: the whole shape, each part, and the object category. Each training shape provides a normalized GT point cloud X\mathcal{X}, a GT mesh M∗\mathcal{M}^{*}, GT part points {Xn∗}\{\mathcal{X}^{*}_{n}\} indexed by part name (§ 3.3), and a category label ℓ\ell.

Shape-Level Reward. We measure geometric fidelity with a truncated Chamfer similarity (TCS). With the truncated kernel ψc(d)=max⁡(0,1−d/c)\psi_c(d) = \max(0, 1-d/c) and c=κ⋅diag⁡(X)c = \kappa\cdot\operatorname{diag}(\mathcal{X}), where diag⁡(⋅)\operatorname{diag}(\cdot) is the bounding-box diagonal, the similarity

between point sets AA and BB is

Sc(A,B)=12[1∣A∣∑a∈Aψc(d(a,B))+1∣B∣∑b∈Bψc(d(b,A))],(6)S_c(A,B) = \frac{1}{2}\left[\frac{1}{\lvert A\rvert}\sum_{a\in A}\psi_c(d(a,B))+\frac{1}{\lvert B\rvert}\sum_{b\in B}\psi_c(d(b,A))\right], \tag*{(6)}

where d(⋅,⋅)d(\cdot,\cdot) is the nearest-neighbor distance. Truncation bounds the influence of outliers and keeps the reward in [0,1][0,1]. A semantic term complements it with the cosine similarity of Uni3D [40] embeddings f(⋅)f(\cdot) of the two point clouds, both colored in a uniform gray so that only geometry is compared. A program that raises an error, times out, or produces an empty or degenerate mesh fails a validity gate and receives rfail=0r_{\mathrm{fail}} = 0. With Y^\hat{\mathcal{Y}} sampled from the generated mesh,

Rshape={wgSc(Y^,X)+wscos⁡(f(Y^),f(X)),valid,rfail,otherwise,(7)R_{\mathrm{shape}} = \begin{cases} w_g S_c(\hat{\mathcal{Y}},\mathcal{X}) + w_s \cos\left(f(\hat{\mathcal{Y}}),f(\mathcal{X})\right), & \text{valid},\\ r_{\mathrm{fail}}, & \text{otherwise}, \end{cases} \tag*{(7)}

where “valid” means that yy passes the gate.

Part-Level Reward. Part-level rewards are computed for valid rollouts and use one-sided truncated similarities with radius cp=κp⋅diag⁡(X)c_p = \kappa_p \cdot\operatorname{diag}(\mathcal{X}). The part-semantic reward measures whether a claimed part covers the true one. For each part name nn, it compares the GT part points Xn∗\mathcal{X}^{*}_{n} (§ 3.3). with the generated part Mn\mathcal{M}_n, keeping only the closest ρ\rho fraction of points to tolerate segmentation noise:

Rsem(x,y;n)=1⌈ρ∣Xn∗∣⌉∑p∈top⁡ρ(Xn∗)ψcp(d(p,Mn)).(8)R_{\mathrm{sem}}(x,y;n)=\frac{1}{\lceil\rho|\mathcal{X}^{*}_n|\rceil}\sum_{p\in\operatorname{top}_{\rho}(\mathcal{X}^{*}_n)}\psi_{cp}\left(d(p,\mathcal{M}_n)\right). \tag*{(8)}

The part-geometric reward measures whether a block’s geometry lies on the object. It is independent of part names and penalizes extra or misplaced geometry. With Y^k\hat{Y}_k sampled from the sub-mesh Mk\mathcal{M}_k,

Rgeo(x,bk)=1∣Y^k∣∑p∈Y^kψcp(d(p,M∗)).(9)R_{\mathrm{geo}}(x,b_k)=\frac{1}{|\hat{Y}_k|}\sum_{p\in\hat{Y}_k}\psi_{cp}\left(d(p,\mathcal{M}^{*})\right). \tag*{(9)}

The two terms act as recall and precision at the part level. Each is centered within the group, against units of the same part name when that name appears in at least two rollouts and against all units otherwise. It is then divided by the standard deviation over the whole optimization step rather than within the group, which avoids amplifying noise in small groups. This yields A(1)[n]A^{(1)}[n] and A(2)[k]A^{(2)}[k]; units whose GT part is missing receive zero advantage.

Category Reward. The part-level reward is effective only when the model writes part names of the correct category. If the model mistakes the input for another category, its part names do not exist in the GT part vocabulary, and the part-semantic reward becomes uninformative for the entire rollout. We therefore reward the category decision directly. We parse the noun phrase on the object-name line and map its last word to a category c^(y)\hat{c}(y); if the mapping fails, c^(y)=UNKNOWN\hat{c}(y)=\mathrm{UNKNOWN}. Comparing with the label ℓ\ell,

Rcat={+1,c^=ℓ,0,c^=UNKNOWN,−1,otherwise.(10)R_{\mathrm{cat}}= \begin{cases} +1, & \hat{c}=\ell,\\ 0, & \hat{c}=\mathrm{UNKNOWN},\\ -1, & \text{otherwise}. \end{cases} \tag*{(10)}

Ac(i)A_c^{(i)} is obtained by subtracting the group mean and dividing by the step-level standard deviation. It is therefore nonzero only in groups that contain both correct and incorrect predictions, where it shifts probability toward the rollouts that name the category correctly.

Grounding Part Names in Target Shapes

The part-semantic reward requires GT points for each part name, but GT meshes carry no part annotations. We locate parts with SAM 3 [1], prompt-tuned on data generated by MeshCoder itself, and lift its multi-view masks to 3D by voting.

Prompt Tuning with MeshCoder Outputs. We run MeshCoder on its synthetic shapes and execute the resulting programs block by block. Because every block produces its own object, rendering gives pixel-accurate part

instance maps without manual labeling. For each shape, we render RGB images and instance maps from six views, three in each hemisphere, with a uniform gray material. A view is a positive sample for part name nn if the part is visible, and a negative sample otherwise. With all SAM 3 parameters frozen, we learn for each (category, part name) an offset ϕn\phi_n added to the text token embeddings of the name, e~n=e(n)+ϕn\tilde{e}_n=e(n)+\phi_n, using SAM 3’s original detection and segmentation losses; negative views supervise only the absence of the part. At inference, queries whose score, multiplied by the image-level presence score, exceeds a threshold are kept, and their masks are merged into the part mask Kv,nK_{v,n}; if none is kept, the part is predicted absent from view vv.

Rendering and Segmenting GT Meshes. For each training shape, we render the GT mesh from a set of views V\mathcal{V} with the same renderer and view selection, and segment every view with the tuned prompts e~n\tilde{e}_n for all part names in the category’s vocabulary, obtaining masks {Kv,n}\{K_{v,n}\}.

Multi-View Voting. We sample points QQ uniformly on the GT mesh surface, each with a face normal nqn_q. A view vv validly observes a point qq if qq projects inside the image, is not occluded along the camera ray (within tolerance δ⋅diag⁡(X)\delta\cdot\operatorname{diag}(\mathcal{X})), and is not viewed at a grazing angle, ∣cos⁡(∠(nq,rv(q)))∣≥cmin⁡|\cos(\angle(n_q,r_v(q)))|\ge c_{\min}. Let ov(q)=1[v validly observes q]o_v(q)=\mathbb{1}[v\text{ validly observes }q], and let mv,n(q)=1[Πv(q)∈Kv,n]m_{v,n}(q)=\mathbb{1}[\Pi_v(q)\in K_{v,n}] indicate that qq falls inside the mask of part nn, where Πv\Pi_v is the projection into view vv. For each part name nn, count the valid observations and the positive votes,

obs⁡n(q)=∑v∈Vov(q),pos⁡n(q)=∑v∈Vov(q)mv,n(q).(11)\begin{aligned} \operatorname{obs}_{n}(q) &= \sum_{v \in V} o_v(q),\\ \operatorname{pos}_{n}(q) &= \sum_{v \in V} o_v(q)m_{v,n}(q). \tag*{(11)} \end{aligned}

We define the GT part points as

Xn∗={q∈Q:pos⁡n(q)≥ηn(q)},(12)\mathcal{X}^{*}_{n} = \{q \in\mathcal{Q} : \operatorname{pos}_{n}(q) \ge\eta_{n}(q)\}, \tag*{(12)}

where ηn(q)=max⁡(Nmin⁡,τobs⁡n(q))\eta_n(q) = \max\left(N_{\min}, \tau\operatorname{obs}_n(q)\right) is the vote threshold. Requiring agreement from at least Nmin⁡N_{\min} views, and a majority of the views that actually see the point, suppresses segmentation errors in individual views. Figure 3 shows examples of the resulting GT part points.

Grounding part names on GT meshes

Figure 3. Grounding part names on GT meshes. Columns 1–3: masks predicted by the prompt-tuned SAM 3 on three views; column 4: GT part points after multi-view voting (gray: unassigned). Colors denote part names. Table: leg (red), table top (green). Chair: leg (red), cushion (green), armrest (blue). Lamp: base (red), shade (green), post (blue), rack (purple).

Experiments

Experimental Setup

We build on MeshCoder [5], a 1B model trained on procedurally generated data to generate object programs from point clouds. Other existing models that take point clouds as input perform poorly on this task without fine-tuning, so all RL methods below are applied to MeshCoder.

Datasets. We experiment on three datasets. ShapeNetCore [2]: we use 13 categories and randomly select 3,249 shapes for RL training and 2,862 shapes for testing. ABO [3]: we randomly select 721 shapes for training and 650 for testing from five categories (chair, lamp, shelf, sofa, table). HSSD [16]: we randomly select 878 shapes from the same 13 categories as ShapeNetCore and use them only for testing models trained on ShapeNetCore, to evaluate cross-dataset generalization.

Methods in comparison. Besides MeshCoder itself, we compare with three RL baselines built on MeshCoder and with a primitive-based method. Shape-level reward fine-tunes MeshCoder with GRPO using only RshapeR_{\mathrm{shape}}, assigned to all tokens of a rollout; this is the common practice in RL for code generation, e.g., for CAD code [17]. RFT (rejection-sampling fine-tuning) samples programs from MeshCoder and fine-tunes it on those with the highest shape-level reward. SPO [12] is a segment-level RL method for language-model reasoning. We transfer it to MeshCoder by cutting segments at part-block boundaries and estimating segment advantages with Monte Carlo rollouts scored by the shape-level reward. PrimitiveAnything [38] generates primitive assemblies from shapes with an autoregressive transformer trained on human-crafted abstractions; it predicts primitives directly rather than executable programs.

Training details. All training runs on a single NVIDIA RTX 6000 Ada Generation GPU. Each training step samples 4 point clouds and 8 rollouts per point cloud, i.e., 32

rollouts per step. We train for 1,000 steps on ShapeNetCore and 500 steps on ABO, with a learning rate of 1×10−51 \times10^{-5}. In all experiments, we set λ1=λ2=0.35\lambda_1 = \lambda_2 = 0.35, λc=0.3\lambda_c = 0.3, ρ=0.9\rho= 0.9, cmin⁡=0.2c_{\min} = 0.2 and Nmin⁡=2N_{\min} = 2. We also validate part grounding (Appendix § 10). On held-out MeshCoder outputs, the tuned prompts raise the part segmentation mIoU of SAM 3 from 33.5% to 78.7%. On 667 ShapeNetCore training shapes annotated in PartNet [25], the one-sided squared Chamfer distance from the GT part points to the annotated parts is 0.351×10−20.351 \times10^{-2}, 53% lower than with direct per-view back-projection of the masks (0.750×10−20.750 \times10^{-2}).

Metrics. We evaluate reconstruction accuracy with the L2 Chamfer distance (CD) and the absolute normal consistency (ANC) between points sampled from the generated and GT meshes, and execution reliability with the success rate, the fraction of test inputs whose generated program executes and yields a valid mesh. CD and ANC are averaged over successful outputs.

Main Results

Results on ShapeNetCore. We report scores in Table 1 (top) and qualitative results in Figure 4 (middle). PartPO achieves the best overall CD, ANC and success rate, more than halving the CD of MeshCoder (2.64 to 1.24). SPO and the shape-level reward improve over MeshCoder by smaller margins, while RFT brings only marginal gains. The qualitative results show where the difference comes from: the baselines usually recover the overall shape but get individual parts wrong, such as a missing backrest rail, misplaced sofa armrests, a malformed lampshade, or extra geometry on the lamp and the bookshelf, whereas PartPO reconstructs each part in place. PrimitiveAnything always yields an output, but its primitive assemblies are far less accurate.

MethodCD ↓\downarrowAbsolute Normal Consistency ↑\uparrowSuccess Rate ↑\uparrow
TableChairLampAllTableChairLampAllTableChairLampAll
ShapeNetCore
PrimitiveAnything [38]20.327.7013.2110.460.7450.7320.6420.743100.0100.0100.0100.0
MeshCoder [5]2.402.252.632.640.8670.7740.7910.81598.987.093.589.2
+ RFT2.062.133.232.540.8690.7750.7910.81798.987.994.490.6
+ SPO2.202.302.512.050.8840.7750.7950.82099.792.599.196.5
+ shape-level reward1.942.292.272.270.8840.7840.7880.82699.292.297.296.5
+ PartPO0.851.571.921.240.8900.7900.7880.83399.993.1100.097.8
ABO
PrimitiveAnything [38]3.811.915.792.760.8020.7960.7200.780100.0100.0100.0100.0
MeshCoder [5]3.541.223.912.370.8320.8100.7780.797100.079.396.858.6
+ RFT3.681.263.882.360.8350.8060.7810.797100.078.797.658.5
+ SPO3.051.652.021.300.8440.7980.8410.814100.091.399.297.5
+ shape-level reward3.591.342.531.380.8280.8040.8210.816100.092.7100.090.0
+ PartPO2.471.071.490.950.8480.8210.8530.831100.092.0100.097.8

Table 1. Reconstruction results on ShapeNetCore and ABO. CD is scaled by 10210^2 and averaged, like ANC, over successfully executed shapes; success rate is in %. All: average over all test shapes. Best results are in bold; PrimitiveAnything always yields an output and is excluded when marking the best success rate.

Qualitative comparison of reconstructions on ABO, ShapeNetCore, and HSSD

Figure 4. Qualitative comparison on ABO (left), ShapeNetCore (middle) and HSSD (right; models trained on ShapeNetCore, tested without further training). × marks programs that fail to execute; SPO is not evaluated on HSSD (–). PartPO reconstructs each part in place, while the baselines produce missing, floating or misplaced parts.

Results on ABO. Scores are in Table 1 (bottom) and qualitative results in Figure 4 (left). The domain gap is larger on ABO: MeshCoder executes successfully on only 58.6% of the test shapes, and RFT leaves this nearly unchanged. PartPO raises the success rate to 97.8% and reduces the CD by 60%, with the best CD and ANC on every listed category. SPO nearly matches its success rate but not its accuracy, and the shape-level reward falls behind on both. In Figure 4, MeshCoder fails to execute on the armchair; SPO and the shape-level baseline produce valid programs, but with detached legs and stretchers, a missing tabletop or lampshade, or stray fragments, whereas PartPO yields complete and well-assembled shapes.

Accuracy on commonly executed shapes. Because CD and ANC are averaged over the successful outputs of each method, a method could appear more accurate simply by failing on harder shapes. We therefore also evaluate on the shapes that all program-generating methods execute successfully (2,505 on ShapeNetCore and 362 on ABO). PartPO still achieves the lowest CD, 1.03 and 1.29, compared with at best 1.84 and 1.73 for the baselines, as well as the highest ANC (Appendix § 8).

Results on HSSD. To test cross-dataset generalization, we evaluate the models trained on ShapeNetCore on HSSD without further training (Table 2, Figure 4 right). PartPO improves both CD and success rate over MeshCoder and the shape-level reward, with comparable ANC. In Figure 4, MeshCoder omits both tabletops, and the shape-level baseline lets a leg pierce the round tabletop and still omits the console tabletop; PartPO recovers both.

MethodCD ↓ANC ↑Success ↑
MeshCoder [5]3.120.80981.3
+ shape-level reward2.920.81788.3
+ PartPO2.690.81689.2

Table 2. Zero-shot results on HSSD of models trained on ShapeNetCore. CD is scaled by 10210^2 and success rate is in %.

Part-Level Evaluation

Setup. Shape-level metrics do not show whether a program decomposes the object into the right parts. We therefore evaluate parts on the 504 ShapeNetCore test shapes of tables, chairs and lamps that are annotated in PartNet [25]; these annotations are not used in training. In each program, code blocks with the same part name are merged into one predicted part. PartNet organizes the parts of each shape in a tree, where a part such as a chair back may be split into finer sub-parts. We use every node of the tree except the root as a GT part, together with the atomic meshes, the smallest annotated pieces, so that a predicted part can match either a whole back or one of its sub-parts. We then match predicted and GT parts greedily in order of increasing Chamfer distance. A pair is accepted only if its distance is below a threshold, the predicted part is not yet matched, and the GT part does not overlap an already matched one, such as a sub-part of a matched back. Thus each predicted part matches at most one GT part, and no surface region is counted twice. Part CD and Part NC are averaged over the matched pairs. Recall is the fraction of the object’s surface area covered by matched GT parts, so it drops when parts are missing. Precision is the fraction of predicted parts that are matched, so it drops when parts are extra or misplaced. Details are in Appendix § 7.

Results. Table 3 shows that PartPO improves every part-level metric. It reduces the Part CD of MeshCoder from 6.72 to 4.74 and raises Part NC from 0.626 to 0.640, so the parts it builds are geometrically more accurate. It also raises recall from 72.7% to 74.2% and precision from 87.4% to 89.2%, so its programs miss fewer parts and produce fewer

MethodSuccess ↑Part CD ↓Part NC ↑Recall ↑Precision ↑
MeshCoder [5]94.46.720.62672.787.4
+ shape-level reward94.46.100.62771.888.4
+ PartPO96.44.740.64074.289.2

Table 3. Part-level comparison between PartPO and baselines on the 504 ShapeNetCore test shapes (table, chair and lamp) annotated in PartNet. Part CD is scaled by 10310^3; success rate, recall and precision are in %. Best results are in bold.

parts that match nothing, while executing successfully more often (96.4% vs. 94.4%). The shape-level reward, in contrast, improves Part CD and precision only modestly (6.10 and 88.4%) and lowers recall to 71.8%: optimizing whole-shape similarity alone does not make the program build the right parts. The improvements of PartPO in § 4.2 therefore come from better individual parts, which is what its part-level credit assignment targets.

Ablation Studies

We ablate PartPO on two ABO categories, lamp and table, using 467 training and 385 test shapes disjoint from the main experiments, and train each RL variant for 300 steps. Starting from MeshCoder, we add the shape-level reward, then the part-level reward, and finally the category reward, either summed with the others into one scalar for all tokens or applied only to the tokens it evaluates, as in PartPO (Table 4).

MethodCD ↓Abs. Normal Consistency ↑Success Rate ↑
LampTableAllLampTableAllLampTableAll
MeshCoder [5]4.704.724.710.7590.7090.72893.593.594.5
+ shape-level3.074.934.190.7870.7280.75190.788.989.6
+ shape-level + part-level2.703.393.130.8120.7290.76099.998.398.7
+ scalar sum of all rewards2.374.453.630.8030.7170.75194.093.293.5
+ PartPO1.863.282.720.8190.7390.77099.999.699.5

Table 4. Ablation on ABO (lamp and table). Scalar sum adds the three rewards into one scalar assigned to all tokens; PartPO applies each reward only to the tokens it evaluates. CD is scaled by 10210^2 and success rate is in %.

The shape-level reward alone lowers the CD of MeshCoder but also its success rate, and even increases the CD on tables. Adding the part-level reward improves all summary metrics, and the category reward brings a further gain: it encourages the policy to name the object category correctly, which is the precondition for the part-level reward to be informative. Finally, the structure-aligned credit assignment is the key. Summing the same three rewards into a scalar provides the same reward information as PartPO, yet raises the CD from 2.72 to 3.63, worse than the localized variant even without the category reward, and drops the success rate below that of MeshCoder. The rewards therefore help only when each of them reaches the tokens that produced what it evaluates.

Conclusion

This paper presents PartPO, an RL method for shape program generation that builds on the self-describing part structure of shape programs. Each reward reaches only the tokens that produce what it evaluates: part-level rewards act on part blocks, the category reward on the object name, and the shape-level reward on the whole program. On ShapeNetCore and ABO, PartPO improves the reconstruction accuracy and execution success of MeshCoder, outperforms rejection-sampling fine-tuning and trajectory- and segment-level RL, and generalizes to the unseen HSSD dataset. More broadly, our results suggest that when generated code exposes its own structure, verifying each component against the target provides dense credit without a learned reward model or extra rollouts.

Limitations. We evaluate a single base model and DSL. Few models generate part-structured programs from point clouds, and MeshCoder is the most capable openly available one. PartPO only requires executable programs with named part blocks. Verifying its transfer to other shape program generators is future work.

LLM Usage Statement

We used Claude Sonnet 5.5 (Anthropic) in the preparation of this paper in the following limited ways. (1) Writing: the model was used to polish the wording and rhetoric of author-written text. All suggestions were reviewed, edited, and approved by the authors. (2) Figures: the model provided advice on the layout and visual design of the pipeline diagram; the figure itself was created by the authors. (3) Code: the model was used to assist in debugging our implementation of the 2D-to-3D lifting module, e.g., diagnosing error messages and suggesting fixes for specific implementation bugs. The lifting method itself was designed by the authors, the code was written by the authors, and every suggested change was reviewed, tested, and verified by the authors before being adopted. The authors take full responsibility for all content of this paper.

Part-Level Evaluation Details

This section details the part-level evaluation in § 4.3. Shape-level metrics such as the overall Chamfer distance measure how close a reconstruction is to the target, but not whether the generated program decomposes the object into semantically meaningful parts. We therefore match the parts produced by each program with the hierarchical part annotations of PartNet [25] and measure the geometric accuracy, coverage and correctness of the matched parts. The evaluation uses the 504 test shapes of ShapeNetCore in the table, chair and lamp categories that are annotated in PartNet.

Predicted Parts

Each block of a generated program carries a part name (e.g., leg, seat) and produces a part mesh when executed. Because one semantic part is often built by several blocks, such as the four legs of a chair, we normalize the part names and merge the blocks with the same normalized name into one predicted part. The predicted parts of an object are denoted by P={P1,…,PM}\mathcal{P} = \{P_1,\ldots,P_M\}, each a triangle mesh. A program that fails to execute or produces no part mesh counts as an execution failure.

Ground-Truth Part Candidates

PartNet annotates each object with a part hierarchy, in which every node is a semantic part composed of one or more atomic meshes, the smallest indivisible geometric units of PartNet. For a node gg, we denote its set of atomic meshes by O(g)\mathcal{O}(g); the geometry of the node is their union. All nodes except the root, which is the whole object, serve as GT part candidates, so a predicted part can align with the annotation at any granularity: with a coarse part such as a chair back or with one of its finer sub-parts. In addition, each atomic mesh of a node that contains several is added as a separate candidate, to cover decompositions finer than the annotated leaves. When several nodes have identical atomic mesh sets, as in a chain of single-child nodes that differ only in name, we keep one of them. The final candidate set is G={G1,…,GK}\mathcal{G} = \{G_1,\ldots,G_K\}.

These candidates have a key property: the atomic mesh sets of any two candidates are either disjoint or nested, and O(Gj)∩O(Gk)≠∅\mathcal{O}(G_j)\cap\mathcal{O}(G_k)\ne\emptyset if and only if GjG_j and GkG_k are the same node or one is an ancestor of the other. The matching below uses this property to enforce consistency with the hierarchy.

Coordinate alignment. PartNet meshes lie in a different coordinate frame from the normalized frame used by the models. We align each PartNet mesh to the normalized GT point cloud X\mathcal{X} of the same object. For each of the 24 axis-aligned rotations RR, we apply a scaling and translation that match the center and longest side of the rotated mesh’s bounding box to those of the bounding box of X\mathcal{X}, and we select the transformation with the smallest Chamfer distance to X\mathcal{X}. The same transformation is applied to all GT part candidates of the object.

Algorithm 1 Greedy part matching with hierarchical constraints.

Require: predicted parts P\mathcal{P}, GT candidates G\mathcal{G}, threshold τ\tau

1: M←∅\mathcal{M}\leftarrow\emptyset; U←∅\mathcal{U}\leftarrow\emptyset &nbsp;&nbsp;&nbsp;&nbsp; ▹\triangleright matched predicted parts 2: Oused←∅\mathcal{O}_{\mathrm{used}}\leftarrow\emptyset &nbsp;&nbsp;&nbsp;&nbsp; ▹\triangleright occupied atomic meshes 3: for (Pi,Gj)(P_i,G_j) in ascending order of CD⁡(Pi,Gj)\operatorname{CD}(P_i,G_j) do 4: &nbsp;&nbsp;&nbsp;&nbsp;if CD⁡(Pi,Gj)>τ\operatorname{CD}(P_i,G_j)>\tau then break 5: &nbsp;&nbsp;&nbsp;&nbsp;end if 6: &nbsp;&nbsp;&nbsp;&nbsp;if Pi∉UP_i\notin\mathcal{U} and O(Gj)∩Oused=∅\mathcal{O}(G_j)\cap\mathcal{O}_{\mathrm{used}}=\emptyset then 7: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;M←M∪{(Pi,Gj)}\mathcal{M}\leftarrow\mathcal{M}\cup\{(P_i,G_j)\} 8: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;U←U∪{Pi}\mathcal{U}\leftarrow\mathcal{U}\cup\{P_i\}; Oused←Oused∪O(Gj)\mathcal{O}_{\mathrm{used}}\leftarrow\mathcal{O}_{\mathrm{used}}\cup\mathcal{O}(G_j) 9: &nbsp;&nbsp;&nbsp;&nbsp;end if 10: end for 11: return M\mathcal{M}

Distance

For two meshes AA and BB, we sample point sets SAS_A and SBS_B uniformly on their surfaces with area weighting and use the bidirectional Chamfer distance with squared Euclidean distances:

CD⁡(A,B)=1∣SA∣∑a∈SAmin⁡b∈SB∥a−b∥22+1∣SB∣∑b∈SBmin⁡a∈SA∥a−b∥22.(13)\operatorname{CD}(A,B)=\frac{1}{\lvert S_A\rvert}\sum_{a\in S_A}\min_{b\in S_B}\lVert a-b\rVert_2^2+\frac{1}{\lvert S_B\rvert}\sum_{b\in S_B}\min_{a\in S_A}\lVert a-b\rVert_2^2. \tag*{(13)}

Part Matching

We compute CD⁡(Pi,Gj)\operatorname{CD}(P_i,G_j) for all pairs of predicted parts and GT candidates and obtain a matching M⊂P×G\mathcal{M}\subset\mathcal{P}\times\mathcal{G} greedily (Algorithm 1). The pairs are visited in ascending order of distance, and a pair (Pi,Gj)(P_i,G_j) is accepted if and only if

  1. distance threshold: CD⁡(Pi,Gj)≤τ\operatorname{CD}(P_i,G_j)\le\tau, i.e., the two are geometrically close;

  2. one-to-one: PiP_i has not been matched;

  3. hierarchical exclusivity: O(Gj)\mathcal{O}(G_j) is disjoint from the atomic meshes of all matched GT candidates.

By the property above, condition 3 is equivalent to requiring that GjG_j is neither matched nor an ancestor or descendant of a matched node. The resulting matching is therefore one-to-one, and the matched GT candidates do not overlap, so the same region is never counted both as a coarse part and as one of its sub-parts. Each predicted part can thus align with the annotation at its most suitable granularity, while the matched GT candidates form a subset of a non-overlapping partition of the object. We use τ=0.05\tau=0.05.

Metrics

For each successfully executed shape, we compute the following metrics on the matching M\mathcal{M}. After matching, the geometric metrics are recomputed with denser point sampling on each part for stability.

Part CD (↓). The Chamfer distance of Eq. (13) averaged over the matched pairs, measuring the geometric accuracy of the correctly identified parts:

Part-CD⁡=1∣M∣∑(P,G)∈MCD⁡(P,G).(14)\operatorname{Part\text{-}CD} = \frac{1}{|\mathcal{M}|} \sum_{(P,G)\in\mathcal{M}} \operatorname{CD}(P,G). \tag*{(14)}

Part NC (↑). For a point aa sampled on mesh AA, let nA(a)\mathbf{n}_A(a) be the normal of its triangle and nB(πB(a))\mathbf{n}_B(\pi_B(a)) the normal of the triangle containing its nearest point on mesh BB. The one-sided normal consistency is

NC⁡(A→B)=1∣SA∣∑a∈SA∣nA(a)⋅nB(πB(a))∣,(15)\operatorname{NC}(A \to B) = \frac{1}{|S_A|} \sum_{a\in S_A} \left| \mathbf{n}_A(a) \cdot\mathbf{n}_B(\pi_B(a)) \right|, \tag*{(15)}

and the bidirectional one is NC⁡(A,B)=12(NC⁡(A→B)+NC⁡(B→A))\operatorname{NC}(A,B) = \frac{1}{2}\left(\operatorname{NC}(A \to B) + \operatorname{NC}(B \to A)\right). The absolute value makes the metric independent of the orientation convention of mesh faces. Part NC averages NC⁡(P,G)\operatorname{NC}(P,G) over the matched pairs and measures the fidelity of surface orientation and local detail.

Recall (↑). Recall measures how much of the object’s surface is covered by correctly identified parts and thus reflects missing parts:

Recall⁡=∑(P,G)∈MArea⁡(G)Area⁡(object⁡),(16)\operatorname{Recall} = \frac{\sum_{(P,G)\in\mathcal{M}} \operatorname{Area}(G)}{\operatorname{Area}(\operatorname{object})}, \tag*{(16)}

where Area⁡(⋅)\operatorname{Area}(\cdot) is the surface area and the denominator is the total area of all atomic meshes of the object. Because the matched GT candidates do not overlap, no area is counted twice and the ratio never exceeds 1. Weighting by area rather than by count makes the metric independent of the granularity of the annotation: covering the same region yields the same recall whether a predicted part matches a coarse part or several of its sub-parts.

Precision (↑). Precision measures how many predicted parts correspond to real parts and thus reflects extra or misplaced parts:

Precision⁡=∣{P:(P,G)∈M}∣∣P∣.(17)\operatorname{Precision} = \frac{\left|\{P : (P,G)\in\mathcal{M}\}\right|}{|\mathcal{P}|}. \tag*{(17)}

F1 (↑). The harmonic mean of precision and recall summarizes the completeness and correctness of the decomposition:

F1⁡=2⋅Precision⁡⋅Recall⁡Precision⁡+Recall⁡.(18)\operatorname{F1} = \frac{2 \cdot\operatorname{Precision} \cdot\operatorname{Recall}}{\operatorname{Precision} + \operatorname{Recall}}. \tag*{(18)}

Table 5. Extended part-level comparison on the 504 ShapeNetCore test shapes (table, chair and lamp) annotated in PartNet. #Succ. is the number of successfully executed shapes. Part CD is scaled by 10310^3; success rate, recall, precision and F1 are in %. Best results are in bold.

Method#Succ.Success ↑Part CD ↓Part NC ↑Recall ↑Precision ↑F1 ↑
MeshCoder [5]47694.46.720.62672.787.465.4
+ shape-level reward47694.46.100.62771.888.464.9
+ PartPO48696.44.740.64074.289.266.7

Table 5.

Aggregation over the Dataset

The success rate is the fraction of all test shapes whose program executes and produces part meshes. Part CD and Part NC are first averaged over the matched pairs within each shape and then over shapes; shapes without any match are excluded from these two metrics. Recall, precision and F1 are averaged over successfully executed shapes. Since F1 is computed per shape before averaging, the reported F1 is not the harmonic mean of the reported average precision and recall.

Additional Results

Tab. 5 extends Table 3 with the number of successfully executed shapes and F1. PartPO executes 486 of the 504 programs successfully, compared with 476 for both baselines, and achieves the highest F1. The shape-level reward slightly lowers F1 relative to MeshCoder, because its gain in precision is outweighed by the loss in recall, consistent with the observation in § 4.3 that whole-shape optimization alone does not improve the part decomposition.

Reconstruction Accuracy on Commonly Executed Shapes

In Table 1, CD and ANC are averaged over the shapes that each method executes successfully. Because the methods succeed on different subsets, a method could appear more accurate simply by failing on harder shapes. To rule this out, we recompute both metrics on the intersection of successfully executed shapes, i.e., the test shapes on which all five program-generating methods succeed: 2,505 shapes on ShapeNetCore and 362 on ABO. PrimitiveAnything is not included, since it predicts primitives rather than programs.

Table 6 shows that the conclusions hold on this common subset. PartPO achieves the best CD and ANC on both datasets, reducing the CD of MeshCoder from 2.49 to 1.03 on ShapeNetCore and from 2.33 to 1.29 on ABO. It also clearly outperforms the strongest baselines, SPO and the shape-level reward, whose CD remains between 1.73 and 1.93. The improvements of PartPO therefore come from more accurate reconstructions rather than from differences in which shapes are executed successfully.

Table 6. Reconstruction accuracy on the shapes that all program-generating methods execute successfully (2,505 ShapeNetCore and 362 ABO test shapes). CD is scaled by 10210^2. Best results are in bold.

MethodShapeNetCoreABO
CD ↓ANC ↑CD ↓ANC ↑
MeshCoder [5]2.490.8152.330.801
+ RFT2.420.8182.320.800
+ SPO1.840.8251.730.817
+ shape-level reward1.930.8321.810.814
+ PartPO1.030.8381.290.831

Table 6.

Validation of Prompt Tuning

The part-semantic reward relies on GT part points obtained from SAM 3 masks (§ 3.3). Here we evaluate how much prompt tuning improves these masks over prompting SAM 3 directly with part names.

Setup. MeshCoder releases the point clouds of its training data. We run MeshCoder on them and execute the generated programs, keeping only samples whose output mesh is within an L2 Chamfer distance of 10−310^{-3} from the input point cloud, so that the part labels given by the program blocks faithfully describe the shape. We merge fine-grained categories into three classes: chairs (armchair, bar chair, chair), lamps (lamp, desk lamp) and tables (dining table, cocktail table). From these classes, we randomly select 420 samples for training and 120 for testing, and render each sample without texture from six views. Each part of each category has its own set of offset parameters, trained separately on the (part name, mask) pairs of the views in which the part is visible. We use AdamW with a learning rate decayed from 5×10−45 \times10^{-4} to 5×10−65 \times10^{-6} by a cosine schedule, and train each set of parameters for 800 steps. We compare the prompt-tuned model with zero-shot SAM 3 prompted by the part names, using mIoU and mDice on the test views.

Results. As shown in Table 7, prompt tuning improves segmentation substantially on all three classes. The mIoU rises from 18.2% to 77.2% on chairs, from 22.6% to 65.4% on lamps, and from 59.6% to 93.6% on tables. Zero-shot SAM 3 struggles to map fine-grained part names to regions of untextured renders, whereas the tuned prompts align each name with the corresponding geometry. Lamps remain the most difficult class, likely because their parts are often thin or small. Since these test samples come from MeshCoder’s synthetic data, the evaluation measures segmentation quality in the training domain of the prompts; Sec. D evaluates the resulting 3D part points on real assets.

Table 7. Part segmentation of SAM 3 with zero-shot part-name prompts and with tuned prompts, on 120 test samples (six views each) rendered from MeshCoder outputs. Values are in %. Mean is the unweighted average over the three classes. Best results are in bold.

ClassmIoU ↑mDice ↑
Zero-shotTunedZero-shotTuned
Chairs18.277.220.481.9
Lamps22.665.423.269.8
Tables59.693.660.696.1
Mean33.578.734.782.6

Table 7.

Quality of Part Grounding

The part-semantic reward compares each generated part with GT part points obtained by segmenting rendered views of the GT mesh with the prompt-tuned SAM 3 and lifting the masks to 3D by multi-view voting (§ 3.3). Errors in these points directly mislead the reward. Sec. C evaluates the 2D masks on MeshCoder’s synthetic outputs; here we evaluate the resulting 3D part points on real assets against human part annotations, and measure how much multi-view voting contributes.

Evaluation data. We use the 667 ShapeNetCore training shapes that are also annotated in PartNet [25]: 264 chairs, 352 tables, 49 lamps and 2 sofas. Each shape is rendered without texture from the same six views as in training, three in each hemisphere. The tuned prompts use a fixed part vocabulary for each category (e.g., back, seat and leg for chairs, and table top, leg and stretcher for tables), whereas PartNet uses its own hierarchical part names. We therefore manually map each vocabulary part to the corresponding PartNet node names, e.g., back to chair_back and table top to tabletop. For a shape and a vocabulary part nn, we take the topmost PartNet nodes that match nn and use the union of their atomic meshes as the GT geometry of nn. A vocabulary part without a matching node is not evaluated on that shape, so each shape is evaluated only on the parts that it actually has and that correspond unambiguously. PartNet meshes are aligned with the procedure of Sec. A, using the ShapeNetCore mesh used for rendering as the reference, and we sample PartNet part points Pn\mathcal{P}_n densely and uniformly on the GT geometry of each part.

Lifting masks to 3D. For each part nn and view vv, SAM 3 predicts a mask with the tuned prompt of nn. We sample 10510^5 points uniformly on the mesh surface and compare two ways of assigning them to parts. The baseline, direct back-projection, assigns a point to part nn if it is visible and falls

inside the mask of nn in at least one view. It uses no cross-view aggregation or filtering, so a segmentation error in any single view, such as a mask that crosses a part boundary, is carried into 3D. Multi-view voting is the procedure of § 3.3 that produces the GT part points for training. It ignores observations at grazing angles and accepts a point only if at least Nmin⁡N_{\min} views, and at least a fraction τ\tau of the views that validly observe it, place it inside the mask. We use the same settings as in training, cmin⁡=0.2c_{\min}=0.2 and Nmin⁡=2N_{\min}=2. For a fair comparison, the points of each part are randomly subsampled to at most 2,048 for both methods, the same cap as in training.

Metric. Let X^n\hat{\mathcal{X}}_n be the lifted points of part nn. We measure the one-sided squared Chamfer distance from X^n\hat{\mathcal{X}}_n to the PartNet part points,

CD⁡→(X^n,Yn)=1∣X^n∣∑x∈X^nmin⁡y∈Yn∥x−y∥22(19)\operatorname{CD}^{\to}(\hat{\mathcal{X}}_n,\mathcal{Y}_n)=\frac{1}{\lvert\hat{\mathcal{X}}_n\rvert}\sum_{x\in\hat{\mathcal{X}}_n}\min_{y\in\mathcal{Y}_n}\lVert x-y\rVert_2^2 \tag*{(19)}

in the normalized frame in which the longest side of the bounding box spans [−1,1][-1,1]. This distance measures whether the points assigned to part nn actually lie on that part, i.e., the correctness of the GT part points, and the squared distance penalizes points far from the true part more heavily. We use a one-sided distance because the part-semantic reward treats these points as the location of the part: points assigned to the wrong part directly mislead the reward, whereas regions of the true part that are left uncovered, such as surfaces occluded in all views, matter much less.

Results. As shown in Table 8, multi-view voting reduces the distance on every category, from 0.574 to 0.302 on tables, from 0.963 to 0.421 on chairs and from 0.874 to 0.311 on lamps, and from 0.750 to 0.351 over all shapes, a reduction of 53%. Direct back-projection is least accurate on chairs and lamps, whose parts are often adjacent or thin, so that a mask crossing a part boundary in one view mislabels points of a neighboring part; voting removes most of these errors, and the three categories end up at a similar level. The overall distance after voting corresponds to a root-mean-square deviation of about 0.06, or 3% of the longest side of the bounding box. The GT part points used for training thus agree closely with human annotations on real assets, which complements the evaluation in the synthetic domain in Sec. C.

LiftingTableChairLampAll
Direct back-projection0.5740.9630.8740.750
Multi-view voting0.3020.4210.3110.351

Table 8. Quality of the GT part points on the 667 ShapeNetCore training shapes annotated in PartNet. Values are one-sided squared Chamfer distances from the lifted part points to the PartNet parts, scaled by 10210^2 (lower is better). All is the average over all 667 shapes, including two sofas. Best results are in bold.

References

  1. [1]Nicolas Carion, Laura Gustafson, Yuan-Ting Hu, Shoubhik Debnath, Ronghang Hu, Didac Suris Coll-Vinent, Chaitanya Ryali, Kalyan Vasudev Alwala, Haitham Khedr, Andrew Huang, et al. Sam 3: Segment anything with concepts. In International conference on learning representations, pages 138846–138923, 2026. 2, 5arxiv.org/abs/2511.16719
  2. [2]Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015. 3, 6arxiv.org/abs/1512.03012
  3. [3]Jasmine Collins, Shubham Goel, Kenan Deng, Achleshwar Luthra, Leon Xu, Erhan Gundogdu, Xi Zhang, Tomas F Yago Vicente, Thomas Dideriksen, Himanshu Arora, et al. Abo: Dataset and benchmarks for real-world 3d object understanding. In 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 21094–21104. IEEE, 2022. 3, 6arxiv.org/abs/2110.06199
  4. [4]Ganqu Cui, Lifan Yuan, Zefan Wang, Hanbin Wang, Yuchen Zhang, Jiacheng Chen, Wendi Li, Bingxiang He, Yuchen Fan, Tianyu Yu, et al. Process reinforcement through implicit rewards. arXiv preprint arXiv:2502.01456, 2025. 2
  5. [5]Bingquan Dai, Luo Li, Qihong Tang, Jie Wang, Xinyu Lian, Hao Xu, Minghan Qin, Xudong Xu, Bo Dai, Haoqian Wang, et al. Meshcoder: Ll­m-powered structured mesh code generation from point clouds. Advances in Neural Information Processing Systems, 38:8917–8954, 2026. 1, 2, 3, 6, 7, 8, 13, 14
  6. [6]Elisabetta Fedele, Boyang Sun, Leonidas Guibas, Marc Pollefeys, and Francis Engelmann. Superdec: 3d scene decomposition with superquadric primitives. In 2025 IEEE/CVF International Conference on Computer Vision (ICCV), pages 24625–24635. IEEE, 2025. 2arxiv.org/abs/2504.00992
  7. [7]Lang Feng, Zhenghai Xue, Tingcong Liu, and Bo An. Group-in-group policy optimization for llm agent training. Advances in Neural Information Processing Systems, 38:46375–46408, 2026. 3arxiv.org/abs/2505.10978
  8. [8]Jonas Gehring, Kunhao Zheng, Jade Copet, Vegard Mella, Quentin Carbonneaux, Taco Cohen, and Gabriel Synnaeve. RelF: Grounding code llms in execution feedback with reinforcement learning. arXiv preprint arXiv:2410.02089, 2024. 2arxiv.org/abs/2410.02089
  9. [9]Aaron Grattafiori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Alex Vaughan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024. 3arxiv.org/abs/2407.21783
  10. [10]Yandong Guan, Xilin Wang, Ximing Xing, Jing Zhang, Dong Xu, and Qian Yu. Cad-coder: Text-to-cad generation with chain-of-thought and geometric reward. Advances in Neural Information Processing Systems, 38:59765–59789, 2026. 1, 2arxiv.org/abs/2505.19713
  11. [11]Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Peiyi Wang, Qia­o Zhu, Runxin Xu, Ruoyu Zhang, Shirong Ma, Xiao Bi, et al. Deepseek-rl incentives reasoning in llms through reinforcement learning. Nature, 645(8081):633–638, 2025. 2
  12. [12]Yiran Guo, Lijie Xu, Jie Liu, Dan Ye, and Shuang Qiu. Segment policy optimization: Effective segment-level credit assignment in rl for large language models. Advances in Neural Information Processing Systems, 38:114399–114431, 2026. 2, 6arxiv.org/abs/2505.23564
  13. [13]Zhenyu Hou, Ziniu Hu, Yujiang Li, Rui Lu, Jie Tang, and Yuxiao Dong. Treerl: Llm reinforcement learning with on-policy tree search. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 12555–12369, 2025. 2arxiv.org/abs/2506.11902
  14. [14]Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021. 4arxiv.org/abs/2106.09685
  15. [15]Amirhossein Kazemnejad, Milad Aghajohari, Eva Portelance, Alessandro Sordoni, Siva Reddy, Aaron Courville, and Nicolas Le Roux. Vinpepo: Refining credit assignment in rl training of llms. arXiv preprint arXiv:2410.01679, 2024. 2arxiv.org/abs/2410.01679
  16. [16]Mukul Khanna, Yongsen Mao, Hanxiao Jiang, Sanjay Haresh, Brennan Shacklett, Dhruv Batra, Alexander Clegg, Eric Undersander, Angel X Chang, and Manolis Savva. Habitat synthetic scenes dataset (hssd-200): An analysis of 3d scene scale and realism tradeoffs for objectgoal navigation. In 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 16384–16393. IEEE, 2024. 3, 6
  17. [17]Maksim Kolodziazhnyi, Denis Tarasov, Dmitrii Zhemchuzhnikov, Alexander Nikulin, Ilya Zisman, Anna Vorontsova, Anton Konushin, Vladislav Kurenkov, and Danila Rukhovich. cadrile: Multi-modal cad reconstruction with reinforcement learning. arXiv preprint arXiv:2505.22914, 2025. 1, 2, 6
  18. [18]Hung Le, Yue Wang, Akhilesh Deepak Gotmare, Silvio Savarese, and Steven Chu Hong Hoi. Coderl: Mastering code generation through pretrained models and deep reinforcement learning. Advances in Neural Information Processing Systems, 35:21314–21328, 2022. 2arxiv.org/abs/2207.01780
  19. [19]Jiahao Li, Weijian Ma, Xueyang Li, Yunzhong Lou, Guichun Zhou, and Xiangdong Zhou. Cad-llama: leveraging large language models for computer-aided design parametric 3d model generation. In 2025 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 18563–18573. IEEE, 2025. 1, 2arxiv.org/abs/2505.04481
  20. [20]Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let’s verify step by step. In International Conference on Learning Representations, pages 39578–39601, 2024. 2arxiv.org/abs/2305.20050
  21. [21]Yuchen Lin, Chenguo Li, Panwang Pan, Honglei Yan, Feng Yiqiang, Yadong Mu, and Katerina Fragkiadaki. Partcrafter: Structured 3d mesh generation via compositional latent diffusion transformers. Advances in Neural Information Processing Systems, 38:35387–35415, 2026. 2arxiv.org/abs/2506.05573
  22. [22]Minghua Liu, Yinhao Zhu, Hong Cai, Shizhong Han, Zhan Ling, Fatih Porikli, and Hao Su. Partsliп: Low-shot part segmentation for 3d point clouds via pretrained image-language models. In 2023 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 21736–21746. IEEE, 2023. 3arxiv.org/abs/2212.01558
  23. [23]Minghua Liu, Mikaela Angelina Uy, Donglai Xiang, Hao Su, Sanja Fidler, Nicholas Sharp, and Jun Gao. Partfield: Learning 3d feature fields for part segmentation and beyond. In 2025 IEEE/CVF International Conference on Computer Vision (ICCV), pages 9704–9715. IEEE, 2025. 3arxiv.org/abs/2504.11451
  24. [24]Ziqi Ma, Yisong Yue, and Georgia Gkioxari. Find any part in 3d. In 2025 IEEE/CVF International Conference on Computer Vision (ICCV), pages 1–10. IEEE, 2025. 3
  25. [25]Kaichun Mo, Shilin Zhu, Angel X Chang, Li Yi, Subarna Tripathi, Leonidas J Guibas, and Hao Su. Partnet: A large-scale benchmark for fine-grained and hierarchical part-level 3d object understanding. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 909–918. IEEE, 2019. 6, 8, 12, 14arxiv.org/abs/1812.02713
  26. [26]Zhenyu Pan and Han Liu. Metaspatial: Reinforcing 3d spatial reasoning in vlms for the metaverse. In International Conference on Learning Representations, pages 117974–117993, 2026. 3arxiv.org/abs/2503.18470
  27. [27]Alexander Raistrick, Lingjie Mei, Karhan Kayan, David Yan, Yiming Zuo, Beijing Han, Hongyu Wen, Meenal Parakh, Stamatis Alexandropoulos, Lahav Lipson, et al. Infinigen indoors: Photorealistic indoor scenes using procedural generation. In 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 21783–21794. IEEE, 2024. 1, 3arxiv.org/abs/2406.11824
  28. [28]Juan Rodriguez, Haotian Zhang, Abhay Puri, Rishav Pramanik, Aarash Feizi, Pascal Wichmann, Arnab Mondal, Mohammad R Samsami, Rabiul Awal, Perouz Taslakian, et al. Rendering-aware reinforcement learning for vector graphics generation. Advances in Neural Information Processing Systems, 38:60496–60534, 2026. 2arxiv.org/abs/2505.20793
  29. [29]Danila Rukhovich, Elona Dupont, Dimitrios Mallis, Kseniya Cherenkova, Anis Kacem, and Djamila Aouada. Cad-recode: Reverse engineering cad code from point clouds. In 2025 IEEE/CVF International Conference on Computer Vision (ICCV), pages 9801–9811. IEEE, 2025. 2arxiv.org/abs/2412.14042
  30. [30]John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. 2arxiv.org/abs/1707.06347
  31. [31]Zhihong Shao, Peiyi Wang, Qihao Zhu, Runxin Xu, Junxiao Song, Xiao Bi, Haowei Zhang, Mingchuan Zhang, YK Li, Yang Wu, et al. Deepseekmath: Pushing the limits of mathematical reasoning in open language models. arXiv preprint arXiv:2402.03300, 2024. 2, 3arxiv.org/abs/2402.03300
  32. [32]Yonglong Tian, Andrew Luo, Xingyuan Sun, Kevin Ellis, William T Freeman, Joshua B Tenenbaum, and Jiajun Wu. Learning to infer and execute 3d shape programs. arXiv preprint arXiv:1901.02875, 2019. 2arxiv.org/abs/1901.02875
  33. [33]Peiyi Wang, Lei Li, Zhihong Shao, Runxin Xu, Damai Dai, Yifei Li, Deli Chen, Yu Wu, and Zhifang Sui. Mathshepherd: Verify and reinforce llms step-by-step without human annotations. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 9426–9439, 2024. 2
  34. [34]Ruiyu Wang, Yu Yuan, Shizhao Sun, and Jiang Bian. Text-to-cad generation through infusing visual feedback in large language models. arXiv preprint arXiv:2501.19054, 2025. 2arxiv.org/abs/2501.19054
  35. [35]Rui-Huan Wang, Si-Tong Wei, Jia-Qi He, Heng-Yi Wei, Baoquan Chen, and Peng-Shuai Wang. adsl: Agentic 3d creation via joint agent-program design. arXiv preprint arXiv:2608.17975, 2026. 2arxiv.org/abs/2608.17975
  36. [36]Rundi Wu, Chang Xiao, and Changxi Zheng. Deepcad: A deep generative network for computer-aided design models. In 2021 IEEE/CVF International Conference on Computer Vision (ICCV), pages 6752–6762. IEEE, 2021. 2arxiv.org/abs/2105.09492
  37. [37]Zeqiu Wu, Yushi Hu, Weijia Shi, Nouha Dziri, Alane Suhr, Prithviraj Ammanabrolu, Noah Smith, Mari Ostendorf, and Hannanah Hajishirzi. Fine-grained human feedback gives better rewards for language model training. Advances in neural information processing systems, 36:59008–59033, 2023. 2arxiv.org/abs/2306.01693
  38. [38]Jingwen Ye, Yuze He, Yanning Zhou, Yiqin Zhu, Kaiwen Xiao, Yong-Jin Liu, Wei Yang, and Xiao Han. Primitiveanything: Human-crafted 3d primitive assembly generation with auto-regressive transformer. In Proceedings of the Special Interest Group on Computer Graphics and Interactive Techniques Conference Conference Papers, pages 1–12, 2025. 2, 6, 7arxiv.org/abs/2505.04622
  39. [39]Qiying Yu, Zheng Zhang, Ruofei Zhu, Yufeng Yuan, Xiaochen Zuo, Yu Yue, Weinan Dai, Tiantian Fan, Gaohong Liu, Linjun Liu, et al. Dapo: An open-source llm reinforcement learning system at scale. Advances in Neural Information Processing Systems, 38:113222–113244, 2026. 2arxiv.org/abs/2503.14476
  40. [40]Junsheng Zhou, Jinsheng Wang, Baorui Ma, Yu-Shen Liu, Tiejun Huang, and Xinlong Wang. Uni3d: Exploring unified 3d representation at scale. In International Conference on Learning Representations, pages 46766–46782, 2024. 4arxiv.org/abs/2310.06773

Paper details

vlnc:W_jvbwmz4n
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Claude Sonnet 5.5 (bare)

View statement
Looking for related papers…
Contents