Mobility-on-demand platforms, such as ride-hailing services, have become critical urban transportation infrastructures. They address unbalanced demand and supply by continuously executing decision-making processes.
Our proposed method integrates large language model (LLM) with mathematical optimization in a dynamic hierarchical system to optimize mobility operations. The hybrid LLM-optimizer framework decomposes the problem hierarchically, strategically embedding LLM only where human expertise bottlenecks exist:
- LLM as Meta-Objective Designer: Dynamically evolves strategic objectives via prompt-based harmony search, guided by feasibility feedback from the optimization solver.
- Optimizer as Constraint Enforcer: Solves operational routing layer with mathematical rigor, ensuring real-time feasibility.
- Heuristics as Prompt Evolver: Leverages harmony search algorithm to iteratively refine LLM prompts, guided by optimizer feedback to adaptively explore and converge toward effective meta-objectives
This hybrid approach combines the semantic richness of LLM with the structural robustness of traditional optimization, delivering solutions that outperform state-of-the-art baselines.
git clone https://github.com/yizhangele/llm-guided-mod-optimization.git
cd llm-guided-mod-optimizationconda env create -f dependencies.yml
conda activate llm-guided-mod-optimizationYou can also manually install the dependencies.
Note: This code depends on Gurobi (gurobipy), which requires a license.
- Academic users can request free academic licenses from Gurobi: Gurobi Academic License
- Commercial users need paid licenses.
- Update
config/env/.envwith the API access token for your chosen LLM hosting provider. - Depending on your chosen LLM model and hosting provider, you may need to implement your own code to formulate API requests and parse heuristics from API responses.
- Update all other configurations in
config/setting.cfg.
python testAll.pyThis project is licensed under the terms of the MIT license. See LICENSE.txt for details.
Note: Some dependencies, such as Gurobi, require separate licenses. Academic users can request free licenses for research purposes. Commercial users need paid licenses.
If you use this code in your research, please cite:
@inproceedings{llm-guided-mod-optimization,
title={Hierarchical Optimization via LLM-Guided Objective Evolution for Mobility-on-Demand Systems},
author={Yi Zhang, Yushen Long, Yun Ni, Liping Huang, Xiaohong Wang, Jun Liu},
booktitle={Conference on Neural Information Processing Systems (NeurIPS)},
year={2025}
}

