[Paper Review] CodePercept: Code-Grounded Visual STEM Perception for MLLMs
This paper shows perception as the main bottleneck in STEM visual reasoning and presents CodePercept, a code-grounded framework with ICC-1M and STEM2Code-Eval to enhance visual perception via executable code.
When MLLMs fail at Science, Technology, Engineering, and Mathematics (STEM) visual reasoning, a fundamental question arises: is it due to perceptual deficiencies or reasoning limitations? Through systematic scaling analysis that independently scales perception and reasoning components, we uncover a critical insight: scaling perception consistently outperforms scaling reasoning. This reveals perception as the true lever limiting current STEM visual reasoning. Motivated by this insight, our work focuses on systematically enhancing the perception capabilities of MLLMs by establishing code as a powerful perceptual medium--executable code provides precise semantics that naturally align with the structured nature of STEM visuals. Specifically, we construct ICC-1M, a large-scale dataset comprising 1M Image-Caption-Code triplets that materializes this code-as-perception paradigm through two complementary approaches: (1) Code-Grounded Caption Generation treats executable code as ground truth for image captions, eliminating the hallucinations inherent in existing knowledge distillation methods; (2) STEM Image-to-Code Translation prompts models to generate reconstruction code, mitigating the ambiguity of natural language for perception enhancement. To validate this paradigm, we further 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, our benchmark requires comprehensive visual comprehension through executable code generation for image reconstruction, providing deterministic and verifiable assessment. Code is available at https://github.com/TongkunGuan/Qwen-CodePercept.
Motivation & Objective
- Identify whether perception or reasoning limits STEM visual reasoning in MLLMs through scaling analyses.
- Propose a code-grounded perception paradigm to improve visual understanding in STEM domains.
- Construct large-scale data and benchmarks to train and evaluate code-grounded perception.
- Demonstrate that code can match or surpass caption-based approaches for perception tasks.
Proposed method
- Decouple STEM visual reasoning into perception (image-to-caption) and reasoning (caption-to-answer) stages and independently scale each component.
- Ground perception in executable Python code by generating image-code-caption triplets; use code as a precise semantic medium.
- Create ICC-1M, a 1M+ image-caption-code dataset via three pipelines: image reproduction, image diversity, and solid geometry synthesis with templates.
- Propose STEM2Code-Eval, a 1,000-image benchmark where models generate executable code to reconstruct images, enabling deterministic perception evaluation.
- Train models with two Code-Grounded tasks: Code-Grounded Caption Generation and STEM Image-to-Code Translation, using supervised fine-tuning and reinforcement learning (GRPO) with explicit rewards.
- Employ a two-stage training regime (CodePercept-S1 and CodePercept-R1) to jointly learn captions and code generation, with code as a verifiable supervision signal.
Experimental results
Research questions
- RQ1Can perception be identified as the bottleneck in STEM visual reasoning for MLLMs?
- RQ2Does grounding perception in executable code improve visual understanding more effectively than traditional caption-based distillation?
- RQ3Can large-scale image-code-caption data (ICC-1M) and the STEM2Code-Eval benchmark reliably train and assess code-grounded perception?
- RQ4Do code-grounded tasks lead to measurable improvements in perception and executable-code accuracy across STEM domains?
Key findings
- Scaling experiments show perception improvements yield greater gains than scaling reasoning in STEM visual tasks.
- CodePercept achieves perceptual improvements by leveraging executable code as ground truth for image understanding and reconstruction.
- STEM2Code-Eval provides deterministic evaluation by requiring executable code that faithfully reproduces the image, enabling verifiable perception assessment.
- ICC-1M enables training of Code-Grounded Caption Generation and STEM Image-to-Code Translation, improving perception and precise code generation.
- Experimental results indicate CodePercept-based models outperform baselines on perception-oriented benchmarks and related code-generation tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.