Abstract
Large Multimodal Models (LMMs) have demonstrated impressive capabilities in general visual reasoning, yet they frequently struggle with structured mathematical domains like graph theory. This paper introduces VisionGraph, a comprehensive benchmark designed to evaluate LMMs on complex graph theory problems within a visual context. We identify that the primary bottleneck in solving these problems is visual perception rather than logical reasoning. To address this, we propose the Description-Program-Reasoning (DPR) framework, a neuro-symbolic approach that combines specialized perception with algorithmic code execution. Our results show that DPR significantly enhances the performance of models like GPT-4V, bridging the gap between raw visual input and precise mathematical solutions.
Introduction: The Challenge of Visual Graph Theory
While Large Multimodal Models (LMMs) like GPT-4V and Gemini have shown remarkable progress in general visual reasoning, they often stumble when faced with "visual math"—specifically graph theory. Solving a graph problem from an image requires two distinct, difficult steps:
- Accurate Perception: Identifying every node and edge (and their weights) without hallucinating or missing connections.
- Logical Reasoning: Applying multi-step algorithms (like Dijkstra's for shortest paths) to the perceived structure.
Existing benchmarks often focus on text-based graph problems. VisionGraph fills this gap by testing how well models can "see" a graph and then "think" through its properties. As shown in the following figure, even state-of-the-art models like GPT-4V frequently fail at basic edge recognition, which cascades into incorrect reasoning.
The VisionGraph Benchmark
To systematically evaluate LMMs, we developed the VisionGraph benchmark, which contains 5,902 problems across eight fundamental graph theory tasks, including Connectivity, Cycle Detection, Topological Sort, Shortest Path, Maximum Flow, Bipartite Graph Matching, Hamilton Path, and Graph Neural Networks (GNN) embedding updates. Problems are categorized into easy, medium, and hard levels based on the number of nodes (up to 25).
The Description-Program-Reasoning (DPR) Framework
We propose a novel "neuro-symbolic" approach called Description-Program-Reasoning (DPR). Instead of asking an LMM to solve a graph problem end-to-end, the DPR agent breaks the task into three stages:
- Description (Perception Enhancement): A smaller, specialized model (a fine-tuned LLaVA-7b) generates a precise textual description of the graph, such as an adjacency matrix. This offloads the difficult task of spatial perception.
- Program (Code Generation): GPT-4V uses the generated description to write a Python script implementing the relevant graph algorithm.
- Reasoning (Tool Invocation): The agent executes the code using an external Python interpreter to get a mathematically sound result, which is then formatted into a final answer.
Key Insights and Results
The VisionGraph benchmark reveals that most current LMMs fail significantly on complex visual graphs. For example, on the Shortest Path task, many models achieved 0% accuracy in zero-shot settings due to inaccurate mapping of weighted edges. However, the DPR framework provided a massive boost:
- Connectivity: GPT-4V (DPR) achieved 92.86% accuracy on easy problems, compared to 69.64% for the standard zero-shot model.
- Shortest Path: The DPR-equipped version reached a performance of 24.14% on easy sets—a significant jump from near-zero.
- Cycle Detection: Accuracy improved from ~49% to over 51% with DPR, with much higher reliability in the detailed paths provided.
Our analysis confirms that perception is the primary bottleneck. If a model misses a single edge, the entire reasoning chain fails. By forcing the model to generate code, we found that the logical accuracy of the reasoning process improved dramatically.
Limitations and Future Work
Despite the success of DPR, several challenges remain. The current benchmark has an uneven distribution of task types, and graphs are capped at 25 nodes to maintain visual legibility. Real-world graphs are often much larger and more complex. Future work will focus on more robust vision encoders specifically trained for structural data and exploring dynamic graphs that evolve over time.
Summary updated