📖 This is the English version of the README. 点击查看中文版
- 2025-07 🎉 Our paper "MM-Agent: LLMs as Agents for Real-world Mathematical Modeling Problems" has been accepted to the AI4MATH Workshop at ICML 2025! 📄 Read the paper on arXiv
We propose a Mathematical Modeling Agent that simulates the real-world human process of mathematical modeling. This agent follows a complete problem-solving pipeline:
- Problem Analysis
- Mathematical Modeling
- Computational Solving
- Solution Reporting
Our paper is available at arXiv.
A well-defined mathematical problem, where an agent solves a well-defined problem to obtain a solution. An open-ended mathematical modeling problem, where given an abstract application scenario or phenomenon, the agent first needs to formulate the mathematical problem before solving it and providing an end-to-end solution.
Figure 1: Traditional well-defined mathematics problem vs LLM-powered open-ended mathematical modeling problem.
The agent simulates a real-world mathematical modeling workflow through the following structured stages:
-
🧠 Problem Analysis Understands the background, objectives, data availability, and constraints of the problem.
-
📐 Mathematical Modeling Translates real-world problems into mathematical models using appropriate assumptions, formulations, and modeling techniques.
-
🧮 Computational Solving Implements algorithms, simulations, or optimization techniques to solve the models, often involving numerical computation.
-
📝 Solution Reporting Summarizes the full modeling process, interprets results, and generates a clear, structured report.
We propose MM-Agent, an end-to-end solution for open-ended real-world modeling problems. Inspired by expert workflows, MM-Agent systematically analyzes unstructured problem descriptions, formulates structured mathematical models, derives solutions, and generates analytical reports. Among these stages, the modeling step poses the greatest challenge, as it requires abstracting complex scenarios into mathematically coherent formulations grounded in both problem context and solution feasibility. To address this, we introduce the Hierarchical Mathematical Modeling Library (HMML): a tri-level knowledge hierarchy encompassing domains, subdomains, and method nodes. HMML encodes 98 high-level modeling schemas that enable both problem-aware and solution-aware retrieval of modeling strategies, supporting abstraction and method selection. Specifically, MM-Agent first analyzes the problem and decomposes it into subtasks. It then retrieves suitable methods from HMML and refines its modeling plans via an actor-critic mechanism. To solve the models, the agent autonomously generates and iteratively improves code using the MLE-Solver for efficient, accurate execution. Finally, it compiles a structured report summarizing the modeling approach, experimental results, and key insights.
Our demo is available at Hugging Face Spaces.
- OpenAI:
gpt-4o
- DeepSeek:
deepseek-R1
You can directly run the Mathematical Modeling Agent with:
python MMAgent/main.py --key "your_openai_key" --task "task_id"
Example:
python MMAgent/main.py --key "sk-XXX" --task "2024_C"
Here, task
corresponds to the problem ID from MM-Bench (e.g., "2024_C"
refers to the 2024 MCM problem C).
- Python 3.10 recommended
- Conda (optional but preferred)
- Clone the Repository
git clone git@github.com:usail-hkust/LLM-MM-Agent.git
- Create and Activate the Conda Environment
conda create --name math_modeling python=3.10
conda activate math_modeling
- Navigate to Project Directory
cd MM-Agent
- Install Dependencies
pip install -r requirements.txt
Source code is licensed under the [CC BY-NC].
@misc{mmagent,
title={MM-Agent: LLM as Agents for Real-world Mathematical Modeling Problem},
author={Fan Liu and Zherui Yang and Cancheng Liu and Tianrui Song and Xiaofeng Gao and Hao Liu},
year={2025},
eprint={2505.14148},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2505.14148}
}