Image-Text-to-Text
Transformers
Safetensors
English
internvl_chat
feature-extraction
mathematics
reasoning
multi-modal-qa
math-qa
figure-qa
geometry-qa
math-word-problem
textbook-qa
vqa
geometry-diagram
synthetic-scene
chart
plot
scientific-figure
table
function-plot
abstract-scene
puzzle-test
document-image
science
conversational
custom_code
base_model: | |
- OpenGVLab/Mini-InternVL-Chat-2B-V1-5 | |
language: | |
- en | |
library_name: transformers | |
license: apache-2.0 | |
metrics: | |
- accuracy | |
pipeline_tag: image-text-to-text | |
# MathCoder-VL: Bridging Vision and Code for Enhanced Multimodal Mathematical Reasoning | |
Repo: [https://github.com/mathllm/MathCoder](https://github.com/mathllm/MathCoder) | |
Paper: [https://huggingface.co/papers/2505.10557](https://huggingface.co/papers/2505.10557) | |
## Introduction | |
We introduce MathCoder-VL, a series of open-source large multimodal models (LMMs) specifically tailored for general math problem-solving. We also introduce [FigCodifier-8B](https://huggingface.co/MathLLMs/FigCodifier), an image-to-code model. | |
| Base Model |Ours | | |
|-------------------------------------------------------------------|-----------------------------------------------------------------------| | |
| [Mini-InternVL-Chat-2B-V1-5](https://huggingface.co/OpenGVLab/Mini-InternVL-Chat-2B-V1-5) | [MathCoder-VL-2B](https://huggingface.co/MathLLMs/MathCoder-VL-2B) | | |
| [InternVL2-8B](https://huggingface.co/OpenGVLab/InternVL2-8B) | [MathCoder-VL-8B](https://huggingface.co/MathLLMs/MathCoder-VL-8B)| | |
## Usage | |
For training and inference code, please refer to [InternVL](https://github.com/OpenGVLab/InternVL). | |
**Example:** (Illustrative - adapt to your specific needs and refer to InternVL for details) | |
```python | |
from transformers import pipeline | |
pipe = pipeline("image-text-to-text", model="MathLLMs/MathCoder-VL-2B", device=0) #replace with your preferred model and device | |
image = "path/to/your/image.png" #replace with your image path | |
prompt = "What is the area of the shape in this image?" | |
result = pipe(image=image, text=prompt) | |
print(result) | |
``` | |
## Motivation | |
<div align="center"> | |
<img src="./examples/fig1.png" width="100%" title="Result Figure"> | |
</div> | |
## Construction of FigCodifier | |
<div align="center"> | |
<img src="./examples/fig2.png" width="100%" title="Result Figure"> | |
</div> | |
## Construction of MathCoder-VL | |
<div align="center"> | |
<img src="./examples/fig4.png" width="100%" title="Result Figure"> | |
</div> | |
## Performance | |
<div align="center"> | |
<img src="./examples/tab1.png" width="100%" title="Result Figure"> | |
</div> | |
## **Citation** | |
Please cite the paper if you use our data, model or code. | |
``` | |
@inproceedings{ | |
wang2025mathcodervl, | |
title={MathCoder-{VL}: Bridging Vision and Code for Enhanced Multimodal Mathematical Reasoning}, | |
author={Ke Wang and Junting Pan and Linda Wei and Aojun Zhou and Weikang Shi and Zimu Lu and Han Xiao and Yunqiao Yang and Houxing Ren and Mingjie Zhan and Hongsheng Li}, | |
booktitle={The 63rd Annual Meeting of the Association for Computational Linguistics}, | |
year={2025}, | |
url={https://openreview.net/forum?id=nuvtX1imAb} | |
} | |
``` | |
``` | |
@inproceedings{ | |
lu2025mathcoder2, | |
title={MathCoder2: Better Math Reasoning from Continued Pretraining on Model-translated Mathematical Code}, | |
author={Zimu Lu and Aojun Zhou and Ke Wang and Houxing Ren and Weikang Shi and Junting Pan and Mingjie Zhan and Hongsheng Li}, | |
booktitle={The Thirteenth International Conference on Learning Representations}, | |
year={2025}, | |
url={https://openreview.net/forum?id=1Iuw1jcIrf} | |
} | |
``` | |
``` | |
@inproceedings{ | |
wang2024mathcoder, | |
title={MathCoder: Seamless Code Integration in {LLM}s for Enhanced Mathematical Reasoning}, | |
author={Ke Wang and Houxing Ren and Aojun Zhou and Zimu Lu and Sichun Luo and Weikang Shi and Renrui Zhang and Linqi Song and Mingjie Zhan and Hongsheng Li}, | |
booktitle={The Twelfth International Conference on Learning Representations}, | |
year={2024}, | |
url={https://openreview.net/forum?id=z8TW0ttBPp} | |
} | |
``` |