Paper commentary
Neural Architecture Search with Reinforcement Learning
A recurrent controller learns to design neural networks with reinforcement learning
- Problem Neural networks are hard to design by hand, and hyperparameter optimization only searches spaces of fixed size. Architectures with varying depth and connectivity do not fit that setup.
- Method Neural Architecture Search uses a recurrent network to write each architecture as a sequence of tokens. It trains the controller with REINFORCE, using each child network's validation accuracy as the reward.
- Results On CIFAR-10 the discovered network reaches a test error rate of 3.65, which is 0.09 percent better and 1.05x faster than the previous state-of-the-art model with a similar scheme.
Why fixed-length searches fall short
Architecture design has moved from hand-crafted features to hand-designed networks such as AlexNet, VGGNet, GoogleNet and ResNet, and each step still asks for much expert effort. Hyperparameter optimization automates part of this work, but the methods it uses search a space whose size is fixed in advance. A network's structure and connectivity can be written as a string whose length varies, which a fixed-length vector handles poorly.
Bayesian optimization can search non-fixed-length architectures, but the authors consider those methods less general and less flexible than their own. Neuro-evolution is flexible enough to compose new models, yet it is usually impractical at large scale and depends on search heuristics. Neural Architecture Search keeps variable-length descriptions and uses a learned policy to propose them.
A controller that writes architectures token by token
The controller is a recurrent network that writes an architecture as a sequence of tokens, one hyperparameter at a time. For each convolutional layer, it emits a filter height and width, a stride in each direction and a filter count. Each choice is a softmax over the options, and the chosen value becomes the input for the next step.
Generation stops once the layer count reaches a limit that grows as training proceeds. The sampled network is then built and trained, and its accuracy on a held-out validation set is recorded. That accuracy is the signal that adjusts the controller, so that later samples favor architectures that scored well.
Policy gradient with a moving-average baseline
Accuracy cannot be differentiated with respect to the sampled tokens, so the controller maximizes its expected reward instead. Its gradient follows REINFORCE, which weights the gradient of each token's log-probability by the reward: \[ \nabla_{\theta_c} J(\theta_c)=\sum_{t=1}^{T} E_{P(a_{1:T};\theta_c)}\big[\nabla_{\theta_c}\log P(a_t\mid a_{(t-1):1};\theta_c)\,R\big] \] In practice the expectation is estimated from m architectures sampled in one batch, each with T tokens.
The variance of that estimate is very high, so a baseline b is subtracted from each reward. The baseline is an exponential moving average of earlier architecture accuracies. The update becomes \[ \frac{1}{m}\sum_{k=1}^{m}\sum_{t=1}^{T}\nabla_{\theta_c}\log P(a_t\mid a_{(t-1):1};\theta_c)\,(R_k-b) \], where R_k is the validation accuracy of the k-th child network after training on the training data.
Because b does not depend on the current action, the estimate stays unbiased.
Parallel child training with a parameter server
Each controller update waits for a child network to train to convergence, and a single child can take hours. To shorten this wait, the method uses distributed training with asynchronous parameter updates. S parameter-server shards hold the shared parameters for K controller replicas. Each replica samples m child architectures, trains them in parallel and sends the resulting gradients back to the servers.
On CIFAR-10 the setting was S=20, K=100 and m=8, which means 800 child networks trained at the same time on 800 GPUs. For Penn Treebank the setting was S=20, K=400 and m=1, with 400 CPUs, and parameters were updated once 10 gradients had been accumulated. Search wall-clock time therefore depends on how many child networks train at once and how long each one runs.
Set-selection attention for skip connections
The first search space had no skip connections or branching layers, so it could not express the structures of GoogleNet or ResNet. To select inputs, each layer N gets an anchor point that carries N−1 content-based sigmoids, one for each earlier anchor point. The probability that layer j feeds layer i is \[ P(\text{Layer } j \text{ is an input to layer } i)=\text{sigmoid}\left(v^{T}\tanh(W_{prev}h_j+W_{curr}h_i)\right) \] Here h_j is the controller hidden state at the anchor of layer j, h_i is the state at the current layer, and W_prev, W_curr and v are trainable.
Sampled sigmoids pick the earlier layers that become inputs, and since these choices are also probability distributions, REINFORCE still applies without substantial change. Inputs of different sizes are zero-padded, and all inputs to a layer are concatenated along the depth dimension. A layer with no input reads the image, and the final layer concatenates every layer output that nothing has consumed.
Recurrent cells as trees of steps
A basic RNN update and an LSTM update can both be written as a tree of steps that take x_t and h_{t-1} and produce h_t. For each node, the controller chooses a combination method and an activation, such as addition, element-wise multiplication, tanh or ReLU. Nodes are indexed in order, so the controller visits them one block at a time.
The memory variables c_{t-1} and c_t are connected to tree nodes by the last two blocks the controller predicts. The internal node combines c_{t-1} with a_0 and then multiplies by a_1: \[ a^{new}_0=\text{ReLU}(a_0+c_{t-1}),\quad a_2=\text{sigmoid}(a^{new}_0\odot a_1),\quad h_t=a_2 \] Internal nodes have no learnable parameters, and the cell state c_t is taken from node 1 before its activation.
The experiments use a base number of 8.
CIFAR-10 search setup
CIFAR-10 images are whitened, upsampled, cropped at random to 32x32 and flipped horizontally. The validation set holds 5,000 examples drawn from the training set, and the other 45,000 train each child model. The test result is computed once, for the network that performs best on the validation set.
Strides were either fixed at 1, or chosen from 1, 2 and 3 in a second experiment. The controller is a two-layer LSTM with 35 hidden units per layer, trained with Adam at a learning rate of 0.0006. Each child trains for 50 epochs, and its reward is the maximum validation accuracy over the last 5 epochs, cubed. Depth grows by 2 layers every 1,600 samples, starting from 6 layers.
CIFAR-10 architectures and error rates
After 12,800 architectures had been trained, the best validation model went through a small grid search over learning rate, weight decay, batch-norm epsilon and the epoch at which the learning rate decays. The best grid-searched model was then trained to convergence and tested. Table 1 lists the three discovered networks and the enlarged variant with their depths, parameter counts and test errors.
The authors describe it as a local optimum, since perturbing it makes performance worse. Densely connecting all its layers gave 5.56%, and removing all skip connections raised test error to 7.97%. Both changes make the network worse, so the skip connections matter for this architecture.
The 40-filter model is 1.05x as fast as the DenseNet model with 3.74% error, according to the authors.
Penn Treebank search setup
Penn Treebank is a language modeling benchmark on which LSTM architectures are strong and hard to improve. Regularization uses embedding dropout and recurrent dropout, and some runs share input and output embeddings. For each tree node the controller chooses combination from add and element-wise multiplication, and activation from identity, tanh, sigmoid and ReLU.
Each child model has two layers, with hidden sizes chosen so the parameter count roughly matches the medium baselines, and it trains for 35 epochs. The reward is \(c\,(\text{validation perplexity})^2\), with c usually set to 80. The controller learning rate is 0.0005, close to the CIFAR-10 value.
Penn Treebank perplexity results
The authors note that the discovered cell resembles LSTM in its first steps, computing W1 h_{t-1}+W2 x_t several times and sending the results to different components.
Character-level transfer of the cell
The word-level cell was applied to character modeling on Penn Treebank, following the Ha et al. (2016) setup with variational dropout from Gal (2015). The authors trained their own LSTM under the same setup as a fair baseline.
Dropout rates were 0.2 and 0.5 with no embedding dropout, minibatch size 32 and BPTT length 100. This model reached 1.214 bits per character, which the authors present as the new best result on this task.
Dropping the cell into GNMT
The cell was dropped into GNMT, a neural machine translation framework that had been tuned for LSTM cells, and trained on WMT14 English to German. The GNMT setup used 8 encoder and 8 decoder layers, with a bidirectional first encoder layer and an attention module with one hidden layer. LSTM hidden units were 1024 per layer, and training ran on 12 workers with 8 GPUs each and a minibatch of 128.
Settings stayed the same except for the cell and for hyperparameters adjusted so that the computational complexity matched the base model. The new cell scored 0.5 test BLEU higher than the default LSTM cell. The authors note that this gain is modest, the cell was used without any tuning for GNMT, and they expect further tuning could help.
Random search and an enlarged operation set
Random search over the same space is the control, which the authors justify by noting that random search is often hard to beat in hyperparameter work. Figure 6 tracks the perplexity improvement over random search of the top 1, top 5 and top 15 unique models, sampled every 400 models up to iteration 25,000. The controller's best model is better than the best random-search model, and its top-model average is also better.
In a control experiment, max was added to the combination functions and sin to the activation functions. The authors report that the controller still reaches comparable performance, which they read as evidence of robustness.
Limitations
The DenseNet-BC result at 3.46% uses 1x1 convolutions to reduce parameters, which the authors did not use, so the comparison is not exact. The 3.65 model is therefore not the lowest error in Table 1.
The CIFAR-10 search covers only the filter, stride and pooling options listed, and the stride setting is the more demanding search space. Each controller update needs a child trained to convergence, which makes distributed training necessary and the search expensive.
The GNMT gain is 0.5 test BLEU, and the cell was not tuned for that framework.
Paper info
- Authors
- Barret Zoph, Quoc V. Le
- Venue
- arXiv · Preprint
- First published
- 2016-11-5
- Added
- 2026-11-11
- Updated
- 2017-2-15
- Version
- v2
- arXiv
- 1611.01578
- Category
- cs.LG · cs.AI · cs.NE
- Original paper terms
- arXiv non-exclusive 1.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Barret Zoph, Quoc V. Le (2016). Neural Architecture Search with Reinforcement Learning. arXiv:1611.01578v2. https://arxiv.org/abs/1611.01578v2
BibTeX
@misc{zoph2016neural,
title = {{Neural Architecture Search with Reinforcement Learning}},
author = {Barret Zoph and Quoc V. Le},
year = {2016},
eprint = {1611.01578},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1611.01578v2}
}