INQUIRING LINE

When AI turns a picture into code, what should it be graded on: the final look, the meaning, or how clean the code is?

Which reward component matters most: pixel reconstruction, semantic similarity, or code efficiency?

This explores image-to-code reward design, where a model writes code that renders an image, chart or web page. It asks which reward signal does the most work: matching the rendered pixels, matching the meaning or layout, or rewarding clean, efficient code. The corpus has no head-to-head test of these three, but it says a fair amount about why rewarding the rendered result tends to beat rewarding the code itself, and why the combination matters more than any single winner.


This explores which reward does the most work when a model learns to turn images into code. The collection has no paper that ranks pixel match, semantic similarity and code efficiency against each other, and it has almost nothing on rewarding code efficiency. What it does show is a consistent pattern: rewarding what the code produces when it runs beats rewarding what the code looks like.

The clearest case is RRVF, which trains models only on how closely the rendered output matches the source image. It never compares against ground-truth code or text Can visual matching alone train image-to-code models without text?. The idea behind it is that checking whether a picture matches is much easier than writing the code that draws it, so the check can serve as a reliable training signal. The payoff shows up on charts the model never saw in training. The RRVF model kept 96% of its code runnable, while a model trained to copy reference code dropped from 69% to 49% Does visual reward training generalize better than code matching?. Rewarding exact code seems to teach the model to imitate. Rewarding the visual result seems to teach it what the code is for.

In practice, though, the strongest systems combine rewards and stage them. MSRL starts with cheap rule-based checks on the code text, then adds a costlier visual-similarity score from a multimodal model judge. Together these push chart-to-code results 6–10% past where supervised training stalls Can visual similarity rewards break the chart-to-code learning plateau?. Tool-use training shows the same split between "is it well-formed?" and "is it right?" Can reward decomposition beat supervised learning for tool use?. DRO adds a useful idea: some criteria work better as pass/fail gates than as points added to a score Can rubrics and dense rewards work together without hacking?. That suggests one answer to the code-efficiency question. Basic code checks such as "it runs" or "it isn't bloated" may work best as a filter that outputs must pass, while visual similarity does the actual optimizing.

The less obvious lesson is that any single reward has blind spots, and the model will find them. Every text-to-image reward model tested failed to penalize the same structural errors: warped shapes, duplicated objects and merged entities Do text-to-image rewards all miss the same structural flaws?. A pixel-match reward could plausibly score a render with the right colors but a broken layout as close enough. Reward hacking comes down to optimizing against a signal that only partly describes the task, whether the optimization happens through training, output selection or prompt rewriting Does reward hacking always stem from the same failure?. Another hazard: if a reward gives nearly the same score to every attempt on a prompt, the model gets little signal and drifts toward generic template outputs Why do language models collapse into generic templates?.

So the corpus's answer is that the output-side reward does the heavy lifting, meaning whether the render looks right. Its value depends on pairing it with signals that cover what it misses, with cheap checks or gates up front and a richer judge on top. Code efficiency is still an open gap in this collection.


Sources 8 notes

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.

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 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.

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.

Can rubrics and dense rewards work together without hacking?

DRO shows that using rubrics to accept or reject rollout groups—rather than converting rubric scores into dense rewards—prevents reward hacking. This separation preserves the categorical strength of rubrics while letting token-level rewards optimize within valid answers.

Show all 8 sources
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.

Why do language models collapse into generic templates?

When within-prompt reward variance is low, task gradients weaken and regularization dominates, pushing policies toward generic outputs. SNR-Aware Filtering—selecting high-variance prompts before updates—recovers performance across tasks and scales.

Papers this line draws on 8

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