LLM4AD: A Platform for Algorithm Design with Large Language Model

Fei Liu, Rui Zhang, Zhuoliang Xie, Rui Sun, Kai Li, Qinglong Hu, Ping Guo, Xi Lin, Xialiang Tong, Mingxuan Yuan, Zhenkun Wang, Zhichao Lu, Qingfu Zhang

TL;DR

LLM4AD is a new unified Python platform designed to standardize and accelerate Large Language Model (LLM)-assisted algorithm design. By decoupling search methods, LLM interfaces, and evaluation tasks into modular blocks, it provides researchers with a robust, secure sandbox and a graphical user interface to easily develop, benchmark, and optimize algorithms across multiple domains.

What Problem Does This Paper Address?

Using LLMs to automatically write, optimize, and discover new algorithms (a field known as LLM4AD) has exploded in popularity over the last few years. However, the research community faces three major roadblocks:

  1. High Barrier to Entry: Building an automated algorithm design pipeline requires deep expertise in both evolutionary optimization and LLM engineering, forcing researchers to constantly reinvent the wheel.
  2. Pipeline Inconsistencies: Existing studies use fragmented codebases, different programming languages, and varied LLM querying strategies, making direct comparisons nearly impossible.
  3. Lack of Standardized Benchmarks: Without unified evaluation templates and default settings, it is difficult to fairly assess which LLM or search strategy truly performs best.

This paper introduces LLM4AD, an open-source Python library that bridges these gaps by providing a standardized framework, a secure evaluation environment, and a comprehensive suite of benchmark tasks.

Methods

The LLM4AD platform architecture is cleanly split into three core modular components:

Figure 1: LLM4AD platform overview.
  1. Search Methods: Instead of relying on a standalone LLM to generate a perfect algorithm in one shot, LLM4AD treats algorithm design as an iterative search problem. It maintains a population of candidate algorithms and evolves them over generations. The platform supports both single-objective and multi-objective search, integrating popular evolutionary strategies like Evolution of Heuristics (EoH), FunSearch, and traditional neighborhood searches (e.g., Tabu Search, Simulated Annealing).
  2. LLM Interface: A unified wrapper that supports both remote commercial APIs (like OpenAI's GPT, Claude, Qwen) and locally deployed open-source models (via transformers or vLLM). It also includes built-in parallel processing to speed up code generation.
  3. Task Evaluation Interface (Sandbox): Evaluating LLM-generated code is notoriously risky—untrusted code can contain infinite loops or malicious commands. LLM4AD implements a secure, isolated evaluation sandbox featuring strict runtime timeouts and safety features like protected division.

For users who prefer a no-code approach, the authors also developed a dedicated Graphical User Interface (GUI) to configure experiments, select models, and visualize optimization curves in real-time.

Figure 2: Graphical user interface (GUI) for LLM4AD.

Datasets and Tasks

Rather than evaluating on a single domain, LLM4AD includes a diverse collection of over 20 tasks (with plans to scale to over 160) spanning three major areas:

  • Optimization: Classic problems like the Traveling Salesman Problem (TSP), Vehicle Routing Problem (CVRP), and Online Bin Packing (OBP).
  • Machine Learning: Control tasks like Acrobot and Mountain Car, alongside computer vision and agent design problems.
  • Scientific Discovery: Modeling complex systems such as bacterial growth, nonlinear oscillators, and symbolic regression via the Feynman equations.
Table 1: Algorithm design tasks in LLM4AD.

For their baseline benchmarking, the authors selected a representative subset of 9 tasks to evaluate how different search methods and LLMs interact.

Key Insights and Ideas

  • Search is Mandatory, Not Optional: Simply prompting an LLM to generate an algorithm (random sampling) yields poor results. Coupling the LLM with an evolutionary search strategy (like EoH or FunSearch) drastically improves the quality of the discovered algorithms.
  • Coding Benchmarks Don't Predict Design Success: Surprisingly, an LLM’s performance on standard code-generation benchmarks (like HumanEval) does not strongly correlate with its success in automated algorithm design. Models with lower HumanEval scores often matched or beat stronger models when guided by the platform's search framework.
  • Diversity Control Matters: Algorithms like EoH and FunSearch consistently outperformed simpler greedy search variants because they actively maintain population diversity, preventing the LLM from getting stuck in local optima.

Key Results

The authors benchmarked 8 prominent LLMs (including GPT-4o-Mini, Llama-3.1-8B, Claude-3-Haiku, and Qwen-Turbo) across their standardized tasks.

Using a fixed budget of 2,000 function evaluations per run, the experiments revealed that while all methods easily solved simpler tasks like the Mountain Car problem, significant performance gaps emerged in complex scientific and combinatorial optimization tasks (like Nonlinear Oscillators and TSP). Crucially, the standard deviations of the top-performing models heavily overlapped, proving that LLM4AD successfully enables a wide variety of open- and closed-source models to be highly competitive.

Limitations and Future Work

While the core Python library is highly scalable, the current iteration of the GUI is limited to running a single method under a single LLM configuration at a time. The authors plan to extend the GUI to support batch experiments in future updates. Additionally, the team is actively expanding the task library from the initial 20+ tasks to a massive suite of over 160 benchmarks to further solidify LLM4AD as the definitive proving ground for automated algorithm design.

Summary updated

BibTeX
@misc{liu2024llm,
  author = {Fei Liu and Rui Zhang and Zhuoliang Xie and Rui Sun and Kai Li and Qinglong Hu and Ping Guo and Xi Lin and Xialiang Tong and Mingxuan Yuan and Zhenkun Wang and Zhichao Lu and Qingfu Zhang},
  title = {{LLM4AD: A Platform for Algorithm Design with Large Language Model}},
  year = {2024},
  eprint = {2412.17287},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.17287},
}
Figure