Abstract
One-shot neural architecture search allows joint learning of weights and network architecture, reducing computational cost. We limit our search space to the depth of residual networks and formulate an analytically tractable variational objective that allows for obtaining an unbiased approximate posterior over depths in one-shot. We propose a heuristic to prune our networks based on this distribution. We compare our proposed method against manual search over network depths on the MNIST, Fashion-MNIST, SVHN datasets. We find that pruned networks do not incur a loss in predictive performance, obtaining accuracies competitive with unpruned networks. Marginalising over depth allows us to obtain better-calibrated test-time uncertainty estimates than regular networks, in a single forward pass.
Introduction
Neural Architecture Search (NAS) automates the design of neural networks but often requires prohibitive computational resources. Furthermore, modern Residual Networks (ResNets) are frequently over-parameterized, leading to wasted compute and pathologically overconfident predictions. This research addresses these challenges by proposing a "one-shot" method to find the optimal depth for ResNets using Variational Inference. By treating network depth as a probabilistic variable, a single model can learn both its weights and its ideal architecture simultaneously.
Methods: Learnt Depth Networks (LDN)
The core of the proposed approach is the Learnt Depth Network (LDN). Unlike standard ResNets with a fixed depth, LDNs treat depth ($d$) as a categorical random variable with a prior distribution favoring shallower models.
Technical Implementation
- All-at-Once Forward Pass: Activations from every residual block are sent to a shared output head. This allows the model to evaluate the likelihood of the data at every possible depth in a single forward pass.
- Exact ELBO: Because the categorical distribution over depth is finite, the Evidence Lower Bound (ELBO) can be calculated analytically. This avoids the noise associated with Monte Carlo sampling typically found in Bayesian Neural Networks.
- Pruning Heuristic: Post-training, the model can be pruned. If a shallower version achieves 95% of the confidence of the deepest version, extra layers are removed to accelerate inference.
Results and Discussion
The researchers evaluated LDNs on benchmarks including 2D Spirals, MNIST, Fashion-MNIST, and SVHN.
Depth and Complexity
On the 2D Spiral dataset, the model demonstrated an inherent ability to match complexity: as the data became more "twisty," the model automatically favored deeper architectures. In deeper models, layers beyond the optimal point learned identity mappings, effectively "turning themselves off."
Efficiency and Calibration
LDNs achieved significant inference speedups through pruning: 62% on MNIST, 41% on Fashion-MNIST, and 37% on SVHN, without sacrificing accuracy. Beyond efficiency, marginalizing over different depths during prediction provided better-calibrated uncertainty estimates. LDNs were less likely to assign high confidence to incorrect predictions compared to standard deterministic ResNets.
Conclusion
Variational depth search offers a promising path for efficient NAS. While currently restricted to depth search on medium-scale datasets, the method provides a robust framework for obtaining calibrated, efficient models in a single training run. Future work will explore scaling this exact ELBO evaluation to larger datasets like ImageNet and expanding the search space to include width and kernel sizes.
Summary updated