CAP: A Context-Aware Neural Predictor for NAS

Han Ji, Yuqi Feng, Yanan Sun

Abstract

Neural predictors are effective in boosting the time-consuming performance evaluation stage in neural architecture search (NAS), owing to their direct estimation of unseen architectures. Despite the effectiveness, training a powerful neural predictor with fewer annotated architectures remains a huge challenge. In this paper, we propose a context-aware neural predictor (CAP) which only needs a few annotated architectures for training based on the contextual information from the architectures. Specifically, the input architectures are encoded into graphs and the predictor infers the contextual structure around the nodes inside each graph. Then, enhanced by the proposed context-aware self-supervised task, the pre-trained predictor can obtain expressive and generalizable representations of architectures. Therefore, only a few annotated architectures are sufficient for training. Experimental results in different search spaces demonstrate the superior performance of CAP compared with state-of-the-art neural predictors. In particular, CAP can rank architectures precisely at the budget of only 172 annotated architectures in NAS-Bench-101. Moreover, CAP can help find promising architectures in both NAS-Bench-101 and DARTS search spaces on the CIFAR-10 dataset, serving as a useful navigator for NAS to explore the search space efficiently.

Introduction

Neural Architecture Search (NAS) automates the design of deep learning models, but the "performance evaluation" stage—where candidate architectures are trained to measure accuracy—is a massive computational bottleneck. To mitigate this, researchers use neural predictors to estimate performance based on graph structure. However, these predictors typically require large amounts of expensive annotated data (fully trained architectures) to achieve high accuracy.

The Context-Aware neural Predictor (CAP) addresses this challenge by leveraging the vast amount of unlabeled architectures available in search spaces. By employing self-supervised pre-training, CAP learns meaningful structural representations before any expensive training occurs, achieving state-of-the-art performance with up to 10x fewer annotated samples than previous methods.

Methodology

The CAP framework consists of three primary stages: architecture encoding, a context-aware self-supervised task, and performance prediction through fine-tuning.

The CAP framework: (a) Architecture Encoding, (b) Context-Aware Self-Supervised Task, and (c) Performance Prediction.

Architecture Encoding

Architectures are represented as graphs where nodes denote operations (e.g., 3x3 convolutions) and edges represent connections. These graphs are encoded using Graph Isomorphism Networks (GINs) to capture complex structural information.

Context-Aware Self-Supervised Task

Inspired by word embeddings in natural language processing, CAP extracts a "central subgraph" and its surrounding "context graphs" from unlabeled architectures. Using contrastive learning, the encoder is trained to match a subgraph with its own context while distinguishing it from others. This process allows the model to learn the "intrinsic topology" and structural "grammar" of the search space without requiring accuracy labels.

Performance Prediction

The pre-trained encoder is combined with a simple MLP regression head. This model is fine-tuned on a small set of annotated architectures using Bayesian Personalized Ranking (BPR) loss. Unlike standard regression, BPR loss focuses on correctly ranking architectures, which is the primary requirement for effective NAS.

Experimental Results

CAP was evaluated on major benchmarks including NAS-Bench-101, NAS-Bench-201, and the DARTS search space.

Kendall’s Tau ranking correlation vs. number of annotated architectures on NAS-Bench-101. CAP significantly outperforms baselines with fewer samples.

Efficiency and Ranking Performance

On NAS-Bench-101, CAP achieved a Kendall’s Tau of 0.709 with only 172 annotated samples, outperforming state-of-the-art predictors that required 424 samples. This demonstrates a significant reduction in the computational budget required for predictor training.

Search Speed and Accuracy

In the NAS-Bench-201 space, CAP completed the search process in just 16 seconds—over 80x faster than traditional reinforcement learning or evolutionary methods—while identifying architectures with superior accuracy. In the complex DARTS search space, CAP discovered a model with 97.58% accuracy on CIFAR-10, surpassing well-known methods like ENAS and standard DARTS.

Conclusion

CAP demonstrates that unlabeled structural data is a powerful resource for NAS. By focusing on the contextual relationships between operations, CAP learns generalizable representations that drastically reduce the need for expensive annotated data. While currently focused on cell-based search spaces, future work may extend this context-aware approach to larger, less constrained architectural units.

Summary updated

BibTeX
@inproceedings{ji2024cap,
  author = {Han Ji and Yuqi Feng and Yanan Sun},
  title = {{CAP: A Context-Aware Neural Predictor for NAS}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2024},
  url = {https://openreview.net/forum?id=AtwLUS4ASI},
}
Figure