ESM: A Framework for Building Effective Surrogate Models for Hardware-Aware Neural Architecture Search

Azaz-Ur-Rehman Nasir, Samroz Ahmad Shoaib, Muhammad Abdullah Hanif, Muhammad Shafique

TL;DR

Hardware-aware Neural Architecture Search (HW-NAS) relies heavily on surrogate models to predict deployment latency, but inaccurate predictions often steer searches toward suboptimal network designs. This paper introduces ESM, a framework featuring a novel "Feature Combination Count" encoding and an active data-extension loop that builds highly accurate latency predictors while minimizing expensive hardware profiling time.

What Problem Does This Paper Address?

To deploy Deep Neural Networks (DNNs) on resource-constrained edge devices, engineers use Hardware-aware Neural Architecture Search (HW-NAS) to find designs that balance accuracy and latency. Because measuring the latency of thousands of candidate networks directly on target hardware is incredibly time-consuming, researchers use "surrogate models" (like machine learning predictors or lookup tables) to estimate performance.

However, current surrogate models suffer from three major flaws:

  1. Inaccuracy distorts the Pareto front: Even slight inaccuracies in latency estimation can cause the search algorithm to miss truly optimal models and select suboptimal configurations.
  2. Poor architecture encoding: Standard ways of representing a network's architecture for an ML predictor (like one-hot vectors or statistical averages) are either too sparse or lose critical information about how different layers interact. As a result, simply adding more training data fails to improve prediction accuracy for large search spaces.
  3. High data acquisition costs: Measuring actual hardware latency requires multiple inferences to account for hardware fluctuations, making dataset generation the primary bottleneck in building surrogate models.
Fig. 2. Impact of inaccuracy in latency prediction on neural architecture search results. (a) illustrates the top-5 accuracy vs. latency plot of 243 different ResNet architectures generated by varying the depth values of the pre-trained ResNet50 supernet made available by Cai et al. [5]. The accuracy numbers are generated by evaluating each candidate model on the ImageNet validation set, and the latency numbers are generated by running the model on an RTX4090 GPU. (b) illustrates how the actual Pareto-optimal points can potentially move in the architecture space when the latency prediction is slightly inaccurate.

Methods

The authors propose ESM, a holistic framework designed to generate reliable datasets and train highly accurate latency predictors efficiently.

Overview of the ESM Framework

The core components of ESM include:

  • Feature Combination Count (FCC) Encoding: A novel encoding scheme that maps network architectures to compact, dense vectors. Instead of treating features independently, FCC creates combinations of block features (e.g., kernel size, width expansion ratio) and counts their occurrences. This retains crucial interaction information without creating overly sparse vectors.
  • Balanced Sampling Strategy: Instead of uniform random sampling—which naturally biases datasets toward average network depths due to the Central Limit Theorem—ESM divides the architecture space into bins based on block depth. It samples equally from each bin to ensure the predictor learns "corner case" architectures effectively.
  • Train-Evaluate-Extend Loop: ESM uses an iterative active learning approach. It trains an initial Multi-Layer Perceptron (MLP) regressor, evaluates its accuracy across different depth bins, and selectively samples new architectures only for the bins falling below a user-defined accuracy threshold ($Acc_{TH}$).
  • Rigorous Quality Control: To combat hardware measurement noise, ESM runs multiple inferences, discards the fastest and slowest 20%, and uses a set of stable "reference models" to detect and re-profile hardware anomalies if variance exceeds 3%.

Datasets

The framework was evaluated using three distinct supernet architecture spaces derived from the Once-for-All (OFA) paradigm:

  • ResNet Supernet (~$8.38 \times 10^{26}$ possible architectures)
  • MobileNetV3 Supernet (~$8.38 \times 10^{26}$ possible architectures)
  • DenseNet Supernet (~$10^{10}$ possible architectures)

Accuracy metrics for these architectures were evaluated on the ImageNet validation set. Latency datasets were collected directly on four target hardware platforms:

  • GPUs: NVIDIA RTX 4090, NVIDIA RTX 3080 Max-Q
  • CPUs: AMD Ryzen Threadripper 5975
  • Edge Devices: Raspberry Pi 4

Key Insights and Ideas

  • More data isn't a silver bullet for bad encodings: The authors demonstrated that when using standard statistical encodings on large search spaces like ResNet, increasing the training set from 8,000 to 20,000 samples yielded virtually no accuracy gain. The bottleneck was the overlapping representation space, which FCC resolves.
  • Smart sampling beats brute-force profiling: Random sampling requires a massive amount of data to accurately predict the performance of very shallow or very deep networks. By forcing a balanced distribution across network depths, the model masters these tricky edge cases much faster.
  • Optimizing the meta-runtime: Because benchmarking a single model on a GPU takes roughly the same amount of time as training a small regression model, an iterative active-learning framework drastically reduces total development time by avoiding unnecessary hardware profiling.
Fig. 4. (a) Comparison between the time required to accurately compute the latency of a model derived from the pre-trained ResNet50 supernet by Cai et al. [5] on an RTX4090 GPU and the training time for a latency predictor. On average, training a regression model of reasonable size on an RTX4090 GPU takes approximately the same amount of time as computing the latency of a model on the target hardware. (b) Latency values across inferences for different architectural configurations, illustrating the need for multiple iterations to obtain a reliable value.

Key Results

  • Superior Accuracy: The MLP predictor trained with FCC encoding achieved 97.6% accuracy for the ResNet supernet using just 8,000 samples, comprehensively outperforming state-of-the-art statistical encodings (~85.8%) and bias-corrected Lookup Tables (~83.9%).
  • Rapid Convergence: Using the Balanced Sampling strategy, the ESM framework hit its target accuracy threshold in just 3 iterations (500 samples), whereas random sampling required 37 iterations (4,000 samples) to achieve the same result.
  • Cross-Device Consistency: FCC consistently outperformed alternative encodings across all tested hardware, maintaining up to 99% accuracy on edge devices like the Raspberry Pi 4.

Limitations and Future Work

The ESM framework specifically targets layer/block-wise operation spaces built on top of a fixed macro-architecture (where the overall graph topology is predetermined, but block properties vary). The authors do not discuss how well this encoding or sampling methodology scales to completely open, macro-architecture search spaces where arbitrary cell connections are permitted. Additionally, while the framework is theoretically applicable to energy consumption estimation, the experimental validation in this paper focuses exclusively on latency.

Summary updated

BibTeX
@inproceedings{nasir2025esm,
  author = {Azaz-Ur-Rehman Nasir and Samroz Ahmad Shoaib and Muhammad Abdullah Hanif and Muhammad Shafique},
  title = {{ESM: A Framework for Building Effective Surrogate Models for Hardware-Aware Neural Architecture Search}},
  booktitle = {DAC},
  year = {2025},
  doi = {10.1109/dac63849.2025.11132572},
}
Figure