Introduction
Neural Architecture Search (NAS) has long promised to automate the design of high-performance deep learning models. However, traditional NAS methods often rely on human-defined search spaces—predefined sets of layers and connectivity patterns—which inherently limit the scope of discovery. While Large Language Models (LLMs) have demonstrated remarkable code-generation capabilities, they often lack the systematic optimization required to navigate complex architectural design spaces in a zero-shot or few-shot manner.
This paper introduces EvoPrompting, a framework that synergizes the creative potential of LLMs with the iterative rigor of evolutionary algorithms. By treating the LLM as an adaptive mutation and crossover operator, the researchers demonstrate that it is possible to discover novel, high-performing architectures that exceed the capabilities of human-designed experts.
The EvoPrompting Framework
EvoPrompting treats the LLM as the engine of a meta-learning loop. Unlike traditional evolutionary algorithms that use random mutations (such as swapping a single layer), EvoPrompting leverages the LLM's understanding of code structure to propose intelligent modifications. The process follows a four-step cycle:
- Initialization: The search begins with a small set of manually designed "seed" models written in Python (using frameworks like Flax or Haiku).
- Generation (Crossover/Mutation): A code-pretrained LLM (specifically a 62B parameter PaLM model) is provided with a prompt containing the best-performing models found so far. It is then tasked with generating new "child" architectures by combining or modifying these examples.
- Evaluation: These new models are trained from scratch on a target task. Their "fitness" is calculated based on a trade-off between validation accuracy and model size (parameter count).
- Selection & Tuning: The top-performing models are selected as "parents" for the next generation. Crucially, the LLM itself is prompt-tuned using the data from all evaluated models, effectively teaching the LLM to become a better architect as the search progresses.
Code-Level Search Spaces
By using an LLM, the search space moves from a rigid graph of predefined blocks to the "code-level." This allows the model to discover "minor tweaks" or entirely new ways of aggregating data that a human might not think to include in a standard NAS menu. The search space is essentially any valid Python code the LLM can produce, making the "vocabulary" of the model the only limit to its creativity.
Experimental Results
The researchers evaluated EvoPrompting on two distinct benchmarks to test its versatility and reasoning capabilities:
MNIST-1D
Used as a computationally efficient sandbox for rapid iteration, MNIST-1D is a one-dimensional version of the classic digit recognition task. In this environment, EvoPrompting successfully discovered convolutional architectures that were both smaller and more accurate than those designed by human experts.
CLRS Algorithmic Reasoning Benchmark
The CLRS suite consists of 30 classical algorithms (such as Quicksort, BFS, and Dijkstra’s) that require models to learn underlying logic to generalize to out-of-distribution (OOD) data. EvoPrompting achieved a new state-of-the-art (SOTA) on this benchmark, discovering novel Graph Neural Network (GNN) variants that outperformed the previous SOTA (the Triplet-GMPNN) on 21 out of 30 tasks.
Efficiency gains were particularly notable; for example, on the "Heapsort" task, the evolved model improved accuracy by over 125% compared to the baseline while maintaining or reducing the number of parameters.
Key Insights
- Evolution + Tuning: The paper finds that few-shot prompting alone is insufficient for complex NAS. The real performance gains stem from combining evolutionary selection (picking the best parents) with prompt-tuning (updating the model's internal weights to favor successful designs).
- Adaptive Operators: Unlike traditional evolution, the LLM acts as an adaptive operator. It learns which code structures lead to better performance and starts proposing those more frequently, making the search increasingly efficient over time.
Limitations and Future Work
While EvoPrompting represents a significant step forward, the authors acknowledge several hurdles. The computational cost of training hundreds or thousands of child models from scratch is high, making scaling to massive ImageNet-level models a resource-intensive prospect. Additionally, the open-ended nature of the search space makes it difficult to compare EvoPrompting directly to "closed" NAS benchmarks without handicapping the LLM's primary strength: its ability to write arbitrary code.
Future research may explore adapting this framework to other code-based design tasks, such as optimizing database queries or hardware configurations, where the combination of LLM creativity and evolutionary optimization could yield similar breakthroughs.
Summary updated