README.md
March 6, 2026 ยท View on GitHub
๐ Introduction
LLM4AD is an open-source Python-based Platform leveraging Large Language Models (LLMs) for Automatic Algorithm Design (AD). Please refer to the paper [LLM4AD] for detailed information, including the overview, methodology, and benchmark results.
LLM4AD is accomplished with Documents and Examples materials to support users and developers to easily test, build and deploy their own LLM4AD applications and conduct research.
LLM4AD was originally developed for optimisation tasks. The framework is versatile enough to be used in other areas, including machine learning, science discovery, game theory and engineering design.
For more information, see the contact list
๐ฅ News
-
2026.02 ๐๐ New Champion! Our LLM4AD system won the CVRPLib BKS competition and established 51 new Best Known Solutions on large-scale CVRP benchmarks.
-
2026.01 ๐๐ Our Survey Paper "A Systematic Survey on Large Language Models for Algorithm Design" has been accepted by ACM Computing Surveys ! A Rep for the Survey can be found here
-
2025.6 ๐๐ We're excited to share that EoH recently set a New World Record in Circle Packing Problem, achieving a score of 2.63594 for 26 circles ! Results here
-
2025.6 ๐๐ LLM4AD at CEC 2025 Tutorial !
-
2025.3 ๐๐ LLM4AD at EMO 2025 Tutorial !
-
2024.12 ๐๐ LLM4AD paper Released โLLM4AD: A Platform for Algorithm Design with Large Language Model" !
-
2024.11 ๐๐ LLM4AD v1.0 Released !
-
2024.10 ๐๐ Survey Paper โA Systematic Survey on Large Language Models for Algorithm Designโ is online !
๐ก Features of our package
| Feature | Support / To be supported |
|---|---|
| Unified Interfaces for methods, tasks, LLMs | ๐ฅSupport |
| Evaluation acceleration: multiprocessing evaluation | ๐ฅSupport |
| Secure Evaluation: main process protection, timeout interruption | ๐ฅSupport |
| Logs: local logs, Wandb and Tensorboard support | ๐ฅSupport |
| GUI: methods selection, tasks selection, convergence, best algorithm, ... | ๐ฅSupport |
| Resume run | ๐ฅSupport |
| Support other programming languages | ๐Coming soon |
| More search methods | ๐Coming soon |
| More task examples | ๐Coming soon |
๐ Requirements & Installation
Important
The Python version MUST be larger or equal to Python 3.9, and less than Python 3.13.
Important
If you are testing machine learning tasks or using GUI, please install gym via pip install gym.
Please note that the gym version may be conflict with your own Python environment, please refer to gym's docs to obtain appropriate version.
-
Please refer to requirements.txt
-
Please install
numba(if you want to use Numba accelerate) -
Please install
tensorboard(if you want to use a Tensorboard logger) -
Please install
wandb(if you want to use wandb logger) -
Please install
gym(if you want to try GUI, and Machine Learning tasks) -
Please install
pandas(if you want to try Science Discovery tasks) -
Please install all required packages in requirements.txt (if you want to use GUI)
Install LLM4AD locally
We suggest to install and run LLM4AD in conda env with python>=3.9, <3.13
$ cd LLM4AD
$ pip install .
Install LLM4AD using PiPy
We suggest to install and run LLM4AD in conda env with python>=3.9, <3.13
$ pip install llm4ad
๐ป Example Usage
Quick Start:
Note
Configure your LLM api before running the script. For example:
- Set
host: 'api.deepseek.com' - Set
key: 'your api key' - Set
model: 'deepseek-chat'
from llm4ad.task.optimization.online_bin_packing import OBPEvaluation
from llm4ad.tools.llm.llm_api_https import HttpsApi
from llm4ad.method.eoh import EoH, EoHProfiler
if __name__ == '__main__':
llm = HttpsApi(
host='xxx', # your host endpoint, e.g., api.openai.com, api.deepseek.com
key='sk-xxx', # your key, e.g., sk-xxxxxxxxxx
model='xxx', # your llm, e.g., gpt-3.5-turbo, deepseek-chat
timeout=20
)
task = OBPEvaluation()
method = EoH(
llm=llm,
profiler=EoHProfiler(log_dir='logs/eoh', log_style='simple'),
evaluation=task,
max_sample_nums=20,
max_generations=10,
pop_size=4,
num_samplers=1,
num_evaluators=1,
debug_mode=False
)
method.run()
More Examples:
Check Documents for more tasks and examples
GUI usage:
Important
Install all required packages in requirements.txt for GUI usage.
$ cd GUI
$ python run_gui.py
Check GUI Introduction for more information
๐ฆ LLM4AD Search Methods
โ๏ธ LLM4AD Algorithm Design Tasks
| Area | Algorithm Task | Paper |
|---|---|---|
| Optimization | [Online Bin Packing, Constructive heuristic] | paper |
| Traveling Salesman Problem (TSP), Construct heuristic | paper | |
| Traveling Salesman Problem (TSP), Guided local search | paper | |
| 1-dimensional Bin Packing (BP1D), Construct heuristic | paper | |
| 2-dimensional Bin Packing (BP2D), Construct heuristic | paper | |
| Capacitated Facility Location Problem (CFLP), Construct heuristic | paper | |
| Knapsack Problem (KP), Construct heuristic | paper | |
| Quadratic Assignment Problem (QAP), Construct heuristic | paper | |
| Set Cover Problem (SCP), Construct heuristic | paper | |
| Flow Shop Scheduling Problem (FSSP), Construct heuristic | paper | |
| Flow Shop Scheduling Problem (FSSP), Guided local search | paper | |
| Bayesian Optimization, Cost-aware Acquisition Function Design | paper | |
| Co-Bench: Benchmarking Language Model Agents in Algorithm Search for Combinatorial Optimization | paper | |
| Pymoo MOEA/D | paper | |
| Machine Learning | Adversarial Attack, Attack strategy | paper |
| Acrobot, Heuristic (Agent) | ||
| Cart Pole, Heuristic (Agent) | ||
| Mountain Car, Heuristic (Agent) | ||
| Science Discovery | Computational fluid dynamics, Turbulence model design | paper |
| Bacteria Growth, Function | ||
| Oscillator, Equation | ||
| Stress & Strain, Equation | ||
| Math | Admissible Sets | paper |
| coming soon ... |
๐ค LLM Interfaces
There are three approaches on LLM interface implementation, check Tutorial on LLM interface implementation for more information.
- Remote LLM API (e.g., GPT4o, GPT3.5, Gemini Pro, Deepseek ...) (<Recommended !!!>)
- Local HuggingFace LLM Deployment (e.g., Llamacode, Llama, Gemma, Deepseek, ...)
- Your Implementation If you want to use your own GPT API or local LLMs deployment, please create and add your interface in LLM
๐ซ Tutorial: How to Use LLM4AD to Solve Your Algorithm Design Task
A Step-by-step Tutorial on using LLM4AD to solve your algorithm design task is provided here
:question:QAs
Find responses to some common questions in our Discussion Area
๐ชช Licence
This project is licensed under the BSD-2-Clause - see the LICENSE file for details. Parts of this project use code licensed under the Apache License 2.0.
โจ Reference
If you find LLM4AD helpful please cite:
@article{liu2024llm4ad,
title = {LLM4AD: A Platform for Algorithm Design with Large Language Model},
author = {Fei Liu and Rui Zhang and Zhuoliang Xie and Rui Sun and Kai Li and Xi Lin and Zhenkun Wang and Zhichao Lu and Qingfu Zhang},
year = {2024},
eprint = {2412.17287},
archivePrefix = {arXiv},
primaryClass = {cs.AI},
url = {https://arxiv.org/abs/2412.17287},
}
๐ About LLM4AD
This platform is developed and maintained by LLM4AD developer group from the City University of Hong Kong (CityUHK) and the Southern University of Science and Technology (SUSTech). We develop LLM4AD platform for research purposes and hope to contribute to the research area by delivering tools for LLM-based algorithm design methods.
- Contribution: We are more than welcome to contribute (see our ๐ contribution guide) including developing code and ideas to improve our platform.
- Collaborations: If you like our platform, and you would like to use it for profit-making purposes? We are always searching for industrial collaborations because they help direct research to meet the industryโs needs.
- Issue: If you find a bug or you have any kind of concern regarding the correctness, please report us an issue.
- Profit Purpose: If you intend to use LLM4AD for any profit-making purposes, please contact us.
:star: Star Trends
โ๏ธ Contact
If you are interested in LLM4AD or if you encounter any difficulty using the platform, you can:
-
Visit our website LLM4AD Web
-
Visit our collection a collection of resources and research papers on LLM4AD
-
Visit Discussions to connect with other members of our community
-
Join our QQ Group
-
Contact us through email fliu36-c@my.cityu.edu.hk
-
Submit an issue
Contributors
Any new ideas, features, and improvements are welcomed!
You can contribute to LLM4AD follow our ๐ Contribution Guide.
Thank you for contributing to LLM4AD and welcome to being part of the LLM4AD community! :sparkles:
Fei Liu |
![]() Kai Li |
Rui Sun |
Julian XIE |
Shunyu Yao |
Rui Zhang |
Weiwei Sun |
Zhi Zheng |
Qinglong Hu |
