Abstract
This paper introduces Code-Vision, a benchmark designed to evaluate the logical understanding and code generation capabilities of Multimodal Large Language Models (MLLMs). It challenges MLLMs to generate a correct program that fulfills specific functionality requirements based on a given flowchart, which visually represents the desired algorithm or process. Code-Vision comprises three subsets—HumanEval-V, Algorithm, and MATH—which evaluate MLLMs' coding abilities across basic programming, algorithmic, and mathematical problem-solving domains. Our experiments evaluate 12 MLLMs on Code-Vision. Experimental results demonstrate a significant performance gap between proprietary and open-source models. On Hard problems, GPT-4o achieves a 79.3% pass@1, while the best open-source model achieves only 15%. Further analysis reveals that Code-Vision poses unique challenges compared to existing multimodal reasoning benchmarks like MMCode and MathVista.
Introduction
While MLLMs have shown impressive feats in vision and coding separately, evaluating their combined ability to perform "visual reasoning for code generation" remains a challenge. Existing benchmarks often treat images as supplementary; for example, in the MMCode benchmark, many problems can be solved using only the text description, allowing models to ignore visual data entirely.
Humans frequently use flowcharts to conceptualize complex algorithms. If an AI is to be a truly useful coding assistant, it must be able to interpret these visual logic structures. The authors address this gap by creating a dataset where the flowchart is the primary source of truth—without understanding the image, the model cannot solve the problem.
Methodology
The researchers developed a rigorous three-step pipeline to construct the benchmark:
- Data Collection: High-quality programming tasks were gathered from LeetCode and HumanEval.
- Flowchart Construction: To ensure high-quality visuals, the researchers used GPT-4o to generate Mermaid (a text-based diagramming language) code from problem solutions. This code was then rendered into professional flowcharts. Every flowchart underwent manual review to ensure logical accuracy.
- Test Case Generation: Comprehensive test suites were generated for each problem, including typical scenarios, edge cases (such as zero or null inputs), and large-number inputs to test for efficiency and robustness.
Benchmark Composition
The Code-Vision benchmark consists of 438 problems divided into three specialized subsets:
- HumanEval-V: 164 basic programming tasks.
- Algorithm: 149 problems covering data structures and dynamic programming, categorized by difficulty (Easy, Medium, Hard).
- MATH: 125 problems focused on arithmetic, algebra, and symbolic manipulation.
Results and Analysis
The experimental results across 12 state-of-the-art MLLMs show a stark divide between proprietary and open-source performance.
Performance Gap
- Proprietary Dominance: GPT-4o is the clear leader, achieving an average score of 91.3% and maintaining high performance (79.3%) even on "Hard" problems.
- Open-Source Lag: Open-source models lag far behind. The top-performing open-source model, Llama-3.2-90B-Vision, reached only 36.9% overall. On the most difficult algorithmic tasks, the best open-source model achieved only 15% pass@1.
- Visual Reasoning vs. Mathematical Reasoning: When compared to the MathVista benchmark, open-source models saw a performance drop of approximately 30% on Code-Vision. This indicates that algorithmic logic is a significantly tougher visual challenge than mathematical reasoning for current open-source models.
Key Insights
- Failure Modes: Proprietary models usually understand the code structure but make subtle logical errors (leading to
AssertionError). Open-source models, however, often fail to produce valid code at all, struggling with basic syntax (SyntaxError) and variable types (TypeError). - The Mermaid Advantage: Models performed significantly better when given the raw Mermaid text instead of the rendered image. This suggests that the current bottleneck is not just logical reasoning, but the visual perception of complex, multi-node diagrams.
Conclusion
Code-Vision highlights a critical bottleneck in current MLLMs: the ability to translate visual logic into functional code. While proprietary models show strong capabilities, open-source models struggle with both visual perception and the subsequent code generation. Future work will focus on expanding the dataset with more complex logic and exploring ways to bridge the performance gap between proprietary and open-source systems.
Summary updated