MM Agent: LLMs as Agents for Real-world Mathematical Modeling Problems

🎯 Mathematical Modeling Agent • 📊 Automated Problem Solving
🤖 Intelligent Code Generation • 📈 End-to-End Workflow
📄 NeurIPS 2025 Paper •  💬 Join WeChat Group •  ⭐ Star Us
📰 News
-
2026-09-28 🎉 MM-Agent Expert v1.1.0 Released — Install Skills for Codex, Claude Code, and Cursor
数学建模专家 / Mathematical Modeling Expert packages three reusable skills for end-to-end mathematical modeling, reproducible computation, model validation, and editable LaTeX paper writing. 数学建模专家跨平台技能包已发布,包含统一专家入口、通用数学建模和美赛论文写作三项技能,支持在 Codex、Claude Code 和 Cursor 中安装使用。
👉 Repository & installation guide / 仓库与安装说明 · v1.1.0 downloads / 版本下载
npx skills add luckyfan-cs/mm-agent-expert --skill '*' -a codex -a claude-code -a cursor -g -yRequires Node.js/npm. Start a new session after installation, invoke 数学建模专家, and provide your problem and data. PDF compilation requires a LaTeX engine in the execution environment. 安装需 Node.js/npm;安装后新开会话,输入“使用数学建模专家”并提供题目和数据。PDF 编译需运行环境提供 LaTeX 编译器。
-
2026-09 🎉 MM-Agent Now Available on Work Buddy / MM-Agent 已上线 Work Buddy 🚀 Find MM-Agent in Work Buddy's Expert Skills (专家技能) under 数学建模专家|数模智研. 我们的 MM-Agent 已上线 Work Buddy!在 「专家技能」 中找到 「数学建模专家|数模智研」,即可体验。
-
2026-05 🎉 Open-source Demo Released / 开源 Demo 已发布 🚀 Deploy the upgraded mathematical modeling platform locally with the open-source demo, including the Next.js frontend, FastAPI backend, BYOK configuration, and E2B sandbox support. 欢迎使用开源 Demo 本地部署升级后的数学建模平台,包含 Next.js 前端、FastAPI 后端、BYOK 配置和 E2B 沙盒支持。 👉 使用说明 / Usage: demo/README.md
-
2026-01 🎉 Latest Demo Now Live / 最新演示已上线 🚀 Experience our upgraded mathematical modeling platform! Join our WeChat group to get your invitation code for early access. 欢迎加入我们的微信群获取邀请码,抢先体验升级后的数学建模平台! 👉 访问 /
Visit: http://cdn.mmagent.top/(Our demo link is no longer available due to server expiration. See the open-source demo above.) -
2026-01 ✨ DSLIGHTING: 全流程数据科学智能助手 / End-to-End Data Science Intelligent Assistant 🌟 支持完整的数据科学工作流,数学建模场景专用优化 / Supports complete data science workflow with specialized optimization for mathematical modeling scenarios 👉 访问 / Visit: https://github.com/usail-hkust/dslighting
-
2025-12 🔥 Upcoming Update: We will soon release the latest upgraded version of the demo. Please Star 🌟 our repository! We will issue service accounts based on the Star list (due to limited server capacity) to help everyone better prepare for the MCM/ICM contest. (即将更新:我们将很快发布最新升级版演示。请 Star 🌟 我们的仓库!由于服务器容量有限,我们将根据 Star 列表发放服务账号,帮助大家更好的备战美赛。)
-
2025-10 🚀 MM-Agent assisted two undergraduate teams in winning the Finalist Award (Top 2.0% among 27,456 teams) in MCM/ICM 2025, demonstrating its practical effectiveness as a modeling copilot. 🔗 在线体验 / Online Demo
-
2025-09 🎉 Our paper "MM-Agent: LLMs as Agents for Real-world Mathematical Modeling Problems" has been accepted to the NeurIPS 2025! 📄 Read the paper on arXiv
-
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
📖 Overview
We propose MM-Agent, a mathematical modeling system that simulates the real-world human process of solving mathematical problems. Inspired by expert workflows, our agent systematically analyzes unstructured problem descriptions, formulates structured mathematical models, derives solutions through autonomous code generation, and generates comprehensive analytical reports.
Our paper has been accepted by NeurIPS 2025 and is available on arXiv.
🎥 Demo Video
💡 Note: Click the link above to watch the demo on GitHub.
⚡ Core Features
🎯 End-to-End Mathematical Modeling Workflow
MM-Agent simulates the complete human process of mathematical modeling:
- 🧠 Problem Analysis - Understand problem background, objectives, and constraints
- 📐 Mathematical Modeling - Formulate mathematical models with appropriate assumptions
- 🧮 Computational Solving - Implement algorithms and optimization techniques
- 📝 Solution Reporting - Generate structured reports with clear interpretations
🚀 Core Capabilities
- Automated Model Selection - Intelligently selects appropriate mathematical models
- Interactive Data Analysis - Execute complex analysis with visualizations
- Intelligent Code Generation - Auto-generate and iteratively improve code
- Professional Paper Writing - Generate academic-quality reports automatically
- Project Management - Track and manage multiple modeling projects efficiently
🎥 Demo Walkthrough
1. Project Creation
Initialize your modeling workspace effortlessly.
2. Upload Problem & Data
Simply upload your problem statement and datasets.
3. Automated Modeling
The agent intelligently selects and builds mathematical models.
4. Data Analysis
Execute complex data analysis and generate visualizations.
5. Paper Writing
Auto-generate professional reports and academic papers.
6. Project Management
Track and manage multiple modeling projects efficiently.
🖼️ Framework Overview

🔬 Technical Details
How MM-Agent Works
The agent simulates a real-world mathematical modeling workflow through four structured stages:
-
🧠 Problem Analysis
- Understands problem background, objectives, data availability, and constraints
- Decomposes complex problems into manageable subtasks
-
📐 Mathematical Modeling
- Translates real-world problems into mathematical models
- Uses appropriate assumptions, formulations, and modeling techniques
- Retrieves suitable methods from the Hierarchical Mathematical Modeling Library (HMML)
-
🧮 Computational Solving
- Implements algorithms, simulations, and optimization techniques
- Autonomously generates and iteratively improves code using MLE-Solver
- Ensures efficient and accurate execution
-
📝 Solution Reporting
- Summarizes the full modeling process
- Interprets results and generates clear, structured reports
Key Innovation: HMML
Hierarchical Mathematical Modeling Library (HMML) - A tri-level knowledge hierarchy encompassing:
- Domains - High-level modeling categories
- Subdomains - Specialized modeling areas
- Method Nodes - 98 high-level modeling schemas
HMML enables both problem-aware and solution-aware retrieval of modeling strategies, supporting abstraction and method selection through an actor-critic mechanism.
🌐 Demo
Our demo is available at Hugging Face Spaces.
🧪 Open-source Demo
We provide a local-deployable open-source demo in demo/. It keeps the production-style web service structure, including the Next.js frontend, FastAPI backend, local SQLite storage, BYOK configuration, and one-command startup scripts.
Run it with:
bash demo/scripts/run.sh
This package removes committed secrets, public deployment hosts, invite-code scripts, backdoor account scripts, Redis/object-storage runtime state, logs, and historical outputs, while keeping the full local workflow structure.
👾 Currently Supported Models
- OpenAI:
gpt-4o - DeepSeek:
deepseek-R1
🚀 Quick Start
🔧 Running the Agent
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).
🖥️ Installation Guide
✅ Prerequisites
- Python 3.10 recommended
- Conda (optional but preferred)
💻 Setup Steps
- 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 LLM-MM-Agent
- Install Dependencies
pip install -r requirements.txt
🤝 Contact & Community
Join our WeChat group for updates and service support!
For questions and discussions, welcome to:
- 💬 WeChat Group: Scan the QR code above
- 📧 Email: Contact Us
- ⭐ Star us on GitHub and stay tuned!
📜 License
Source code is licensed under the CC BY-NC 4.0.
🌟 More Exciting Projects
If you find this project helpful, feel free to explore more of our work!
🔥 DSLIGHTING - End-to-End Data Science Intelligent Assistant
More Projects: usail-hkust
⭐ Star History
📚 References
@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}
}







