Many successes in deep learning(Krizhevsky et al., 2012; Goodfellow et al., 2014; Sutskever et al., 2014)
have resulted from novel neural network architecture designs. For example, in the field of image classification, research has produced numerous ways of combining neural network layers into unique architectures, such as inception modules(Szegedy et al., 2015)2016a), or dense connections (Huang et al., 2017). This proliferation of choices has fueled research into neural architecture search (NAS), which casts the discovery of new architectures as an optimization problem (Baker et al., 2017; Zoph & Le, 2016; Real et al., 2017; Elsken et al., 2018). This has resulted in state of the art performance in the domain of image classification (Zoph et al., 2018; Real et al., 2018; Huang et al., 2018), and has shown promising results in other domains, such as sequence modeling (Zoph & Le, 2016; So et al., 2019).
Unfortunately, NAS research is notoriously non-reproducible (Li & Talwalkar, 2019) and, furthermore, different methods are not comparable. First, source code is often not available for NAS algorithms and the training pipelines used in their evaluation, and second, some methods require months of compute time (e.g., Zoph et al., 2018), making these methods inaccessible to most researchers. While recent improvements (Liu et al., 2018a; Pham et al., 2018; Liu et al., 2018b)
have yielded faster methods, different methods are not comparable to each other due to different training procedures and different search spaces, which makes it hard to attribute the success of each method to the search algorithm itself. In contrast, the field of image classification has substantially benefited from common benchmarks, such as ImageNet(Deng et al., 2009), which permit easy comparisons across papers. Analogous datasets may likewise foster progress in NAS.
To address the issues above, this paper introduces NAS-Bench-101, the first architecture-dataset for NAS. To build it, we trained and evaluated a large number of different convolutional neural network (CNN) architectures on CIFAR-10(Krizhevsky & Hinton, 2009), utilizing TPU years of computation time. We compiled the results into a large table which maps 423k architectures with different graph connectivity to their accuracies, as well as other metrics obtained after training each architecture repeatedly. The resulting data defines a tabular surrogate benchmark (Eggensperger et al., 2015) that enables NAS experiments to be run via querying a table for arbitrary architectures instead of performing the usual costly train and evaluate procedure. This allows anyone to perform reproducible NAS experiments within seconds on a laptop, thereby making NAS research accessible to the broad research community. Moreover, the data and search space code is fully public111 The data and code is publicly available at https://github.com/google-research/nasbench, to foster reproducibility in the NAS community.
Because NAS-Bench-101 exhaustively evaluates a search space, it permits, for the first time, a comprehensive analysis of a NAS search space as a whole. We illustrate such potential by measuring search space properties relevant to architecture search. Finally, we demonstrate its application to the analysis of algorithms by benchmarking a wide range of open source architecture/hyperparameter search methods, including evolutionary approaches, random search, and Bayesian optimization.
In summary, our contributions are the following.
We introduce NAS-Bench-101, the first large-scale, open-source architecture dataset for NAS (Section 2);
We illustrate how to use the dataset to analyze the nature of the search space, revealing insights which may guide the design of NAS algorithms (Section 3);
We illustrate how to use the dataset to perform fast benchmarking of various open-source NAS optimization algorithms (Section 4).
2 The NASBench Dataset
The NAS-Bench-101 dataset is a table which maps neural network architectures to their training and evaluation metrics. Most NAS papers to date have trained models on the CIFAR-10 classification set(Krizhevsky & Hinton, 2009) because its small images allow relatively fast neural network training. Furthermore, models which perform well on CIFAR-10 tend to perform well on harder benchmarks, such as Imagenet and COCO, simply by scaling them up (replicating the learned graph structure multiple times; Zoph et al., 2018). For these reasons, we also use CNN training on CIFAR-10 as the basis of NAS-Bench-101.
Similar to other NAS papers, we restrict our search for neural net topologies to the space of small feedforward structures, usually called cells
, which we describe below. We stack each cell 3 times, followed by a downsampling layer, in which the image height and width are halved via max-pooling and the channel count is doubled. We repeat this pattern 3 times, followed by global average pooing and a final dense softmax layer. The initial layer of the model is astem consisting of one convolution with
output channels. All convolutions utilize batch normalization(Ioffe & Szegedy, 2015)
followed by ReLU activation(He et al., 2016b). See Figure 1
, top-left, for an illustration of the overall network structure. Note that having a stem followed by 3 stacks of cells is a common pattern both in hand-designed image classifiers(He et al., 2016a; Huang et al., 2017; Hu et al., 2018) and in NAS search spaces for image classification.
The space of cell architectures consists of all possible directed acyclic graphs (DAGs) on nodes, where each possible node has one of labels, representing the corresponding operation. Two of the vertices are specially labeled as operation IN and OUT
, representing the input and output tensors to the cell, respectively. Unfortunately, this space of labeled DAGs grows exponentially in bothand . In order to limit the size of the space to allow exhaustive enumeration, we impose the following constraints:
We set , using only the following operations:
convolution batch-norm ReLU
convolution batch-norm ReLU
We limit .
We limit the maximum number of edges to .
These constraints were chosen to ensure that the search space still contains ResNet-like and Inception-like cells (He et al., 2016a; Szegedy et al., 2016). An example of an Inception-like cell is illustrated in Figure 1, top-right. We intentionally use convolutions instead of separable convolutions to match the original designs of ResNet and Inception, although this comes as the cost of being more parameter-heavy than some of the more recent state-of-the-art architectures like AmoebaNet (Real et al., 2018) which utilize depthwise-separable convolutions.
2.2 Cell encoding
There are multiple ways to encode a cell and different encodings may favor certain algorithms by biasing the search space. For our experiments, we chose to use a very general encoding: a 7-vertex directed acyclic graph, represented by a upper-triangular binary matrix, and a list of 5 labels, one for each of the 5 intermediate vertices (recall that the input and output vertices are fixed). Since there are 21 possible edges in the matrix and 3 possible operations for each label, there are total unique individuals in this encoding.
However, a large number of individuals in this space are invalid (i.e., there is no path from the input vertex, or the number of total edges exceeds 9). Furthermore, different graphs in this encoding may not be unique for two reasons. First, some graphs may contain vertices which do no lie on a path from the input to the output. Such vertices do not affect the computation performed within the cell and thus the cell is equivalent to the smaller graph with the irrelevant vertices pruned. Second, graphs may be isomorphisms of each other: there exists some permutation of vertices that makes the graphs identical. For purposes of neural network training, we process only one canonical graph in every equivalence class of isomorphic graphs. The method which we used to identify and enumerate unique graphs is described in Supplement S1. After de-duplication, there are approximately 423k unique graphs in the search space.
2.3 Combine semantics
Translating from the graph to the corresponding neural network is straightforward, with one exception. When multiple edges point to the same vertex, the incoming activations must be combined. Adding them or concatenating them are both standard techniques. We wanted to support both so that the search space would include ResNet-type and Inception-type cells alike, but adding this binary choice would have doubled the size of the search space. Instead, we adopted the following fixed rule: activations going to the output vertex are concatenated and those going into other vertices are summed. The output tensors from the input vertex are projected in order to match the expected input channel counts of the subsequent operations. This is illustrated in Figure 1, bottom-right. With this approach, both ResNet-type and Inception-type networks can be included in the space, and the size of the space is kept tractable as there is no ambiguity on how channels counts are determined.
The training procedure forms an important part of an architecture search benchmark, since different training procedures can lead to very substantial performance differences; indeed, for many published NAS papers it is unclear how much of the reported performance was due to the architecture and how much was due to improved training procedures. To counter this issue and allow comparisons of NAS algorithms on equal grounds, we designed and open-sourced a single general training pipeline for all models in the dataset.
Choice of hyperparameters. We utilize a single, fixed set of hyperparameters for all NAS-Bench-101 models. This set of hyperparameters was chosen to be robust across different architectures by using a coarse grid search optimizing the average accuracy of a set of 50 randomly-sampled architectures from the space. This is similar to standard practice in the literature (Zoph et al., 2018; Liu et al., 2018a; Real et al., 2018), but is further justified by our experimental analysis in Section 5.1.
Implementation details. All models are trained and evaluated on CIFAR-10 (Krizhevsky & Hinton, 2009) (40k training examples, 10k validation examples, 10k testing examples), using standard data augmentation techniques (He et al., 2016a). The learning rate is annealed via cosine decay (Loshchilov & Hutter, 2017)2012)
on the cross-entropy loss with L2 weight decay. All models were trained on the TPU v2 accelerator. The code, implemented in TensorFlow, along with all chosen hyperparameters, is publicly available athttps://github.com/google-research/nasbench.
3 repeats and 4 epoch budgets. We repeat the training and evaluation of all architectures 3 times to obtain a measure of variance. Also, in order to allow the evaluation of multi-fidelity optimization methods, e.g., Hyperband (Li et al., 2018)
), we trained all our architectures with four increasing epoch budgets:epochs. In each case, the learning rate is annealed to 0 by epoch .222 Instead of 4 epoch budgets, we could have trained single long runs and used the performance at intermediate checkpoints as benchmarking data for early stopping algorithms. However, because of the learning rate schedule, such checkpoints would have occurred when the learning rates are still quite high, leading to very noisy accuracies that do not correlate well with the final performance. We provide some data for this by evaluating each model at the halfway point of training in addition to the end. We thus trained models for each value of , and thus models overall.
We evaluated each architecture after training three times with different random initializations, and did this for each of the budgets mentioned above. As a result, the dataset is a mapping from the tuple to the following quantities:
training time in seconds; and
number of trainable model parameters.
Of course, only measures on the training and validation set should be used to search models within a single NAS algorithm, and testing accuracy should only be used for an offline evaluation. The training time metric allows benchmarking algorithms that optimize for accuracy while operating under a time limit (Section 4) and also allows the evaluation of multi-objective optimization methods. Moreover, beyond benchmarking, the dataset can also be used for studying intrinsic properties of the search space (Section 3).
2.6 Benchmarking methods
One of the central purposes of the dataset is to facilitate the benchmarking of NAS algorithms. NAS algorithms should find architectures that attain high accuracy at the end of their training, as measured by their testing accuracy at epoch . To do this, they can repeatedly query the dataset at pairs, where is an architecture in the search space and is an allowed number of epochs (recall: ). Each query does a lookup using a random trial index, drawn uniformly at random from , to simulate the stochasticity of SGD training.
During search, we keep track of the best architecture the algorithm has found after each function evaluation , as ranked by its validation accuracy. Afterwards, in an off-line step, we query the corresponding test accuracy for that model (taking means across our three test evaluations; should never be used to guide the search algorithm itself, as to not overfit to the test data). Then we compute the immediate test regret: , where denotes the model with the highest mean test accuracy in the entire dataset. This regret becomes the score for the search run. We carry out many independent runs and consider summary statistics over their regrets.
Because we stored the actual training time for each architecture, we are able to plot the regret for an algorithm as a function of the cumulative neural network training time, not just number of table lookups. This is the time the algorithm would have taken to run if it had been applied to the search space without the pre-computed table our benchmark provides. Since larger architectures require more time to train, NAS algorithms that take into account training time may prove more efficient.
3 NASBench as a Dataset
In this section, we analyze the NAS-Bench-101 dataset as a whole to gain some insight into the role of neural network operations and cell topology in the performance of convolutional neural networks. In doing so, we hope to shed light on the loss landscape that is traversed by neural architecture search algorithms.
3.1 Dataset statistics
First we study the empirical cumulative distribution (ECDF) of various metrics across all architectures in Figure 2. Most of the architectures converge and reach training accuracy. The validation accuracy and test accuracy are both above for a majority of models. The best architecture in our dataset (Figure 1) achieved a mean test accuracy of . For comparison, the ResNet-like and Inception-like cells attained and , respectively, which is roughly in-line with the performance of the original ResNet-56 () on CIFAR-10 (He et al., 2016a). We observed that the correlation between validation and test accuracy is extremely high () at 108 epochs which suggests that strong optimizers are unlikely to overfit on the validation error. Due to the stochastic nature of the training process, training and evaluating the same architecture will generally lead to a small amount of noise in the accuracy. We also observe, as expected, that the noise between runs is lower at longer training epochs.
The empirical cumulative distribution (ECDF) of all valid configurations for: (left) the train/valid/test accuracy after training for 108 epochs and (right) the noise, defined as the standard deviation of the test accuracy between the three trials, after training for 12, 36 and 108 epochs.
Figure 3 investigates the relationship between the number of parameters, training time, and validation accuracy of models in the dataset. The left plot suggests that there is positive correlation between all of these quantities. However parameter count and training time are not the only factors; the right plot shows that the best cell in the dataset is not the most computationally intensive one. Furthermore, hand-designed cells, such as ResNet and Inception, perform near the Pareto frontier of accuracy over cost, which suggests that topology and operation selection are critical for finding both high-accuracy and low-cost models.
3.2 Architectural design
NAS-Bench-101 presents us with the unique opportunity to investigate the impact of various architectural choices on the performance of the network. In Figure 4, we study the effect of replacing each of the operations in a cell with a different operation. Not surprisingly, replacing a convolution with a convolution or max-pooling operation generally leads to a drop in absolute final validation accuracy by and , respectively. This is also reflected in the relative change in training time, which decreases by and . Interestingly, even though max-pooling is parameter-free, it appears to be on average more expensive in training time than convolution and also has an average absolute validation accuracy lower. However, some of the top cells in the space (ranked by mean test accuracy, i.e., Figure 1) contain max-pool operations, so other factors must also be at play, and replacing all max-pooling operations with convolutions is not necessarily a globally optimal choice.
We also investigate the role of depth vs. width. Depth is measured by the length of the longest path from the input to output vertex and width is measured by the maximum directed cut on the directed acyclic graph. In terms of average validation accuracy, it appears that a depth of 3 is optimal whereas increasing width seems to increase the validation accuracy up to 5, the maximum width of networks in the dataset. The training time of networks increases as networks get deeper and wider with one exception: width 1 networks are the most expensive. This is a consequence of the vertex and edge constraints (see Section 2.3
), which skews the training time distributions because all width 1 networks are simple feed-forward networks with no branching, and thus the activation maps are never split via their channel dimension.
NASBench exhibits locality, a property by which architectures that are “close by” tend to have similar performance metrics. This can be exploited by many search algorithms and is therefore desirable. We define “closeness” in terms of edit-distance: the smallest number of changes required to turn one architecture into another; one change entails flipping the operation at a vertex or the presence/absence of an edge. A popular measure of locality is the random-walk autocorrelation (RWA), defined as the autocorrelation of the accuracies of points visited as we perform a long walk of random changes through the space (Weinberger, 1990; Stadler, 1996). The RWA (Figure 6, left) shows high correlations for lower distances, indicating locality. The correlations become indistinguishable from noise beyond a distance of about 6.
While the RWA aggregates across the whole space, we can also consider regions of particular interest. For example, Figure 3 (right) displays the neighbors of the Inception-like cell, indicating a degree of locality too, especially in terms of accuracy. Another interesting region is that around a global accuracy maximum. To measure locality within this neighborhood, we used the fitness-distance correlation metric (FDC, Jones et al. (1995)). Figure 6 (left) shows that there is locality around the global maximum as well and the peak also has a coarse-grained width of about 6.
More broadly, we can consider how hard it is to be near a global maximum. In the cell encoding described in Section 2.2, the best architecture (i.e.
, the one with the highest mean testing accuracy) has 4 graph isomorphisms, producing 4 distinct peaks in our encoded search space. Moreover there are 11 other architectures whose mean test accuracy is within 2 times standard error of the mean of the best graph. Including the isomorphisms of these, too, there are 11 570 points in the 510M-point search space corresponding to thesetop graphs, meaning that the chance of hitting one of them with a random sample is about 1 to 50 000. Figure 6 (right) shows how much volume of the search space lies near these graphs; in particular, 35.4% of the search space is within a distance of 6 from the closest top graph. Since the basin of attraction for local search appears to have a width of about 6, this suggests that local search may be a good choice for this search space.
4 NASBench as a Benchmark
4.1 Comparing NAS algorithms
In this section we establish baselines for future work by using our dataset to compare some popular algorithms for which open source code is available. We would like to note that the purpose here is not to answer the question “Which methods work best on this benchmark?”, but rather to show some shortcomings of current state-of-the-art methods and lay the foundation for interesting future work.
We scanned the neural architecture search (NAS) and hyperparameter optimization (HPO) literature for algorithms with open-sourced implementations and found the following: random search (RS) (Bergstra & Bengio, 2012), regularized evolution (RE) (Real et al., 2018), SMAC (Hutter et al., 2011), TPE (Bergstra et al., 2011), Hyperband (HB) (Li et al., 2018), and BOHB (Falkner et al., 2018). We benchmark all of these following the method described in Section 2.6. We refer to Section S2 in the supplementary material for additional implementation details. We do not include Gaussian process based Bayesian optimization methods (Shahriari et al., 2016), such as, e.g., Spearmint (Snoek et al., 2012), since this tends to have problems in high-dimensional discrete optimization tasks (Eggensperger et al., 2013). However, we believe that benchmarking additional algorithms should be easy with our open-sourced tools.
Figure 7 (left) shows the mean performance of each of these NAS/HPO algorithms across 500 independent trials. The x-axis shows estimated wall-clock time, counting the evaluation of each neural architecture with the time that the corresponding training run took. Note that the evaluation of 500 trials of each NAS algorithm (for up to 10M simulated TPU seconds, i.e., 115 TPU days, each) was only made possible by virtue of our tabular benchmark; without it, they would have amounted to over 900 TPU years of computation.
We preface the discussion of our experimental results by emphasizing that the performance of many of the methods we benchmarked is sensitive to the formulation of the search space we used. Notably, although our constrained search space only consisted of about 423k models, the constraints are very complex (e.g., isomorphism checking is NP-hard) and no method we are aware of takes such constraints as an input. We therefore used the simplest possible encoding: 21 binary edge indicators and five ternary variables with the three operators for each of the five internal nodes. In total, this leads to a search space of roughly models, the vast majority of which (about 999 in 1000) are invalid. When any method chose an invalid architecture, we returned the worst possible validation error of 1.0 and zero TPU seconds of training runtime. Especially for the model-based Bayesian optimization methods, this invalidity is very tricky to handle, since the best architectures have 9 edges, and usually performance improves by adding edges, except for the many cases where this causes invalidity. With this disclaimer, we can make the following observations:
RE and SMAC perform best and start to outperform RS after roughly 50 000 TPU seconds (the equivalent of roughly 25 evaluated architectures); they achieved the final performance of RS about 5 times faster and continued to improve beyond this point. It is surprising that SMAC, as a Bayesian optimization method, performs this well despite the issue of invalid architectures; we believe that this is due to its robust random forest model. SMAC is slightly slower in the beginning of the search; we assume that this is due to its internal incumbent estimation procedure (which evaluates the same architecture multiple times in order to build a reliable estimate of the best observed architecture (incumbent) in the case of noisy objective functions).
The other Bayesian optimization method, TPE, struggles with this benchmark, with its performance falling back to random search. We attribute this to issues with the invalidities; in particular, with 99.9% of invalid configurations, TPE’s kernel density for poor architectures effectively becomes useless. Since BOHB uses the same model as TPE, it also performs no better than HB.
The multi-fidelity optimization algorithms HB and BO-HB do not yield the speedups frequently observed for it compared to RS or Bayesian optimization. We attribute this to the relatively low rank-correlation between the performance obtained with different budgets (see Figure 2 in Section S2 in the supplementary material).
Besides achieving good performance, we argue that robustness, i.e., how sensitive is an optimizer to the seed for the random number generator, plays an important role in practice for HPO and NAS methods. This aspect has been neglected in the NAS literature due to the extreme cost of performing many repeated runs of NAS experiments, but with NAS-Bench-101 performing many repeats becomes trivial. Figure 7 (right) shows the empirical cumulative distribution of the regret after 10M seconds across all 500 runs of each method. For all methods, the final test regrets ranged over roughly an order of magnitude, with RE and SMAC showing the most robust performance.
4.2 Generalization bootstrap
To test the generalization of our findings on the dataset, we ideally would need to run the benchmarked algorithms on a larger space of architectures. However, due to computational limitations, it is infeasible for us to run a large number of NAS trials on a meaningfully larger space. Instead, to provide some preliminary evidence of generalization, we perform a bootstrapped experiment: we set aside a subset of NAS-Bench-101, dubbed NAS-Bench-Mini, and compare the outcomes of algorithms run on NAS-Bench-Mini compared to the full NAS-Bench-101. NAS-Bench-Mini contains all cells within the search space that utilize or fewer vertices ( unique cells), compared to the full NAS-Bench-101 that uses up to vertices ( unique cells).
To show generalization, we compare two very similar algorithms (regularized evolution, RE, and non-regularized evolution, NRE) to a baseline (random search, RS). RE and NRE are identical except that RE removes the oldest individual in a population to main the population size whereas NRE removes the lowest fitness individual. Figure 8 (top) shows the comparison on NAS-Bench-Mini and NAS-Bench-101 on 100 trials of each algorithm to a fixed time budget. The plots show that the rankings of the three algorithms (RS NRE RE) are consistent across the smaller dataset and the larger one. Furthermore, we demonstrate that NAS-Bench-Mini can generalize to NAS-Bench-101 for different hyperparameter settings of a single algorithm (regularized evolution) in Figure 8 (middle, bottom). This suggests that conclusions drawn from NAS-Bench-101 might generalize to larger search spaces.
In this section, we discuss some of the choices we made when designing NAS-Bench-101.
5.1 Relationship to hyperparameter optimization
All models in NAS-Bench-101 were trained with a fixed set of hyperparameters. In this section, we justify that choice. The problem of hyperparameter optimization (HPO) is closely intertwined with NAS. NAS aims to discover good neural network architectures while HPO involves finding the best set of training hyperparameters for a given architecture. HPO operates by tuning various numerical neural network training parameters (e.g., learning rate) as well as categorical choices (e.g., optimizer type) to optimize the training process. Formally, given an architecture , the task of HPO is to find its optimal hyperparameter configuration :
where is a performance metric, such as validation accuracy and the is over all possible hyperparameter configurations. The “pure” NAS problem can be formulated as finding an architecture when all architectures are evaluated under optimal hyperparameter choices:
In practice, this would involve running an inner HPO search for each architecture, which is computationally intractable. We therefore approximate with :
where is a set of hyperparameters that has been estimated by maximizing the average accuracy on a small subset of the architectures:
For example, in Section 2.4, was a random sample of 50 architectures.
To justify the approximation above, we performed a study on a different set of NAS-HPO-Bench datasets (described in detail in Supplement S4).333 In brief, we trained 2-layer feedforward networks on three different non-image regression domains: protein structure, slice localization, and year prediction, making them complementary to NAS-Bench-101. We varied the number of hidden units at each layer, as well as the activation type. While the graph space is much smaller than NAS-Bench-101, it has the important advantage of including hyperparameter choices in the search space, allowing us to measure their interaction and relative importance. These are smaller datasets of architecture–hyperparameter pairs , where we computed for all settings of and . This let us compute the exact hyperparameter-optimized accuracy, We can also measure how well this correlates with the approximation we use in NAS-Bench-101. To do this, we chose a set of hyperparameters by optimizing the mean accuracy across all of the architectures for a given dataset. This allows us to map each architecture to its approximate hyperparameter-optimized accuracy, (This approximate accuracy is analogous to the one computed in the NAS-Bench-101 metrics, except there the average was over 50 random architectures, not all of them.)
We find that and are quite strongly correlated across models, with a Spearman rank correlation of ; Figure 9 provides a scatter plot of against for the architectures. The ranking is especially consistent for the best architectures (points near the origin).
5.2 Absolute accuracy of models
The choice of search space, hyperparameters, and training techniques were designed to ensure that NAS-Bench-101 would be feasible to compute with our computational resources. Unfortunately, this means that the models we evaluate do not reach current state-of-the-art performance on CIFAR-10. This is primarily because: (1) the search space is constrained in both size and selection of operations and does not contain more complex architectures, such as those used by NASNet (Zoph et al., 2018); (2) We do not apply the expensive “augmentation trick” (Zoph et al., 2018) by which models’ depth and width are increased by a large amount and the training lengthened to hundreds of epochs; and (3) we do not utilize more advanced regularization like Cutout (DeVries & Taylor, 2017), ScheduledDropPath (Zoph et al., 2018) and decoupled weight decay (Loshchilov & Hutter, 2019) in order to keep our training pipeline similar to previous standardized models like ResNet. Nevertheless, we believe the dataset is still useful for gaining understanding of the nature of the NAS search landscape, and the properties of different algorithms, as we have shown.
We introduced NAS-Bench-101, a new tabular benchmark for neural architecture search that is inexpensive to evaluate but still preserves the original NAS optimization problem, enabling us to rigorously compare various algorithms quickly and without the enormous computational budgets often used by projects in the field. Based on the data we generated for this dataset, we were able to analyze the properties of an exhaustively evaluated set of convolutional neural architectures at unprecedented scale. In open-sourcing the NAS-Bench-101 data and generating code, we hope to make NAS research more accessible and reproducible. We also hope that NAS-Bench-101 will be the first of a continually improving sequence of rigorous benchmarks for the emerging NAS field.
Aaron and Frank acknowledge support by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme under grant no. 716721, support by BMBF grant DeToL, and support by the state of Baden-Württemberg through bwHPC and the German Research Foundation (DFG) through grant no INST 39/963-1 FUGG. Frank gratefully acknowledges a Google Faculty Research Award. Chris, Esteban, Eric, and Kevin would like to thank Quoc Le, Samy Bengio, Alok Aggarwal, Barret Zoph, Jon Shlens, Christian Szegedy, Jascha Sohl-Dickstein; and the larger Google Brain team.
Baker et al. (2017)
Baker, B., Gupta, O., Naik, N., and Raskar, R.
Designing neural network architectures using reinforcement learning.In ICLR, 2017.
- Bergstra & Bengio (2012) Bergstra, J. and Bengio, Y. Random search for hyper-parameter optimization. JMLR, 2012.
- Bergstra et al. (2011) Bergstra, J. S., Bardenet, R., Bengio, Y., and Kégl, B. Algorithms for hyper-parameter optimization. In NIPS, 2011.
- Bertin-Mahieux et al. (2011) Bertin-Mahieux, T., Ellis, D., Whitman, B., and Lamere, P. The million song dataset. In Ismir, 2011.
- Deng et al. (2009) Deng, J., Dong, W., Socher, R., Li, L.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
- DeVries & Taylor (2017) DeVries, T. and Taylor, G. W. Improved regularization of convolutional neural networks with cutout. arXiv, 2017.
- Eggensperger et al. (2013) Eggensperger, K., Feurer, M., Hutter, F., Bergstra, J., Snoek, J., Hoos, H., and Leyton-Brown, K. Towards an empirical foundation for assessing bayesian optimization of hyperparameters. In NIPS workshop on Bayesian Optimization in Theory and Practice, December 2013.
Eggensperger et al. (2015)
Eggensperger, K., Hutter, F., Hoos, H., and Leyton-Brown, K.
Efficient benchmarking of hyperparameter optimizers via surrogates.
Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence, January 2015.
- Elsken et al. (2018) Elsken, T., Metzen, J. H., and Hutter, F. Neural architecture search: A survey. arXiv, 2018.
- Falkner et al. (2018) Falkner, S., Klein, A., and Hutter, F. Bohb: Robust and efficient hyperparameter optimization at scale. ICML, 2018.
- Goodfellow et al. (2014) Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. Generative adversarial nets. In NIPS, 2014.
- Graf et al. (2011) Graf, F., Kriegel, H.-P., Schubert, M., Pölsterl, S., and Cavallaro, A. 2d image registration in ct images using radial image descriptors. In MICCAI, 2011.
- He et al. (2016a) He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In CVPR, 2016a.
- He et al. (2016b) He, K., Zhang, X., Ren, S., and Sun, J. Identity mappings in deep residual networks. In ECCV, 2016b.
- Hu et al. (2018) Hu, J., Shen, L., and Sun, G. Squeeze-and-excitation networks. CVPR, 2018.
- Huang et al. (2017) Huang, G., Liu, Z., Weinberger, K. Q., and van der Maaten, L. Densely connected convolutional networks. In CVPR, 2017.
- Huang et al. (2018) Huang, Y., Cheng, Y., Chen, D., Lee, H., Ngiam, J., Le, Q. V., and Chen, Z. Gpipe: Efficient training of giant neural networks using pipeline parallelism. arXiv preprint arXiv:1811.06965, 2018.
- Hutter et al. (2011) Hutter, F., Hoos, H. H., and Leyton-Brown, K. Sequential model-based optimization for general algorithm configuration. In International Conference on Learning and Intelligent Optimization, 2011.
- Ioffe & Szegedy (2015) Ioffe, S. and Szegedy, C. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv, 2015.
- Jones et al. (1995) Jones, T. et al. Evolutionary algorithms, fitness landscapes and search. PhD thesis, Citeseer, 1995.
- Kingma & Ba (2014) Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. ICLR, 2014.
- Krizhevsky & Hinton (2009) Krizhevsky, A. and Hinton, G. Learning multiple layers of features from tiny images. Master’s thesis, Dept. of Computer Science, U. of Toronto, 2009.
- Krizhevsky et al. (2012) Krizhevsky, A., Sutskever, I., and Hinton, G. E. Imagenet classification with deep convolutional neural networks. In NIPS, 2012.
- Li & Talwalkar (2019) Li, L. and Talwalkar, A. Random Search and Reproducibility for Neural Architecture Search. arXiv e-prints, art. arXiv:1902.07638, Feb 2019.
- Li et al. (2018) Li, L., Jamieson, K., DeSalvo, G., Rostamizadeh, A., and Talwalkar, A. Hyperband: A novel bandit-based approach to hyperparameter optimization. JMLR, 2018.
- Lichman (2013) Lichman, M. Uci machine learning repository, 2013. URL http://archive.ics.uci.edu/ml.
- Liu et al. (2018a) Liu, C., Zoph, B., Shlens, J., Hua, W., Li, L.-J., Fei-Fei, L., Yuille, A., Huang, J., and Murphy, K. Progressive neural architecture search. ECCV, 2018a.
- Liu et al. (2018b) Liu, H., Simonyan, K., and Yang, Y. Darts: Differentiable architecture search. ICLR, 2018b.
Loshchilov & Hutter (2017)
Loshchilov, I. and Hutter, F.
Sgdr: Stochastic gradient descent with warm restarts.ICLR, 2017.
- Loshchilov & Hutter (2019) Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7.
- Pham et al. (2018) Pham, H., Guan, M. Y., Zoph, B., Le, Q. V., and Dean, J. Efficient neural architecture search via parameter sharing. ICML, 2018.
- Rana (2013) Rana, P. S. Physicochemical properties of protein tertiary structure data set. Technical report, 2013.
- Real et al. (2017) Real, E., Moore, S., Selle, A., Saxena, S., Suematsu, Y. L., Le, Q., and Kurakin, A. Large-scale evolution of image classifiers. In ICML, 2017.
- Real et al. (2018) Real, E., Aggarwal, A., Huang, Y., and Le, Q. V. Regularized evolution for image classifier architecture search. arXiv preprint arXiv:1802.01548, 2018.
- Shahriari et al. (2016) Shahriari, B., Swersky, K., Wang, Z., Adams, R. P., and de Freitas, N. Taking the human out of the loop: A review of bayesian optimization. Proceedings of the IEEE, 104(1):148–175, 2016.
- Snoek et al. (2012) Snoek, J., Larochelle, H., and Adams, R. P. Practical bayesian optimization of machine learning algorithms. In NIPS, 2012.
- So et al. (2019) So, D. R., Liang, C., and Le, Q. V. The evolved transformer. CoRR, abs/1901.11117, 2019.
- Stadler (1996) Stadler, P. F. Landscapes and their correlation functions. Journal of Mathematical chemistry, 20(1):1–45, 1996.
- Sutskever et al. (2014) Sutskever, I., Vinyals, O., and Le, Q. V. Sequence to sequence learning with neural networks. In NIPS, 2014.
- Szegedy et al. (2015) Szegedy, C., Liu, W., Jia, Y., Sermanet, P., Reed, S., Anguelov, D., Erhan, D., Vanhoucke, V., and Rabinovich, A. Going deeper with convolutions. In CVPR, 2015.
Szegedy et al. (2016)
Szegedy, C., Vanhoucke, V., Ioffe, S., Shlens, J., and Wojna, Z.
Rethinking the inception architecture for computer vision.In CVPR, 2016.
- Tieleman & Hinton (2012) Tieleman, T. and Hinton, G. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 2012.
- Weinberger (1990) Weinberger, E. Correlated and uncorrelated fitness landscapes and how to tell the difference. Biological cybernetics, 63(5):325–336, 1990.
- Williams (1992) Williams, R. J. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229–256, 1992. doi: 10.1007/BF00992696. URL https://doi.org/10.1007/BF00992696.
- Ying (2019) Ying, C. Enumerating unique computational graphs via an iterative graph invariant. CoRR, abs/1902.06192, 2019.
- Zoph & Le (2016) Zoph, B. and Le, Q. V. Neural architecture search with reinforcement learning. In ICLR, 2016.
- Zoph et al. (2018) Zoph, B., Vasudevan, V., Shlens, J., and Le, Q. V. Learning transferable architectures for scalable image recognition. In CVPR, 2018.
S1 Identifying Isomorphic Cells
Within the NAS-Bench-101 search space of models, there are models which have different adjacency matrices or have different labels but are computationally equivalent (e.g., Figure 1). We call such cells isomorphic. Furthermore, vertices not on a path from the input vertex to the output vertex do not contribute to the computation of the cell. Cells with such vertices can be pruned to smaller cell without changing the effective behavior of the cell in the network. Due to the size of the search space, it would be computationally intractable (and wasteful) to evaluate each possible graph representation without considering isomorphism.
Thus, we utilize an iterative graph hashing algorithm, described in (Ying, 2019), which quickly determines whether two cells are isomorphic. To summarize the algorithm, we iteratively perform isomorphism-invariant operations on the vertices of the graph which incorporates information from both the adjacent vertices as well as the vertex label. The algorithm outputs a fixed-length hash which uniquely identifies isomorphic cells (i.e., computationally identical graphs cells to the same value and computationally different cells hash to different values).
Using such an algorithm allows us to enumerate all unique cells within the space and choose a single canonical cell to represent each equivalence class of cells and perform the expensive train and evaluation procedure on the canonical cell only. When querying the dataset for a valid model, we first hash the proposed cell then use the hash to return the data associated with the evaluated canonical graph.
S2 Implementation Details
s2.1 Generating the dataset
Table 1 shows the training hyperparameters used for all models in the space. These values were tuned to be optimal for the average of 50 randomly sampled cells in the search space. In practice, we find that these hyperparameters do not significantly affect the ranking of cells as long as they are set within reasonable ranges.
|initial convolution filters||128|
|learning rate schedule||cosine decay|
|initial learning rate||0.2|
|ending learning rate||0.0|
|L2 weight decay||0.0001|
|batch normalization momentum||0.997|
|batch normalization epsilon||0.00001|
|accelerator||TPU v2 chip|
s2.2 Benchmarked algorithms
All methods employ the same encoding structure as defined in Section 2.2.
Random search (RS)
We used our own implementation of random search which samples architectures simply from a uniform distribution over all possible configurations in the configuration space.
Regularized evolution (RE)
We used a publicly available re-implementation for RE (Real et al., 2018). We set the population size to 100 and the tournament size to 10. To mutate an architecture, we first sample uniformly at random an edge or an operator. If we sampled an edge we simply flip it and for operators, we sample a new operator for the set of all possible operations excluding the current one. RE kills the oldest member of the population at each iteration after reaching the population size.
Tree-structured Parzen estimator (TPE)
We used the Hyperopt implementation from https://github.com/hyperopt/hyperopt for TPE. All hyperparameters were left to their defaults.
Bayesian Optimization and Hyperband
For Hyperband and BOHB we used the implementation from https://github.com/automl/HpBandSter. All hyperparameters were set their default parameters.
Sequential model-based algorithm configuration (SMAC)
We used the implementation from https://github.com/automl/SMAC3 for SMAC. Also here we left all hyperparameters at their default except for the maximum number of evaluations per configuration, which we limited to 4 due to the low amount of noise we expected.
S3 Preliminary Reinforcemenet Learning Results
We attempted to benchmark a reinforcement learning (RL) approach using a 1-layer LSTM controller trained with PPO, as proposed by Zoph et al. (2018). With no additional hyperparameter tuning, the controller seems to fail to learn to traverse the space and tends to converge quickly to a far-from-optimal configuration. We suspect that one reason for this is the highly conditional nature of the space (i.e., cells with more than 9 edges are ”invalid”). Further tuning may be required to get RL techniques to work on NAS-Bench-101, and this constitutes an interesting direction for future work.
We did, however, successfully train a naive REINFORCE-based (Williams, 1992)
controller which simply outputs a multinomial probability distribution at each of the 21 possible edges and 5 operations and samples the distribution to get a new model. We believe that this sampling behavior allows it to find more diverse models than the LSTM-PPO method. The results, when run in the same context as Section4.2, are shown in Figure 3. REINFORCE appears to perform around as strongly as non-regularized evolution (NRE) but both NRE and REINFORCE tends to be weaker than regularized evolution (RE). All methods beat the baseline random search.
S4 The NAS-HPO-Bench Datasets
s4.1 Dataset Construction
Before building our main dataset (Section 2), we built three smaller ones that resemble traditional hyperparameter optimization problems for featurized regression datasets. Each consists of a table mapping neural network architectural and hyperparameter configurations to their evaluation accuracy. We use 3 popular UCI (Lichman, 2013) datasets for regression: protein structure (Rana, 2013), slice localization (Graf et al., 2011) and year prediction (Bertin-Mahieux et al., 2011). We call them NAS-HPO-Bench-Protein, NAS-HPO-Bench-Slice and NAS-HPO-Bench-Year, respectively.
All architectures employ a two-layer feed forward neural network followed by a linear output layer. The variation in the search space is due to a modest number of discretized architectural and hyperparameter choices, detailed in Table2. We treat numerical parameters as ordinals and the rest as categorical. This yields a total of roughly 64K models. The training of each configuration was repeated 4 independent times with a different seed for the random number generator. We optimized the weights by minimizing the mean squared error with Adam (Kingma & Ba, 2014) for 100 epochs. Note, for the year prediction datasets, due to its integer target values, we used the mean absolute error.
|Layer 1 Size|
|Layer 2 Size|
s4.2 Dataset Statistics
We now analyze the properties of these datasets as we did in Section 3. First, for each dataset we computed the empirical cumulative distribution of: the test, validation and training error after 100 epochs averaged over the 4 repetitions; the total training time; the number of parameters. One can see that the mean-squared-error (MSE) is spread over an order of magnitude or more (Figure 4
). For example, for protein structure (top), on one side only a small subset of all configurations achieve a final mean squared error that is lower than 0.3 and on the other many outliers exist that achieve errors orders of magnitude above the average. Furthermore, due to the changing number of parameters (Figure5), also the training time varies dramatically across configurations (Figure 6).
plots on each dataset the empirical cumulative distribution of the noise, defined as the standard deviation between the 4 repetitions for different number of epochs. The plots show the measurements for different number of epochs. We can see that the noise is heteroscedastic. That is, different configurations come with a different noise level. As expected, the noise decreases with an increasing number of epochs. Similar results were observed in Section3.1.
We provide full learning curves (i.e. validation error for each epoch) as additional fidelities that can be used to benchmark multi-fidelity algorithms. We consider the number of epochs as the budget. For the most of these methods it is essential that the ranking of configurations across budgets be preserved. In Figures 8, 9, and 10, we visualize values of the Spearman rank correlation across budgets in the right-most column of each figure. Since every hyperparameter optimization method needs to mainly focus on the top performing configuration, we also show the correlation for only the top , , , and of all configurations in the first 4 columns of each figure, respectively. As expected the correlation with higher budgets increases with increasing budgets. If only top-performing configurations are considered, the correlation decreases, since they their final performances are close to each other.
s4.3 Algorithm Benchmarks
We plot the mean regret and confidence intervals across 100 independent runs of each method for each of the three datasets (Figures11, 12, and 13). HB and BO-HB achieved a reasonable performance relatively quickly but only slightly outperform simple RS. The two Bayesian optimization methods, SMAC and TPE, worked as well as RS in the beginning but tended to outperform it after they obtained a meaningful model. It seems that TPE can model these spaces better than the random forest used by SMAC. However, compared to RE, which needs more time in the beginning, TPE converges prematurely at a regret of , which is roughly at the noise level, of the best performing configurations. In the long run, regularized evolution attained the lowest error in all cases.