README.md

March 6, 2026 ยท View on GitHub

LLM4AD Logo

LLM4AD: Large Language Model for Algorithm Design

Releases Maintenance PR's Welcome Python License Documentation Status Open In Colab

Website | Documentation | Examples | GUI


๐Ÿ“– 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

llm4ad

๐Ÿ”ฅ News

๐Ÿ’ก Features of our package

FeatureSupport / 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:

  1. Set host: 'api.deepseek.com'
  2. Set key: 'your api key'
  3. 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

๐Ÿ“ฆ LLM4AD Search Methods

MethodsPaper title
EoHEvolution of Heuristics: Towards Efficient Automatic Algorithm Design Using Large Language Model (ICML 2024)
Algorithm Evolution using Large Language Model (Arxiv 2023, AEL, the early version of EoH)
MEoHMulti-objective Evolution of Heuristic Using Large Language Model (AAAI 25)
FunSearchMathematical Discoveries from Program Search with Large Language Models (Nature 2024)
(1+1)-EPS
(HillClimbing)
Understanding the Importance of Evolutionary Search in Automated Heuristic Design with Large Language Models (PPSN 2024)
ReEvoReevo: Large language models as hyper-heuristics with reflective evolution (NeurIPS 2024)
MCTS-AHDMonte carlo tree search for comprehensive exploration in llm-based automatic heuristic design (ICML 2025)
LHNSLLM-Driven Neighborhood Search for Efficient Heuristic Design (CEC 2025)
PartEvoPartition to Evolve: Niching-enhanced Evolution with LLMs for Automated Algorithm Discovery (NeurIPS 2025)
LLaMEALLaMEA: A Large Language Model Evolutionary Algorithm for Automatically Generating Metaheuristics(IEEE TEVC 2025)
EoH-SEoH-S: Evolution of Heuristic Set using LLMs for Automated Heuristic Design (AAAI 2026)
MLESMultimodal LLM-assisted Evolutionary Search for Programmatic Control Policies (ICLR 2026)
OthersComing soon

โš™๏ธ LLM4AD Algorithm Design Tasks

AreaAlgorithm TaskPaper
Optimization[Online Bin Packing, Constructive heuristic]paper
Traveling Salesman Problem (TSP), Construct heuristicpaper
Traveling Salesman Problem (TSP), Guided local searchpaper
1-dimensional Bin Packing (BP1D), Construct heuristicpaper
2-dimensional Bin Packing (BP2D), Construct heuristicpaper
Capacitated Facility Location Problem (CFLP), Construct heuristicpaper
Knapsack Problem (KP), Construct heuristicpaper
Quadratic Assignment Problem (QAP), Construct heuristicpaper
Set Cover Problem (SCP), Construct heuristicpaper
Flow Shop Scheduling Problem (FSSP), Construct heuristicpaper
Flow Shop Scheduling Problem (FSSP), Guided local searchpaper
Bayesian Optimization, Cost-aware Acquisition Function Designpaper
Co-Bench: Benchmarking Language Model Agents in Algorithm Search for Combinatorial Optimizationpaper
Pymoo MOEA/Dpaper
Machine LearningAdversarial Attack, Attack strategypaper
Acrobot, Heuristic (Agent)
Cart Pole, Heuristic (Agent)
Mountain Car, Heuristic (Agent)
Science DiscoveryComputational fluid dynamics, Turbulence model designpaper
Bacteria Growth, Function
Oscillator, Equation
Stress & Strain, Equation
MathAdmissible Setspaper
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 History Chart

โ˜Ž๏ธ Contact

If you are interested in LLM4AD or if you encounter any difficulty using the platform, you can:

  1. Visit our website LLM4AD Web

  2. Visit our collection a collection of resources and research papers on LLM4AD

  3. Visit Discussions to connect with other members of our community

  4. Join our QQ Group

    LLM4AD Logo
  5. Contact us through email fliu36-c@my.cityu.edu.hk

  6. 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
Fei Liu
Kai Li
Kai Li
Rui Sun
Rui Sun
Julian XIE
Julian XIE
Shunyu Yao
Shunyu Yao
Rui Zhang
Rui Zhang
Weiwei Sun
Weiwei Sun
Zhi Zheng
Zhi Zheng
Qinglong Hu
Qinglong Hu