INQUIRING LINE

Can you train an AI coder to care not just that its code runs, but that the shape it builds is actually right?

How does reward supervision improve 3D geometric accuracy in code generation?

This explores how reward signals used in reinforcement learning help AI models write code (CAD scripts, floor plans, charts) whose output actually lands in the right shape and place in space, not just code that runs.


This explores how reward signals help code-generating models produce shapes and layouts that are geometrically right, not just code that runs. The most useful thing the corpus shows is that these are two separate skills. A model trained only on examples (supervised fine-tuning) quickly learns to write CAD code that executes. About 91% of its scripts run, yet the 3D object they build matches the target only about half the time. Adding step-by-step reasoning raises the match to 61%, and reinforcement learning pushes it to 72% Can CAD code be syntactically correct yet geometrically wrong?. Code that looks right and code that builds the right object come apart early in training. Rewards are what pull them back together.

The key trick is that you can run the code and measure the result. CAD-Coder executes each generated script, builds the 3D shape, and scores it by how far its surface sits from the target shape (Chamfer Distance). That score becomes the reward Can executing generated code measure CAD generation quality?. Its ablation shows how much the reward matters. Shape error drops from 74.55 with fine-tuning alone to 17.34 once the geometric reward is added, then to 6.54 with planning on top What drives CAD-Coder's improvement over supervised fine-tuning alone?. Planning seems to help because the same shape can be built many different ways, and reasoning lets the model find any correct route rather than copying one. CAD-RL goes further with three task-specific rewards and reaches 99.6% executability Can task-specific rewards outperform general pretraining for CAD code?.

The same pattern shows up outside CAD under different names. For floor plans, rewards computed directly from room connectivity, area, and feasibility cut layout errors by 94%, with no separate learned judge needed Can LLMs generate valid floor plans with verifiable structural rewards?. In chart-to-code work, models are rewarded for how closely the rendered chart matches the target image Can visual matching alone train image-to-code models without text?, Can rendering-based rewards improve chart code generation?, Can visual similarity rewards break the chart-to-code learning plateau?. The shared principle is that checking whether an output matches is much easier than producing it, so the check makes a cheap and honest teacher.

The corpus also points to what goes wrong without this kind of check. Layouts generated by GPT without verification were structurally flawed about 55% of the time Why do GPT-generated room layouts fail so often?. Learned reward models used in image generation all share a blind spot for geometric distortion and duplicated objects Do text-to-image rewards all miss the same structural flaws?. So geometry is exactly where a reward that measures the output beats a reward that predicts human taste. There is one caution: a single pass/fail reward can push models toward overconfident guessing Does binary reward training hurt model calibration?. That is a reason to prefer graded scores like shape distance over simple pass/fail signals.


Sources 11 notes

Can CAD code be syntactically correct yet geometrically wrong?

Supervised fine-tuning alone produces 91% executable CAD code but only 50% geometric IoU. Chain-of-thought reasoning raises IoU to 61%, while RL post-training pushes it to 72%, showing the two capabilities decouple during early training.

Can executing generated code measure CAD generation quality?

CAD-Coder trains LLMs to write executable CadQuery code, then uses GRPO with Chamfer Distance to the target shape as a geometric reward signal. This approach reduces mean Chamfer Distance to 6.54 and outperforms existing text-to-CAD systems while maintaining low code invalidity rates.

What drives CAD-Coder's improvement over supervised fine-tuning alone?

CAD-Coder's ablation shows SFT alone achieves Mean CD 74.55, adding GRPO jumps to 17.34, and including chain-of-thought reasoning reaches 6.54. The geometric reward directly optimizes 3D correctness, while planning helps capture equivalent solutions.

Can task-specific rewards outperform general pretraining for CAD code?

CAD-RL, trained with three domain-specific rewards and chain-of-thought guidance, achieves 99.63% executability and 78.7% geometric IoU under structured input, outperforming CAD-Coder by +8.3% IoU and +3.39% executability. This suggests hand-specified rewards can unlock latent reasoning in pretrained models for precise code generation.

Can LLMs generate valid floor plans with verifiable structural rewards?

Fine-tuning Llama-3.3-70B with supervised learning then GRPO using automatically computed connectivity, area, and feasibility rewards reduced Compatibility error 94% versus HouseDiffusion. The approach generates valid JSON floor plans by deriving reward signals directly from geometric and graph properties rather than training a separate reward model.

Show all 11 sources
Can visual matching alone train image-to-code models without text?

RRVF rewards MLLMs for how closely rendered code output matches the source image, not for matching ground-truth text or code. This leverages asymmetry-of-verification: checking if rendered output matches is easier than generating code, making visual similarity a tractable RL reward signal.

Can rendering-based rewards improve chart code generation?

ChartSimRL applies a two-part reward—Jaccard attribute overlap plus ResNet-18 visual similarity—to rendered chart images, addressing color and positioning errors that supervised fine-tuning alone cannot fix. This marks the first multimodal reward system for chart-to-code generation.

Can visual similarity rewards break the chart-to-code learning plateau?

MSRL pairs cheap rule-based textual rewards with costly MLLM-judged visual rewards comparing rendered code to ground-truth charts, improving ChartMimic and ReachQA scores by 6–10% beyond supervised-learning baselines. A two-stage curriculum applies textual rewards first, then adds visual feedback.

Why do GPT-generated room layouts fail so often?

About 55% of Holodeck's GPT-generated layouts contained structural flaws including under-population, clustering, and wrong object counts or orientations. OptiScene required manual filtering and correction before the layouts could train downstream models.

Do text-to-image rewards all miss the same structural flaws?

Every tested reward model—aesthetic, preference, and consistency-based—develops its own failure mode, but all consistently fail to penalize geometric distortions, object duplication, and entity blending. A lightweight adaptive reward model trained on human-judged artifact examples can fill this gap.

Does binary reward training hurt model calibration?

Binary correctness rewards incentivize high-confidence guessing because they don't penalize confident wrong answers. Adding the Brier score as a second reward term mathematically guarantees joint optimization of accuracy and calibration without trade-off.

Papers this line draws on 8

The research behind the notes this line reads — ranked by how closely each paper relates.