TL;DR
This paper introduces LLMatic, a novel Neural Architecture Search (NAS) algorithm that combines the code-generation capabilities of Large Language Models (LLMs) with Quality-Diversity (QD) optimization. LLMatic efficiently discovers diverse and high-performing neural network architectures by using LLMs to generate variations guided by QD algorithms, achieving competitive results with significantly fewer evaluations than prior methods.
What Problem Does This Paper Address?
Designing effective neural network architectures is a crucial but challenging task in deep learning. Traditional Neural Architecture Search (NAS) methods often require evaluating thousands of candidate architectures, which is computationally expensive and time-consuming. While LLMs show promise in generating code, they struggle to autonomously perform NAS due to their inability to test and learn from their own generated architectures. This paper addresses the need for a more efficient and intelligent NAS approach that can leverage the knowledge embedded in LLMs to guide the search for optimal architectures, while also ensuring diversity in the discovered solutions.
Methods
LLMatic employs a unique dual-archive Quality-Diversity (QD) optimization approach. It maintains two separate archives:
- Network Archive: Stores neural network architectures. Its behavioral descriptors are the width-to-depth ratio and Floating Point Operations per Second (FLOPS). The fitness is measured by the network's test accuracy after training.
- Prompt Archive: Stores prompts and their associated LLM temperatures. The behavioral descriptors are the prompt itself (encoded as an integer) and the temperature. The fitness of prompt individuals is determined by how well their generated networks perform relative to previous generations.
The core idea is to use LLMs (specifically CodeGen) to generate new network architectures based on prompts from the prompt archive. These generated networks are then evaluated and potentially added to the network archive. Simultaneously, the prompt archive is updated based on the performance of the generated networks. LLMatic uses a combination of mutation and crossover operators to explore and exploit the search space, with a higher probability assigned to mutation for better exploration. The temperature parameter of the LLM is dynamically adjusted to balance exploration and exploitation.
Datasets
- CIFAR-10: Used for evaluating LLMatic's performance in finding competitive neural network architectures.
- NAS-bench-201: A benchmark dataset that provides pre-computed evaluations for a vast search space of neural architectures, allowing for efficient comparison of NAS algorithms without retraining.
Key Insights and Ideas
- LLMs as Creative Architects: LLMs, when guided by a structured search process like QD, can be powerful tools for generating novel and effective neural network architectures, going beyond simple prompt-based generation.
- Quality-Diversity for NAS: Merging QD with LLM-driven generation is a potent combination. QD ensures a diverse set of high-performing architectures is discovered, which is crucial for robustness and understanding trade-offs, while LLMs provide the creative variation.
- Procedural LLM Usage: LLMatic avoids direct LLM prompting for NAS, instead using LLMs procedurally within a QD framework. This allows for more controlled and effective architecture generation.
- Efficiency through Guided Search: By leveraging LLMs and QD, LLMatic significantly reduces the number of architecture evaluations needed, achieving competitive results with only 2,000 evaluations on CIFAR-10.
- Component Importance: Ablation studies demonstrate that both the network archive and the prompt archive, along with the interplay between mutation and crossover, are critical for LLMatic's success.
Key Results
- On CIFAR-10, LLMatic achieved competitive network performance with only 2,000 evaluations, outperforming random search and other LLM-based NAS methods.
- On the NAS-bench-201 benchmark, LLMatic achieved near state-of-the-art results, demonstrating its ability to find high-ranking architectures across CIFAR-10, CIFAR-100, and ImageNet16-120 datasets.
- LLMatic discovered more than 20 competitive networks in the CIFAR-10 archive.
- Ablation studies showed that LLMatic's performance significantly degrades when either the network archive or the prompt archive is removed, highlighting the synergistic benefit of the dual-archive approach.
Limitations and Future Work
- LLM Size: The current implementation uses a 6.1B parameter CodeGen model. The authors suggest that using larger LLMs could unlock further performance gains.
- Computational Resources: While significantly more efficient than many NAS methods, the experiments were limited to 2,000 evaluations. Further exploration with more evaluations or larger search spaces could be beneficial.
- Generalization: The authors propose comparing LLMatic to other NAS methods on different computer vision and natural language processing tasks.
- Open-Ended Learning: LLMatic could be explored for open-ended learning scenarios.
- Neuroevolution Comparison: Given the similarities between NAS and neuroevolution, LLMatic could be tested on neuroevolution benchmarks.
Summary updated