Shanghai Jiao Tong's CodePercept Beats 72B Models With an 8B Vision AI
Qwen team researchers show that scaling visual perception, not reasoning, unlocks STEM performance, and use executable code as ground-truth captions.
ProTakeaways
- Scaling analysis shows perception, not reasoning, is the real bottleneck in MLLM STEM performance.
- ICC-1M dataset provides 1M image-caption-code triplets built from three synthesis pipelines.
- Executable code replaces natural-language captions as ground truth, eliminating distillation hallucinations.
- Training uses SFT then GRPO with format, execution, semantic and visual-similarity rewards.
- CodePercept-8B-R1 scores 63.56 on STEM2Code-Eval, beating Qwen3-VL-Plus and Qwen3-VL-8B by 16.19 points.
- Repository at github.com/TongkunGuan/Qwen-CodePercept; weights coming soon.
A team from Shanghai Jiao Tong University and the Qwen Team just answered a question that has quietly dogged every multimodal model release: when an MLLM flunks a geometry problem or misreads a physics diagram, is it because it cannot see the picture, or because it cannot reason about what it sees? Their CVPR 2026 paper introduces CodePercept, and the answer changes how you should think about scaling vision-language models.
The team decoupled visual STEM reasoning into two stages, image-to-caption (perception) and caption-to-answer (reasoning), then scaled each one independently while holding the other fixed. Through a systematic scaling analysis, they reveal that perception is the true bottleneck limiting current STEM visual reasoning. Pouring more compute into the reasoning half gives diminishing returns; pouring it into perception keeps paying off.
Why natural language captions were the problem
The trouble with the standard recipe, distilling captions from a bigger MLLM, is that natural language is sloppy for STEM. A caption might say a triangle is isoceles when it is actually right-angled, or place a label on the wrong axis. Those small hallucinations become poison when a downstream solver treats them as ground truth. CodePercept introduces a paradigm shift: using executable code as a powerful perceptual medium. Because executable code provides precise semantics that naturally align with the structured nature of STEM visuals, it overcomes the hallucinations and "descriptive aphasia" inherent in natural language.
If a matplotlib script renders exactly the figure you are looking at, the script is the description, deterministically. There is no ambiguity about whether a line has slope 2 or slope 2.1.

ICC-1M: a million image-caption-code triplets
To operationalise the idea, the authors built ICC-1M, a dataset of over one million STEM Image-Caption-Code triplets. Data is synthesised through three pipelines:
- Image Reproduce: an MLLM is asked to write code that reconstructs a given STEM image, and the rendered output is checked against the original.
- Image Diversity: variations on the reconstruction code inject structural novelty while preserving STEM rigor.
- Solid Geometry Synthesis: because generating code for solid geometry requires a precise configuration of spatial relationships, a capability where current LLMs and MLLMs are notably deficient, the team fell back on hand-authored code templates parameterised by spatial configurations.
Two training tasks come out of this data. Code-Grounded Caption Generation uses the executable code as the ground truth for the caption, which sidesteps distillation hallucinations. STEM Image-to-Code Translation asks the model to regenerate the code from the image, forcing it to encode fine spatial and symbolic detail rather than wave its hands with natural language.
Two-stage training with an image-similarity reward
CodePercept is built on Qwen3-VL and trained in two stages. Stage one (CodePercept-S1) is supervised finetuning that jointly optimises captioning and image-to-code translation on ICC-1M. Stage two (CodePercept-R1) applies Group Relative Policy Optimization, the same RL algorithm used in DeepSeek-R1, but targeted specifically at code generation.
The reward has two parts. A format reward enforces valid Python syntax so the code actually runs. A content reward combines three signals:
- Whether the generated code executes without error.
- Code-level semantic equivalence, judged by GPT-4o.
- Image-level visual similarity between the rendered output and the target image.
That last term is the interesting one: the model gets gradient signal from whether its code actually draws the right picture, not just whether the tokens look plausible.

A benchmark that actually measures perception
Most STEM benchmarks are problem-solving suites, which conflate seeing and thinking. If a model gets a MathVision question wrong, you cannot tell which half failed. The authors introduce STEM2Code-Eval, a novel benchmark that directly evaluates visual perception in STEM domains. Unlike existing work relying on problem-solving accuracy as a proxy that only measures problem-relevant understanding, the benchmark requires comprehensive visual comprehension through executable code generation for image reconstruction, providing deterministic and verifiable assessment. It is a manually annotated set of 1,000 images scored by running the model's Python and comparing the rendered figure to the reference.
The numbers
On STEM2Code-Eval, CodePercept-8B-R1 achieves an average score of 63.56, significantly surpassing Qwen3-VL-8B-Instruct (+16.19) and even super-large models like Qwen3-VL-Plus. On the downstream reasoning side, CodePercept-8B-S1 outperforms Qwen2.5-VL-72B by 6.2 percent when paired with a strong LLM solver, meaning a well-perceived caption from an 8B model plus an off-the-shelf reasoner beats a 72B end-to-end model.
That is the real result: perception-focused training on a small model, decoupled from reasoning at inference time, can leapfrog a nine-times-larger monolith.
Where this helps, and where it does not
The paradigm is a strong fit for anything with structured, renderable visuals: geometry diagrams, function plots, circuit schematics, chemical structures, chart understanding, and scientific figures. If your pipeline currently pipes screenshots of matplotlib into GPT-4o and prays, the code-grounded route gives you a verifiable intermediate representation you can execute, diff, or edit.
Two caveats worth flagging. The solid-geometry pipeline had to fall back to hand-authored templates because current models cannot reliably code 3D spatial relations, so 3D perception is still shaky. And the benchmark rewards visual reconstruction fidelity, which is the right proxy for structured STEM figures but does not generalise to natural photographs, handwritten sketches, or anything where there is no canonical program that renders the scene.
Availability
The official repository is live with the STEM2Code benchmark folder and a model card, though the maintainers note that code and weights will be published soon rather than at release. The paper page on Hugging Face mirrors the arXiv preprint for discussion.