HM-NAS: Efficient Neural Architecture Search via Hierarchical Masking

Shen Yan, Biyi Fang, Faen Zhang, Yu Zheng, Xiao Zeng, Hui Xu, Mi Zhang

TL;DR

HM-NAS introduces a multi-level architecture encoding and hierarchical masking scheme to liberate Neural Architecture Search (NAS) from rigid, hand-designed heuristics. By treating architecture search as a model pruning problem and directly fine-tuning the optimized supernet weights, it discovers more flexible, compact, and accurate networks at a fraction of the computational cost of traditional methods.

What Problem Does This Paper Address?

While Neural Architecture Search (NAS) successfully automates the design of deep neural networks, early methods required training thousands of candidate models from scratch, costing massive amounts of compute. "Weight-sharing" approaches (like DARTS) solved this by training a single, over-parameterized "supernet" containing all possible operations and connections, allowing candidates to inherit weights directly.

However, current weight-sharing approaches still rely on rigid, hand-designed heuristics to extract the final architecture from the supernet. For example, they often hardcode each node to select exactly two input edges and exactly one operation per edge. This artificially restricts the search space to a small subset of possible designs, leading to sub-optimal architectures. Furthermore, the bilevel optimization used to train these supernets introduces architectural search bias.

Methods

HM-NAS rethinks the weight-sharing pipeline by introducing two key innovations:

  1. Multi-Level Architecture Encoding: Instead of only learning the importance of operations ($\alpha$), HM-NAS introduces an independent set of learnable parameters for edge importance ($\beta$). This allows the network to independently evaluate which connections across the Directed Acyclic Graph (DAG) matter most.
  2. Hierarchical Masking as Pruning: The authors formulate architecture search as a model pruning problem. They introduce three types of real-valued masks—for operations, edges, and network weights. As shown in the masking pipeline below, these masks are thresholded into binary masks and optimized end-to-end using backpropagation and straight-through estimators (similar to BinaryConnect).
The iterative hierarchical masking process

Unlike traditional weight-sharing methods that discard the supernet weights and retrain the discovered architecture from scratch, HM-NAS reuses the unmasked weights and applies a rapid fine-tuning step, drastically cutting down total training time.

Figure 1: The pipelines of (a) existing weight sharing based NAS approaches such as DARTS [7] and SNAS [8]; and (b) HM-NAS (our approach).

Datasets

The authors evaluated HM-NAS on two standard image classification benchmarks:

  • CIFAR-10: Used for primary evaluation, cost analysis, and extensive ablation studies.
  • ImageNet (1000-class): Used to demonstrate the scalability and efficiency of the discovered architectures on a large-scale task.

Key Insights and Ideas

  • Dynamic Connectivity Beats Heuristics: By removing the "exactly two edges per node" constraint, HM-NAS discovers that later nodes in a cell naturally benefit from more incoming edges ($\ge 2$). This happens because later nodes need to aggregate and accumulate richer information passed down from multiple predecessors.
  • Multi-Operation Edges: The optimal networks found by HM-NAS occasionally retain multiple operations on a single edge or drop an edge entirely (zero operations). This flexibility allows for more expressive cell structures that traditional NAS simply cannot explore.
  • Supernet Weights are Valuable: Retraining a searched model from scratch isn't strictly necessary. Reusing the unmasked supernet weights provides an excellent initialization, allowing the model to achieve state-of-the-art accuracy with significantly fewer training epochs.

Key Results

  • Superior Efficiency: On CIFAR-10, HM-NAS completes its search and fine-tuning in just 0.85 (1st order) to 1.8 (2nd order) GPU days. This represents a 2.7× total training speedup compared to DARTS, primarily driven by avoiding retraining from scratch.
Figure 3: Training curves of HM-NAS (in blue color) and DARTS (in red color) on CIFAR-10. Solid lines denote test errors (y-axis on the left); dashed lines denote training errors (y-axis on the right).
  • Highly Compact Models: HM-NAS achieves a 2.41% test error on CIFAR-10 while utilizing only 1.8M parameters—which is 1.4× to 3.2× fewer parameters than competing state-of-the-art methods.
  • Strong ImageNet Performance: When scaled to ImageNet, HM-NAS achieves a 73.4% Top-1 accuracy using only 3.6M parameters and 482M FLOPs, outperforming both DARTS and SNAS while maintaining a lighter computational footprint.

Limitations and Future Work

While HM-NAS successfully removes constraints on edge and operation selection within a cell, other macro-architectural parameters remain fixed by hand-designed choices. Specifically, the total number of cells, the number of channels, the number of nodes per cell, and the choice of reduction operations (e.g., addition vs. concatenation) are still predefined.

The authors suggest that future work could involve relaxing these macro-constraints, extending the multi-level encoding and hierarchical masking schemes to automatically learn the entire network topology from top to bottom.

Summary updated

Abstract

The use of automatic methods, often referred to as Neural Architecture Search (NAS), in designing neural network architectures has recently drawn considerable attention. In this work, we present an efficient NAS approach, named HM- NAS, that generalizes existing weight sharing based NAS approaches. Existing weight sharing based NAS approaches still adopt hand-designed heuristics to generate architecture candidates. As a consequence, the space of architecture candidates is constrained in a subset of all possible architectures, making the architecture search results sub-optimal. HM-NAS addresses this limitation via two innovations. First, HM-NAS incorporates a multi-level architecture encoding scheme to enable searching for more flexible network architectures. Second, it discards the hand-designed heuristics and incorporates a hierarchical masking scheme that automatically learns and determines the optimal architecture. Compared to state-of-the-art weight sharing based approaches, HM-NAS is able to achieve better architecture search performance and competitive model evaluation accuracy. Without the constraint imposed by the hand-designed heuristics, our searched networks contain more flexible and meaningful architectures that existing weight sharing based NAS approaches are not able to discover.
BibTeX
@misc{yan2019hm,
  author = {Shen Yan and Biyi Fang and Faen Zhang and Yu Zheng and Xiao Zeng and Hui Xu and Mi Zhang},
  title = {{HM-NAS: Efficient Neural Architecture Search via Hierarchical Masking}},
  year = {2019},
  eprint = {1909.00122},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.00122},
}
Figure