Skip to content
 
 

Repository files navigation

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

Python PyTorch OpenAI License NeurIPS

Quick Start    Core Features    Paper    WeChat    Stars    Profile views

English · 中文版


MM-Agent Logo

🎯 Mathematical Modeling Agent  •  📊 Automated Problem Solving
🤖 Intelligent Code Generation  •  📈 End-to-End Workflow

📄 NeurIPS 2025 Paper  •&nbsp 💬 Join WeChat Group  •&nbsp ⭐ Star Us


📰 News

  1. 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
  2. 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.)
  3. 2026-01DSLIGHTING: 全流程数据科学智能助手 / 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
  4. 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 列表发放服务账号,帮助大家更好的备战美赛。)
  5. 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
  6. 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
  7. 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

▶️ Watch the 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:

  1. 🧠 Problem Analysis - Understand problem background, objectives, and constraints
  2. 📐 Mathematical Modeling - Formulate mathematical models with appropriate assumptions
  3. 🧮 Computational Solving - Implement algorithms and optimization techniques
  4. 📝 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

MM Agent Framework Overview

🔬 Technical Details

How MM-Agent Works

The agent simulates a real-world mathematical modeling workflow through four structured stages:

  1. 🧠 Problem Analysis

    • Understands problem background, objectives, data availability, and constraints
    • Decomposes complex problems into manageable subtasks
  2. 📐 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)
  3. 🧮 Computational Solving

    • Implements algorithms, simulations, and optimization techniques
    • Autonomously generates and iteratively improves code using MLE-Solver
    • Ensures efficient and accurate execution
  4. 📝 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

  1. Clone the Repository
git clone git@github.com:usail-hkust/LLM-MM-Agent.git
  1. Create and Activate the Conda Environment
conda create --name math_modeling python=3.10
conda activate math_modeling
  1. Navigate to Project Directory
cd LLM-MM-Agent
  1. 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

Stargazers repo roster for @usail-hkust/LLM-MM-Agent

Forkers repo roster for @usail-hkust/LLM-MM-Agent

Star History Chart


📚 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}  
}

About

🔥🔥🔥 [NeurIPS2025] MM-Agent: LLM as Agents for Real-world Mathematical Modeling Problem

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages