INQUIRING LINE

Why does one way of grading AI-written CAD code beat the other, even though both check for mistakes?

Why does geometric reward alone drive most of the accuracy gain over supervised learning?

This explores why, when AI models learn to write CAD code (the scripts that build 3D shapes), a reinforcement-learning reward that scores the shape the code actually produces does most of the work in beating models trained only on example code.


This explores why, in CAD code generation, a reward that checks the finished 3D shape (rather than the code text) accounts for most of the improvement over supervised fine-tuning. The core idea: supervised learning teaches a model to copy code that looks right, while a geometric reward teaches it to write code that builds the right thing, and those turn out to be quite different skills. In the CAD-Coder paper's own ablation, a model trained only on examples left the generated shapes far from their targets. Adding RL with a geometric reward cut that error by roughly three quarters, and chain-of-thought planning added a smaller gain on top. The CAD-RL work shows the same split from another angle: models trained only on example code already produced code that runs almost every time, but the shapes overlapped their targets only about half the time. The largest single jump in accuracy came when RL began optimizing the geometry directly Can task-specific rewards outperform general pretraining for CAD code?.

The main reason is that one shape can be built by many different scripts. Supervised learning penalizes every difference from the single reference script, including differences that don't change the result. A geometric reward runs the code and compares the output to the target, so it credits any correct construction. This shows up outside CAD too. Models rewarded for matching a rendered chart's appearance kept their code execution rate on a chart benchmark they had never seen, while supervised models trained to match exact code dropped from 69% to 49% Does visual reward training generalize better than code matching?. Tool use follows the same pattern: rewards that check format and correctness separately beat supervised learning by about 15% Can reward decomposition beat supervised learning for tool use?. In each case, the reward grades the result rather than the exact wording.

There is a less flattering explanation as well, and it matters. A strong line of work argues that reward-based training mostly draws out abilities the pretrained model already has rather than teaching new ones. Even a single training example, or a partly random reward, can trigger the gains What does reward learning actually do to model reasoning?. Some of RL's advantage may also come from what it quietly avoids. RL tends to skip the hardest training examples, the ones that push supervised models toward memorizing Why does RL generalize better than SFT to new domains?. Because RL learns from its own outputs, it also tends to sharpen what the model already does well instead of overwriting it, so it forgets less Why does reinforcement learning forget less than supervised fine-tuning?. So the geometric reward probably works partly because it measures the right thing, and partly because RL as a training method is gentler on what the model already knows.

The catch: a reward is only as good as what it can see. Text-to-image reward models all miss the same kinds of errors, such as distorted shapes, duplicated objects and merged entities Do text-to-image rewards all miss the same structural flaws?. More broadly, any score that only partly captures the task invites the model to game it, whether during training or when picking the best of several outputs Does reward hacking always stem from the same failure?. Geometric rewards are unusually hard to game because the shape either matches or it doesn't. That may be the deeper reason they work so well. Even then, a simple right-or-wrong reward can push models toward overconfident guessing, which an added calibration term can correct Does binary reward training hurt model calibration?.

The gap in the corpus: no study yet tests a geometric reward on its own against a reward that is merely carefully designed, or against a partly random one, in CAD. So we can't yet say how much of the gain comes from geometry specifically and how much from RL simply drawing out skills the pretrained model already had.


Sources 9 notes

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.

Does visual reward training generalize better than code matching?

On an unseen chart benchmark, RRVF-trained models maintained 96% code execution accuracy (down only 2 points from training data), while supervised fine-tuning dropped from 69% to 49%. The difference suggests rewarding visual match rather than exact code teaches more transferable principles.

Can reward decomposition beat supervised learning for tool use?

ToolRL decomposes rewards into binary format checking and correctness evaluation, achieving 17% improvement over base models and 15% over SFT on tool-use benchmarks. GRPO training outperformed PPO with the same reward design and generalized to unseen multi-hop QA.

What does reward learning actually do to model reasoning?

Research shows RLVR improves sampling efficiency within existing capability boundaries without expanding them. A single training example suffices for activation, and spurious rewards work nearly as well as correct ones for models with appropriate pretraining.

Why does RL generalize better than SFT to new domains?

RL achieves better OOD generalization not through algorithmic superiority but by implicitly down-weighting hard samples that drive gradient dominance and overfitting in SFT. Hard samples alone account for most of SFT's OOD degradation.

Show all 9 sources
Why does reinforcement learning forget less than supervised fine-tuning?

RL fine-tuning forgets significantly less than SFT across multiple LM families and tasks. The protective mechanism is on-policy sampling, which produces mode-seeking updates that preserve prior knowledge in multi-modal policies, whereas SFT's mode-covering updates erode all modes indiscriminately.

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 reward hacking always stem from the same failure?

Reward hacking arises during weight training, output selection, and prompt revision through a shared failure: optimization against signals that incompletely represent the actual task. The substrate matters less than the misalignment between the scoring function and ground truth.

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.