NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

MMCode: Benchmarking Multimodal Large Language Models for Code Generation with Visually Rich Programming Problems

Kaixin Li, Yuchen Tian, Qisheng Hu, Ziyang Luo, Zhiyong Huang, Jing Ma

Abstract

Programming often involves converting detailed and complex specifications into code, a process during which developers typically utilize visual aids to more effectively convey concepts. While recent developments in Large Multimodal Models (LMMs) have demonstrated remarkable abilities in visual reasoning and mathematical tasks, there is little work on investigating whether these models can effectively interpret visual elements for code generation. To this end, we present MMCode, the first multi-modal coding dataset for evaluating algorithmic problem-solving skills in visually rich contexts. MMCode contains 3,548 questions and 6,620 images collected from real-world programming challenges harvested from 10 code competition websites, presenting significant challenges due to the extreme demand for reasoning abilities. Our experiment results show that current state-of-the-art models struggle to solve these problems. The results highlight the lack of powerful vision-code models, and we hope MMCode can serve as an inspiration for future works in this domain.

Introduction

While Large Language Models (LLMs) have become remarkably proficient at generating code from text descriptions, real-world programming is rarely "text-only." Developers frequently use diagrams, flowcharts, trees, and mathematical plots to convey complex logic. Existing benchmarks for Code LLMs, such as HumanEval or MBPP, are strictly text-based, failing to capture this multimodal reality. Conversely, existing multimodal benchmarks focus on general reasoning or basic math, not the "long-horizon" reasoning required to turn a visual specification into executable, bug-free code. MMCode addresses this gap by providing a rigorous evaluation framework for the intersection of vision and programming.

The MMCode Evaluation Framework

To evaluate the capabilities of LMMs in this domain, the authors developed a robust four-stage pipeline to create a high-quality, "visually rich" programming dataset. This process involved crawling 10 popular programming contest websites (e.g., CodeForces, AtCoder, LeetCode), followed by automated filtering to remove problems without images or with broken assets. Expert coders then manually reviewed every image to ensure they provided actual problem-solving information rather than decorative "teaser" content.

The MMCode evaluation pipeline: models must interpret visual specifications and generate code that passes execution-based test cases.

Crucially, the evaluation is execution-based. Instead of using soft metrics like BLEU scores, the models' generated code is run against hidden test cases in a sandbox. A solution is only marked correct if it passes every single test case, ensuring a high standard of functional correctness.

Dataset Composition

The MMCode dataset consists of 3,548 questions and 6,620 images. The problems range from fundamental coding concepts to complex algorithmic challenges. To allow for fine-grained performance analysis, images were categorized into 12 distinct types.

Examples of the 12 visual categories in MMCode, ranging from abstract data structures like trees and graphs to spatial patterns and pseudocode.

These categories include Trees, Graphs, 2D/3D Geometry, Chessboards, Maps, Patterns, Math, Tables, and Pseudocode. This diversity ensures that models are tested on a wide variety of visual reasoning tasks common in software engineering and competitive programming.

Key Insights and Experimental Results

The experimental results highlight a significant "Vision-Logic" gap. While current LMMs can often identify elements in an image (e.g., a tree structure), they frequently fail to translate that visual understanding into the abstract logic required for code.

Performance Chasm

There is a massive performance gap between proprietary models and open-source alternatives. GPT-4V, the top performer, achieved a 19.4% pass rate (Pass@1). Gemini Pro Vision followed with a significantly lower pass rate of 5.0%. In contrast, open-source models like LLaVA-1.5 hovered around 1-2%, demonstrating a near-total inability to solve these visually grounded algorithmic problems.

The Impact of Visual Context

Interestingly, visual context is a double-edged sword. For GPT-4V, adding visual context improved performance on simpler types like Trees and Maps. However, for "cluttered" or complex categories, the images actually hurt performance compared to text-only prompts, likely due to visual noise. Furthermore, asking models to describe the image before coding (Captioning Chain-of-Thought) often led to a decline in pass rates, possibly due to hallucinations in the captions distracting the model from the core logic.

Conclusion and Future Work

MMCode reveals that even state-of-the-art LMMs struggle with long-horizon reasoning in multimodal coding tasks. The majority of failures stem from a fundamental "Problem Understanding" error—the models simply do not grasp the logic required, even if they correctly identify image components.

Future work should focus on developing specialized "Vision-Code" models trained on architectural diagrams and data structure visualizations. Expanding the benchmark to include languages beyond Python and exploring multi-agent systems to break down the visual-to-code pipeline are also promising directions for bridging the current performance gap.

Summary updated

BibTeX
@inproceedings{li2024mmcode,
  author = {Kaixin Li and Yuchen Tian and Qisheng Hu and Ziyang Luo and Zhiyong Huang and Jing Ma},
  title = {{MMCode: Benchmarking Multimodal Large Language Models for Code Generation with Visually Rich Programming Problems}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  url = {https://openreview.net/forum?id=XodQEAHup4},
}
Figure