MathGLM-Vision: Solving Mathematical Problems with Multi-Modal Large Language Model

Zhen Yang, Jinhao Chen, Zhengxiao Du, Wenmeng Yu, Weihan Wang, Wenyi Hong, Zhihuan Jiang, Bin Xu, Yuxiao Dong, Jie Tang · DOI

Introduction

While Large Language Models (LLMs) have achieved high proficiency in text-based mathematical reasoning, Multi-Modal Large Language Models (MLLMs) often struggle when problems involve visual elements such as geometric figures, coordinate planes, or statistical charts. Existing mathematical MLLMs frequently suffer from geometry bias, a lack of diverse training data, and a reliance on simple Visual Question Answering (VQA) formats that omit intermediate reasoning steps.

To address these challenges, the researchers introduced MathGLM-Vision, a family of MLLMs specifically optimized for diverse mathematical tasks. By leveraging the newly curated MathVL dataset—containing over 500,000 problems with detailed step-by-step solutions—MathGLM-Vision models significantly outperform general-purpose models like GPT-4o on complex K12-level mathematical benchmarks.

Methodology

MathGLM-Vision was developed by fine-tuning three backbone architectures: GLM-4V-9B, CogVLM2-19B, and CogVLM-32B. The training process incorporated several key innovations:

  • Detailed Chain-of-Thought Reasoning: Instead of simple answer pairs, the models were trained on comprehensive, step-by-step solutions generated via GPT-4o to enrich procedural knowledge.
  • Image Enhancement: Techniques such as "white border" padding and resolution enhancement were used to improve the recognition of small visual details in diagrams.
  • Balanced Fine-Tuning: To maintain general vision-language capabilities, specialized math data was mixed with 19 general-purpose VQA datasets during Supervised Fine-Tuning (SFT).

The MathVL Dataset and Benchmark

The authors introduced MathVL, a massive dataset comprising:

  1. Enhanced Open-Source Data (145k samples): Sourced from datasets like GeoQA+, Geometry3K, and ChartQA, augmented with detailed solutions.
  2. Chinese K12 Data (341k samples): A collection of real-world primary and secondary school problems covering arithmetic, algebra, geometry, statistics, and word problems.

For evaluation, the MathVL-test benchmark was established, consisting of 2,000 rigorous problems designed to test the limits of multi-modal reasoning.

Key Insights: The Role of Visual Context

A critical finding of this work is that visual context is often the core of a mathematical problem rather than a mere hint. Experiments demonstrate a massive performance drop in top-tier models when visual inputs are removed.

Impact of visual inputs and model fine-tuning on Top-1 Accuracy across different parameter scales.

As shown in the figure above, MathGLM-Vision models exhibit substantial gains over their backbone counterparts. Furthermore, the performance gap between "w/ visual inputs" and "w/o visual inputs" underscores the necessity of multi-modal integration for accurate mathematical deduction.

Experimental Results

MathGLM-Vision achieves state-of-the-art results across multiple benchmarks. On MathVL-test, the 32B variant reached 59.00% accuracy, surpassing GPT-4o (51.05%) and Gemini-1.5-Pro (52.03%).

Performance comparison of MathGLM-Vision against leading MLLMs on MathVL-test, MathVista, and specific mathematical categories.

The model's strength is particularly evident in its balanced performance across various mathematical domains. While many models excel only in geometry, MathGLM-Vision maintains high accuracy in statistics, algebra, and arithmetic. For instance, MathGLM-Vision-9B showed a 39.68% relative improvement over its backbone on the MathVista-GPS benchmark.

Error Analysis and Future Directions

Despite these advancements, error analysis reveals that 69.1% of failures are attributed to "Reasoning Errors"—situations where the model correctly interprets the image but fails the logical deduction. This suggests that the primary bottleneck for mathematical MLLMs is shifting from visual perception to logical reasoning.

Future work will focus on extending the architecture to handle problems requiring information from multiple diagrams and improving the underlying LLM's deductive capabilities to reduce reasoning errors.

Summary updated

BibTeX
@misc{yang2024mathglm,
  author = {Zhen Yang and Jinhao Chen and Zhengxiao Du and Wenmeng Yu and Weihan Wang and Wenyi Hong and Zhihuan Jiang and Bin Xu and Yuxiao Dong and Jie Tang},
  title = {{MathGLM-Vision: Solving Mathematical Problems with Multi-Modal Large Language Model}},
  year = {2024},
  eprint = {2409.13729},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.13729},
}
Figure