SkillAgentSearch skills...

LLM4AD

LLM4AD: A Platform for Algorithm Design with Large Language Model

Install / Use

/learn @Optima-CityU/LLM4AD
About this skill

Quality Score

0/100

Category

Design

Supported Platforms

Universal

README

<div align="center"> <h1 align="center"> <img src="./assets/figs/logo.png" alt="LLM4AD Logo" style="width: 90%; height: auto;"> </h1> <h1 align="center"> LLM4AD: Large Language Model for Algorithm Design </h1>

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

Website | Documentation | Examples | GUI

</div> <br>

📖 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

<img src="./assets/figs/overview.png" alt="llm4ad" style="zoom:50%;" />

🔥 News

💡 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:

  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

<img src="./assets/figs/gui.gif" alt="llm4ad" style="zoom:80%;" />

📦 LLM4AD Search Methods

| Methods | Paper title | | --------------------------------- | ------------------------------------------------------------ | | EoH | Evolution of Heuristics: Towards Efficient Automatic Algorithm Design Using Large Language Model (ICML 2024)<br>Algorithm Evolution using Large Language Model (Arxiv 2023, AEL, the early version of EoH) | | MEoH | Multi-objective Evolution of Heuristic Using Large Language Model (AAAI 25) | | FunSearch | Mathematical Discoveries from Program Search with Large Language Models (Nature 2024) | | (1+1)-EPS <br/>(HillClimbing) | Understanding the Importance of Evolutionary Search in Automated Heuristic Design with Large Language Models (PPSN 2024) | | ReEvo | Reevo: Large language models as hyper-heuristics with reflective evolution (NeurIPS 2024) | | MCTS-AHD | Monte carlo tree search for comprehensive exploration in llm-based automatic heuristic design (ICML 2025) | | LHNS | LLM-Driven Neighborhood Search for Efficient Heuristic Design (CEC 2025) | | PartEvo

View on GitHub
GitHub Stars680
CategoryDesign
Updated6h ago
Forks79

Languages

Python

Security Score

95/100

Audited on Apr 6, 2026

No findings