Paper · 2021-02-23 · cs.CV, cs.LG
Neural Architecture Search on ImageNet in Four GPU Hours: A Theoretically Inspired Perspective
TE-NAS searches cell architectures without training any candidate. It ranks each operator by the NTK condition number (trainability) and the linear-region count (expressivity) at initialisation, then prunes a supernet one operator per edge per round. Author-reported: 2.63% CIFAR-10 test error at 0.05 GPU days.
Neural architecture searchNeural tangent kernelNetwork pruningneural-architecture-searchtraining-freeneural-tangent-kernellinear-regionspruning
arXivPDFCodeMarkdown13 min read
AI-compiled by claude-haiku-5-5 on 2026-11-03, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Finding a good neural network design usually means training many candidate designs and seeing which one works best. That is slow and expensive, and shortcuts such as training each candidate for only a little while can mislead the search.
This paper asks whether a candidate can be judged before any training. It uses two properties of a network at its random starting point. One says how easily the network can be trained by gradient descent. The other says how many different input regions the network can separate. Neither needs labels.
The search starts from a large network that contains every candidate operation, then removes weak operations in rounds until one path is left. Each round ranks the operations by how much removing them changes the two properties, and the paper argues this trade-off gives a good design.
TL;DR
A 2021 method for neural architecture search with no training of candidates. It scores operations at initialisation with two indicators: the condition number of the NTK, a trainability measure, and a count of linear regions, an expressivity measure §3.1. It removes operations by a rank sum over both indicators, one per edge per round §3.2 alg. 1. Author-reported: it matches or beats the compared NAS methods on NAS-Bench-201 and DARTS while using far less search time §4 tab. 1 tab. 2 tab. 3. Its search cost figures are not comparable with training-based methods on identical hardware, so check the units in the tables.
Problem
Neural architecture search needs to know which candidate architecture is good. Existing methods either train a super-network or train many candidates, which costs a lot of GPU time, and truncated training can bias the ranking §1. The paper asks whether trainability and expressivity, both measurable at initialisation without labels, can rank architectures well enough to replace that evaluation §1 §3.1. It targets cell-based search spaces where the number of candidate cells is |O|^E for E edges and |O| operators, so sampling every candidate is not feasible §3.2.
Method
Indicator 1: trainability by the NTK condition number. The finite-width NTK is J(x) J(x')^T, where J is the Jacobian of the outputs with respect to the weights §3.1.1. Under gradient descent the training dynamics can be written in terms of the NTK's eigenvalues eq. 1 eq. 2. The paper cites the hypothesis of Lee et al. (2019) that the largest feasible learning rate scales as 2 divided by the largest eigenvalue. Under that assumption the smallest eigenvalue converges at a rate set by the condition number §3.1.1. The paper therefore uses the condition number as a trainability score, where lower is better eq. 3. It is computed without gradient descent or labels §3.1.1.
Indicator 2: expressivity by the number of linear regions. For a ReLU network, a linear region is the set of inputs that share one activation pattern eq. 4. The paper averages the region count over sampled weight initialisations, where higher is better eq. 5 §3.1.2. In practice it counts distinct activation patterns on sampled inputs app. A.
Combining the two. The two values have very different scales, so the paper ranks operators instead of using raw values. An equal-weight sum of the two ranks is the default. Weighted sums and other combinations gave lower accuracy in the paper's ablations §3.2 app. D.
Pruning-by-importance search. The search starts from a super-network that contains every operation on every edge alg. 1. Each round does the following.
- For every active operation, remove it alone and measure the change in the condition number (Δκ) and in the region count (ΔR) alg. 1.
- Rank the candidates. Largest Δκ gets rank 0, since removing it helps trainability most. Smallest ΔR gets rank 0, since removing it costs expressivity least. Both rankings say "prune first" for low index §3.2 alg. 1.
- Add the two ranks. On each edge, remove the candidate with the lowest rank sum alg. 1 §3.2.
- Stop when the network is a single path alg. 1.
Each round removes one operator per edge, so the number of networks scored falls from |O|^E to about |O|·E §3.2. The paper also shows how the trainability and expressivity values change during the search §3.2.1 fig. 5.
# TE-NAS pruning loop [alg. 1] [§3.2]
# Input: supernet with every candidate operator on every edge
def te_nas(supernet):
# Repeat rounds until each edge keeps a single operator [alg. 1]
while not is_single_path(supernet):
d_kappa = {} # (edge, op) -> change in NTK condition number
d_regions = {} # (edge, op) -> change in linear-region count
# Remove each active op on its own and measure the change [alg. 1]
for edge, op in active_ops(supernet):
# Larger drop in kappa means removing the op helps trainability
# [§3.1.1]
d_kappa[edge, op] = kappa(supernet) - kappa(supernet - op)
# Smaller drop in regions means removing the op costs little
# expressivity [§3.1.2]
d_regions[edge, op] = regions(supernet) - regions(supernet - op)
# Rank 0 is the most prunable for each indicator [§3.2] [alg. 1]
s_kappa = rank_descending(d_kappa)
s_regions = rank_ascending(d_regions)
# Equal-weight sum of the two ranks [§3.2]
importance = {c: s_kappa[c] + s_regions[c] for c in s_kappa}
# On each edge, the lowest rank sum is removed first [alg. 1]
for edge in edges(supernet):
candidates = candidates_on(edge, importance)
victim = min(candidates, key=lambda c: importance[c])
supernet = supernet - victim
return supernetTrainability score, computed on one mini-batch §3.1.1 app. A:
# Condition number of the NTK on one training batch [§3.1.1] [eq. 3]
def ntk_condition(network, batch):
# One gradient row per sample, over weight parameters only
# [code: lib/procedures/ntk.py#L44-L50]
grads = [sample_gradient(network, x) for x in batch] # (N, P)
# Gram matrix of the gradients, the NTK over the batch
# [code: lib/procedures/ntk.py#L55]
ntk = grads @ grads.T # (N, N)
eigenvalues = sorted(eigvalsh(ntk)) # ascending
# Largest over smallest eigenvalue [eq. 3]
return eigenvalues[-1] / eigenvalues[0]Expressivity score, on sampled inputs §3.1.2 app. A:
# Distinct ReLU activation patterns over sampled inputs [§3.1.2] [eq. 5]
def linear_regions(network, samples):
# Sign of every ReLU output, flattened per sample into one 0/1 row
# [code: lib/procedures/linear_region_counter.py#L126]
patterns = activation_signs(network, samples) # (S, D), 0 or 1
# Number of samples with the same pattern as each sample, itself included
# [code: lib/procedures/linear_region_counter.py#L129-L135]
same = count_identical_rows(patterns) # (S,)
# Each group of identical patterns adds exactly one region in total
# [code: lib/procedures/linear_region_counter.py#L136]
return sum(1 / same)Hyperparameters
Values stated in the paper and the values in the official code differ in several places. Both are listed. "Not stated" means neither the paper nor the code sets it.
| Name | Value | Where | Notes |
|---|---|---|---|
| NTK batch size | 32 | app. A | Code launcher uses 72 (NAS-Bench-201), 14 (DARTS CIFAR-10), 24 (DARTS ImageNet); code default 16 prune_launch.py prune_launch.py prune_launch.py prune_tenas.py |
| NTK batches per score | 1 | app. A | "one mini-batch"; code sets num_batch=1 prune_tenas.py |
| Samples for region count | 5000 images | app. A | Code uses 3 batches of 1000 patches, 3000 samples prune_tenas.py linear_region_counter.py |
| Region input patches | not stated | app. A | Code: 3x3 crops with one randomly chosen colour channel linear_region_counter.py |
| Repeats of each score | 3 | app. A | Code default 3 prune_tenas.py prune_launch.py |
| Weight initialisation | Kaiming norm | app. A | Code passes kaiming_normal / kaiming_uniform, which the init function never matches; see Paper vs code prune_tenas.py |
| Rank combination | equal-weight sum | §3.2 [fn. 1] | Weighted sums tried; equal weight chosen |
| Operators removed per edge per round | 1 | §3.2 | Code: 1 (NAS-Bench-201), 3 (DARTS CIFAR-10), 2 (DARTS ImageNet) prune_launch.py prune_launch.py prune_launch.py |
| Rounding of changes | not stated | §3.2 | Code rounds changes to 3 decimals and ranks on 3 significant figures prune_tenas.py prune_tenas.py prune_launch.py |
| Active-operator threshold | not stated | Code treats an operator as active when its softmax weight exceeds 0.01 prune_tenas.py | |
| Operator space, NAS-Bench-201 | 5 operators, including none | §4.1 | 15,625 architectures §4.1. Code never searches none cell_operations.py |
| Operator space, DARTS | 8 operators, including none | §4.2 | Code never searches none cell_operations.py |
| Scoring network, NAS-Bench-201 | not stated | Code: NTK net with C=3 and stem; region net with C=1, depth 1, no stem prune_tenas.py | |
| Scoring network, DARTS | not stated | Code: C=1, depth 2, four intermediate nodes prune_tenas.py | |
| CIFAR-10 evaluation network | 20 cells, C=36 | §4.2 | Reduction cells at 1/3 and 2/3 of depth; six nodes per cell §4.2 |
| CIFAR-10 retraining | Cutout 16, drop-path 0.3, auxiliary weight 0.4, SGD with cosine annealing, LR 0.025 | app. A | Retraining code is not in this repository |
| ImageNet evaluation network | 14 cells, C=48, at most 600 MB FLOPs | §4.3 | Input downscaled from 224 to 28 by three stride-2 convolutions §4.3 |
| ImageNet retraining | SGD with cosine annealing, LR 0.5, label smoothing | app. A | Retraining code is not in this repository |
Results
Author-reported. The paper runs TE-NAS four times with different seeds for NAS-Bench-201 and CIFAR-10 §4.1 §4.2; the ImageNet run count is not stated §4.3. Search costs are as printed; units differ between tables.
NAS-Bench-201, test accuracy (%), search on each dataset tab. 1
| Architecture | CIFAR-10 | CIFAR-100 | ImageNet-16-120 | Search cost (GPU sec.) | Method |
|---|---|---|---|---|---|
| ResNet | 93.97 | 70.86 | 43.63 | - | - |
| RSPS | 87.66 (1.69) | 58.33 (4.34) | 31.14 (3.88) | 8007.13 | random |
| ENAS | 54.30 (0.00) | 15.61 (0.00) | 16.32 (0.00) | 13314.51 | RL |
| DARTS (1st) | 54.30 (0.00) | 15.61 (0.00) | 16.32 (0.00) | 10889.87 | gradient |
| DARTS (2nd) | 54.30 (0.00) | 15.61 (0.00) | 16.32 (0.00) | 29901.67 | gradient |
| GDAS | 93.61 (0.09) | 70.70 (0.30) | 41.84 (0.90) | 28925.91 | gradient |
| NAS w.o. Training | 91.78 (1.45) | 67.05 (2.89) | 37.07 (6.39) | 4.8 | training-free |
| TE-NAS (ours) | 93.9 (0.47) | 71.24 (0.56) | 42.38 (0.46) | 1558 | training-free |
| Optimal | 94.37 | 73.51 | 47.31 | - | - |
CIFAR-10, DARTS space, test error (%) tab. 2
| Architecture | Test error (%) | Params (M) | Search cost (GPU days) | Method |
|---|---|---|---|---|
| AmoebaNet-A | 3.34 (0.06) | 3.2 | 3150 | evolution |
| PNAS | 3.41 (0.09) | 3.2 | 225 | SMBO |
| ENAS | 2.89 | 4.6 | 0.5 | RL |
| NASNet-A | 2.65 | 3.3 | 2000 | RL |
| DARTS (1st) | 3.00 (0.14) | 3.3 | 0.4 | gradient |
| DARTS (2nd) | 2.76 (0.09) | 3.3 | 1.0 | gradient |
| SNAS | 2.85 (0.02) | 2.8 | 1.5 | gradient |
| GDAS | 2.82 | 2.5 | 0.17 | gradient |
| BayesNAS | 2.81 (0.04) | 3.4 | 0.2 | gradient |
| ProxylessNAS (PyramidNet space, different) | 2.08 | 5.7 | 4.0 | gradient |
| P-DARTS | 2.50 | 3.4 | 0.3 | gradient |
| PC-DARTS | 2.57 (0.07) | 3.6 | 0.1 | gradient |
| SDARTS-ADV | 2.61 (0.02) | 3.3 | 1.3 | gradient |
| TE-NAS (ours) | 2.63 (0.064) | 3.8 | 0.05 (one GTX 1080Ti) | training-free |
The paper marks the ProxylessNAS row as a different space with a PyramidNet backbone, and the PNAS row as trained without cutout augmentation tab. 2.
ImageNet, DARTS space, mobile setting tab. 3
| Architecture | Top-1 error (%) | Top-5 error (%) | Params (M) | Search cost (GPU days) | Method |
|---|---|---|---|---|---|
| NASNet-A | 26.0 | 8.4 | 5.3 | 2000 | RL |
| AmoebaNet-C | 24.3 | 7.6 | 6.4 | 3150 | evolution |
| PNAS | 25.8 | 8.1 | 5.1 | 225 | SMBO |
| MnasNet-92 | 25.2 | 8.0 | 4.4 | - | RL |
| DARTS (2nd) | 26.7 | 8.7 | 4.7 | 4.0 | gradient |
| SNAS (mild) | 27.3 | 9.2 | 4.3 | 1.5 | gradient |
| GDAS | 26.0 | 8.5 | 5.3 | 0.21 | gradient |
| BayesNAS | 26.5 | 8.9 | 3.9 | 0.2 | gradient |
| P-DARTS (CIFAR-10) | 24.4 | 7.4 | 4.9 | 0.3 | gradient |
| P-DARTS (CIFAR-100) | 24.7 | 7.5 | 5.1 | 0.3 | gradient |
| PC-DARTS (CIFAR-10) | 25.1 | 7.8 | 5.3 | 0.1 | gradient |
| TE-NAS (searched on CIFAR-10) | 26.2 | 8.3 | 6.3 | 0.05 | training-free |
| PC-DARTS (ImageNet) | 24.2 | 7.3 | 5.3 | 3.8 | gradient |
| ProxylessNAS (GPU) | 24.9 | 7.5 | 7.1 | 8.3 | gradient |
| TE-NAS (searched on ImageNet) | 24.5 | 7.5 | 5.4 | 0.17 | training-free |
The paper's ImageNet claim is the searched-on-ImageNet row: 24.5% top-1 and 7.5% top-5 error in about four GPU hours on one 1080Ti §4.3.
Ablations, NAS-Bench-201, CIFAR-100 test accuracy (%)
Only trainability, only expressivity, and both tab. 4:
| Method | CIFAR-100 test accuracy |
|---|---|
| Prune with only κ | 69.25 (1.29) |
| Prune with only R̂ | 70.48 (0.29) |
| TE-NAS | 71.24 (0.56) |
Other ways to combine the two indicators tab. 5:
| Method | CIFAR-100 test accuracy |
|---|---|
| Prune by min of the two ranks | 70.75 (0.73) |
| Prune by max of the two ranks | 70.33 (1.09) |
| Prune by sum of the changes Δκ + ΔR | 70.47 (0.68) |
| Prune by sum of the two ranks (TE-NAS) | 71.24 (0.56) |
Paper vs code
Official repository: VITA-Group/TENAS, linked from the abstract. The README
clone command names chenwydj/TENAS; this card follows the paper's link. The
code was cloned at commit 9df78ffd98573035375b12e19b9007578cc4155d. The
repository licence is MIT LICENSE. Only the search code is included;
retraining and evaluation of DARTS architectures live in another repository
named in the README. NAS-Bench-201 accuracies come from the benchmark database
README.md.
- Weight initialisation is not applied. The paper says the weights are
drawn from Kaiming normal initialisation for each score app. A §3.1.2.
The code's
init_modelonly handles the stringskaiming_norm_faninandkaiming_norm_fanoutprune_tenas.py. The launcher passeskaiming_normalprune_launch.py, and the repeat loop appends_fanoutor_faninto it prune_tenas.py prune_tenas.py. Neither string matches, so the call does nothing. The networks keep the weights from their constructor, and the repository has no custom initialisation models. Within one pruning round the three repeats therefore share weights and differ only in the batches drawn. - The
noneoperator is removed before search. The paper's operator spaces includenone§4.1 §4.2. The code sets the first operator of every edge to -INF before search and during each scoring call prune_tenas.py prune_tenas.py. Index 0 isnonein both spaces cell_operations.py. - Region counting uses a different network and inputs. The paper forwards 5000 images through "the network" app. A. The code scores regions with a thin network: one channel, no stem, depth 1 for NAS-Bench-201 and depth 2 for DARTS prune_tenas.py prune_tenas.py, with 3000 patches of size 3x3 prune_tenas.py linear_region_counter.py. The paper does not state a thin network or a patch size. The patches come from random 3x3 crops with one randomly chosen colour channel linear_region_counter.py. For imagenet-1k the image is first resized to 32x32 linear_region_counter.py.
- Batch sizes differ. The paper uses 32 app. A. The launcher uses 72, 14 and 24 prune_launch.py prune_launch.py prune_launch.py.
- Ranks use relative changes, averaged over repeats. The paper defines Δκ and ΔR as absolute differences alg. 1. The code divides each change by the unpruned value, then averages the three repeats prune_tenas.py prune_tenas.py. Ties share a rank prune_tenas.py.
- Ranking is global; selection is per edge. All candidates from both cell
types are ranked together, then each edge keeps the lowest-sum candidates
up to
prune_numberprune_tenas.py. - Operators per round differ from the paper's text. The paper says one operator per edge per round §3.2. The DARTS launcher removes three (CIFAR-10) or two (ImageNet) prune_launch.py prune_launch.py.
- A second DARTS stage is not in the paper. After the single-path loop, DARTS runs a group-wise pruning that keeps two operators in each of four edge groups prune_tenas.py prune_tenas.py. The paper's footnote says the DARTS result keeps two operators per edge §3.2 fn. 2. The loop's stop test requires one operator per edge prune_tenas.py. The paper does not describe the group stage, and I did not resolve how the two stages fit together.
- The NTK kernel sums over outputs. The paper writes the NTK with a Jacobian over output units §3.1.1. The code backpropagates a vector of ones through the logits, so each sample's gradient is the gradient of the sum of its outputs ntk.py. The paper does not say how output units are combined.
- Only weight gradients enter the NTK. Parameters whose names contain
weightare used; biases are excluded. This includes batch-norm scale parameters ntk.py. The paper does not state which parameters are used. - Networks run in training mode. Scores are computed with batch statistics in batch-norm layers ntk.py prune_tenas.py. The paper does not say which mode is used.
- Algorithm 1 wording conflicts with the text. The algorithm's comment on the final argmin says "greatest importance", while §3.2 says the lowest importance is pruned alg. 1 §3.2. The code removes the lowest rank sum prune_tenas.py.
Pitfalls
- Search cost units. Table 1 gives GPU seconds, while Tables 2 and 3 give GPU days. The abstract's "0.5 GPU hours" for NAS-Bench-201 on CIFAR-10 matches Table 1's 1558 GPU seconds (about 0.43 hours), not the DARTS CIFAR-10 figure of 0.05 GPU days tab. 1 tab. 2. Do not mix the two.
- Baseline rows in Table 1 look copied. ENAS, DARTS (1st) and DARTS (2nd) all show 54.30, 15.61 and 16.32 with zero deviation tab. 1. This looks like a table error, so do not use those rows as baselines.
- Search evaluates many candidates. Every active operator is scored in each round, and each score repeats the NTK and region counts three times with freshly built networks prune_tenas.py. The NTK needs one backward pass per sample ntk.py. The run needs a CUDA device; the script asserts it prune_tenas.py.
- Following the paper alone gives a different search. Batch size, the thin
scoring network and the
noneremoval all change the scores, so a reimplementation from the paper will not reproduce the released choices. - The condition number depends on batch size. It is computed on the Gram matrix of one batch, so a batch of 32 (paper) and batches of 72, 14 or 24 (launcher) give different values. The paper does not say how batches are drawn app. A.
- Retraining is not in this repository. The appendix's retraining settings app. A cannot be checked against this code. DARTS architectures must be retrained with the external evaluation repository named in the README README.md.
- Expressivity and trainability are measured at initialisation only. The paper's appendix argues that these indicators do not predict generalisation directly, and that NAS-Bench-201 training accuracy tracks test accuracy in its space app. E fig. 10. The method's claim therefore rests on that benchmark property and may not transfer to other search spaces.
- Correlations are from one benchmark. The Kendall-tau values of -0.42 (condition number) and 0.5 (region count) are measured on NAS-Bench-201 §3.1.1 §3.1.2 fig. 1 fig. 3. The paper does not report them for DARTS.
- Not stated in the paper: the rounding precision, the scoring network sizes, the active-operator threshold, tie handling, the NTK batch sampling scheme, and how repeated NTK scores are aggregated.
Lineage
- Builds on: the neural tangent kernel and its finite-width form §2 §3.1.1; linear-region counting of ReLU networks §2 §3.1.2; pruning from scratch (SNIP and related work) §3.2.
- Compared against: NAS w.o. Training, the training-free Jacobian method of Mellor et al. §2 tab. 1; DARTS, PC-DARTS, GDAS, P-DARTS, ProxylessNAS and others tab. 1 tab. 2 tab. 3.
- Superseded by: not stated in this card's sources.
Source and license
Adapted from “Neural Architecture Search on ImageNet in Four GPU Hours: A Theoretically Inspired Perspective” by Wuyang Chen, Xinyu Gong, Zhangyang Wang (arXiv:2102.11535), used under CC BY-SA 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. This page is licensed under CC BY-SA 4.0. Code citations refer to https://github.com/VITA-Group/TENAS at commit 9df78ffd9857 (MIT). Any quoted code is shown under that license.