INQUIRING LINE

Could tweaking which words AI training pays attention to fix its struggle to turn chart images into accurate code?

Can token-level reweighting within SFT itself close the chart-to-code plateau?

This explores whether you could fix supervised fine-tuning's stall on chart-to-code tasks (turning a chart image into plotting code) by making the training loss count rare, important tokens like data values and colors more heavily, instead of switching to reinforcement learning.


This explores whether the chart-to-code plateau can be fixed inside supervised fine-tuning by weighting the important tokens more heavily, without switching to reinforcement learning. The short answer is that the corpus never tests this directly. What it does have suggests the idea fixes one cause of the plateau but probably not the deeper one.

The diagnosis comes from Why does scaling training data fail to improve SFT on chart-to-code?. Standard fine-tuning gives every token the same weight. A boilerplate line like `import matplotlib` counts as much as the one number that sets a bar's height or the hex code that sets its color. Adding more training data doesn't help, because the critical tokens stay rare compared with the boilerplate. Read literally, that sounds like an argument for token reweighting: if the problem is that the loss can't tell which tokens matter, tell it. The same note goes further, though, and claims that only reward-based RL can separate important tokens from unimportant ones. That claim is what your question challenges, and the corpus doesn't settle it either way.

Two results from other domains hint that reweighting inside fine-tuning is less hopeless than the plateau note implies. Why does RL generalize better than SFT to new domains? finds that much of RL's edge comes not from RL being a better algorithm but from what it quietly ignores: it down-weights the hard examples whose gradients dominate fine-tuning and cause overfitting. If a weighting effect explains much of RL's advantage, you could in principle reproduce some of it in fine-tuning on purpose. But that finding is about weighting whole examples, not individual tokens, and it was measured on generalization to new domains, not chart code. Meanwhile, Do larger SFT datasets actually cover rare solution methods? shows that in another setting, more data did close the gap by covering rare solution strategies. So 'scaling can't fix it' is not a universal rule. It depends on whether the rare part is a strategy you can collect more examples of, or a value that changes with every chart.

The bigger obstacle is that a chart's correctness is in the rendered picture, not in the code. Many different scripts draw the same chart, and a single wrong number can ruin a script that looks almost identical to the right one. However you weight the tokens, fine-tuning still rewards matching one reference script. That explains why Does supervised fine-tuning actually improve reasoning on optimization problems? finds that fine-tuning teaches output that looks right without being right. The approaches that actually broke the plateau all render the code and compare the images: Can visual similarity rewards break the chart-to-code learning plateau? adds 6–10% using a multimodal judge, Can rendering-based rewards improve chart code generation? fixes color and position errors with attribute-overlap and image-similarity rewards, and Can multimodal LLMs judge front-end code quality better than tests? does the same for web front-ends. Token reweighting can't see the rendered output, so it can't credit a different script that draws the right chart.

Rendering has its own risks, which is a good reason to keep testing the fine-tuning route. Do text-to-image rewards all miss the same structural flaws? shows that every visual reward model it tested misses some kinds of structural errors. And Why do language models collapse into generic templates? shows that RL drifts toward generic, one-size-fits-all outputs when its reward signal stops varying across attempts. The experiment the corpus is missing would compare fine-tuning with extra weight on numeric and styling tokens against rendering-based RL on a benchmark like ChartMimic. Until someone runs it, the best reading is that reweighting would probably reduce the plateau, and rewards based on the rendered image are what got past it.


Sources 9 notes

Why does scaling training data fail to improve SFT on chart-to-code?

SFT's per-token loss treats boilerplate code equally with rare but critical data values and styling parameters. Scaling training corpus does not overcome this structural limitation—the loss cannot differentiate token importance, only RL-based reward functions can.

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.

Do larger SFT datasets actually cover rare solution methods?

The paper shows that as SFT datasets scale, they represent more rare solution methods from the long-tailed distribution of strategies. These tail methods appear more often in evaluation and solve more questions as dataset size grows, suggesting coverage rather than bias is the limiting factor.

Does supervised fine-tuning actually improve reasoning on optimization problems?

Supervised fine-tuning makes model outputs look correct—proper JSON structure, valid identifiers, expected sections—without making them physically feasible. The model learns surface features of solutions, not the reasoning to construct valid ones.

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.

Show all 9 sources
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 multimodal LLMs judge front-end code quality better than tests?

ReLook trains a reward model on visual screenshots rather than unit tests, using a strict zero-reward rule for invalid renders to prevent reward hacking. It outperformed baselines across three benchmarks by embedding pixel-level visual judgment into the policy training loop.

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.

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.