Designing the perfect neural network architecture is often a game of "guess and check." This process, known as Neural Architecture Search (NAS), typically involves sampling thousands of candidate designs, training them (or using a proxy), and filtering out the duds. It’s computationally expensive and often feels like searching for a needle in a haystack.
In their ICLR 2024 paper, researchers from KAIST and DeepAuto.ai propose a paradigm shift: DiffusionNAG. Instead of searching through a massive space, why not just generate the high-performing architectures we want?
TL;DR
DiffusionNAG moves from searching for architectures to generating them using conditional graph diffusion models. By using property predictors to guide the diffusion process, it generates task-optimal architectures up to 35x faster than traditional methods while maintaining 100% architectural validity.
What Problem Does This Paper Address?
Traditional NAS methods suffer from two main bottlenecks:
- High Computational Cost: Training and evaluating thousands of architectures is slow. Even "predictor-based" NAS, which uses a model to estimate performance, usually uses that predictor passively to rank architectures after they've been sampled.
- Inefficient Exploration: In massive search spaces (like MobileNetV3, which has $10^{19}$ possibilities), random sampling or even evolutionary algorithms waste significant time on "task-irrelevant" architectures that have no hope of performing well.
Furthermore, existing graph-based generative models often treat neural networks as undirected graphs. However, neural networks are Directed Acyclic Graphs (DAGs)—the order and direction of data flow are critical. Ignoring this leads to the generation of "invalid" architectures that can't actually be executed.
Methods: The DiffusionNAG Framework
The authors introduce DiffusionNAG, a framework for Neural Architecture Generation (NAG).
1. Graph Diffusion for Architectures
The model represents a neural architecture as a DAG. It uses a forward diffusion process to gradually add Gaussian noise to the architecture's representation (its operations and adjacency matrix) until it becomes pure noise. The goal is to learn a "score network" that can reverse this process, turning noise back into a valid architecture.
2. Predictor Guidance (The "Secret Sauce")
The core innovation is Predictor-Guided Diffusion. Instead of just generating any architecture, DiffusionNAG uses the gradients from a pre-trained performance predictor (e.g., a model that predicts accuracy or latency) to steer the reverse diffusion process.
Think of it like a GPS: the diffusion model knows how to build a "house" (a valid architecture), and the predictor provides the coordinates for the "best neighborhood" (high accuracy). By combining the two, the model generates architectures that are both valid and high-performing.
3. A DAG-Aware Score Network
To ensure the generated graphs are valid computational flows, the authors designed a novel score network using Transformer blocks. It incorporates:
- Attention Masks: To enforce the dependency between nodes.
- Positional Embeddings: To capture the topological ordering of layers, ensuring the "input" stays at the beginning and the "output" at the end.
Datasets
The authors evaluated DiffusionNAG across several challenging benchmarks:
- NAS-Bench-201: A standard tabular benchmark for NAS.
- MobileNetV3 (MBv3) Search Space: A massive, layer-wise search space with approximately $10^{19}$ possible architectures.
- Downstream Tasks: Evaluation was performed on ImageNet 1K, CIFAR-10, CIFAR-100, Aircraft, and Oxford-IIIT Pets.
Key Insights and Ideas
- Active vs. Passive Predictors: In previous work, predictors were "judges" that sat at the finish line. In DiffusionNAG, predictors are "coaches" that guide the design process at every step of generation.
- Plug-and-Play Flexibility: Because the guidance happens during sampling, you can swap predictors without retraining the base diffusion model. Want a model that is robust to attacks instead of just accurate? Just swap the predictor.
- Validity is Key: By using positional embeddings, the model achieves 100% validity in generated architectures. Standard graph diffusion models often fail completely on this task, producing 0% valid architectures for complex spaces like MobileNetV3.
Key Results
- Massive Speedups: In "Transferable NAS" scenarios, DiffusionNAG achieved up to 35x speedup compared to baselines like MetaD2A and TNAS.
- Superior Performance: On the ImageNet 1K dataset within the MobileNetV3 search space, DiffusionNAG outperformed existing Bayesian Optimization (BO) approaches, finding higher-accuracy architectures in fewer steps.
- Efficiency in BO: When integrated into BO-based NAS, DiffusionNAG avoids the "initial waste" phase where BO typically samples low-quality architectures, leading to much faster convergence to high-accuracy designs.
Limitations and Future Work
While powerful, DiffusionNAG has a few areas for growth:
- Predictor Dependency: The quality of the generated architectures is inherently tied to the quality of the property predictor. If the predictor is inaccurate, the guidance will be misleading.
- Discrete vs. Continuous: The model currently diffuses in a continuous space and discretizes the result at the end. Exploring discrete diffusion (specifically designed for categorical data like operation types) could be a promising future direction.
- Multi-Objective Guidance: While the paper touches on robustness, more work could be done on guiding the model with multiple conflicting objectives (e.g., maximizing accuracy while minimizing both latency and energy consumption) simultaneously.
Code is available at: https://github.com/CownowAn/DiffusionNAG
Summary updated