Abstract
The deployment of deep neural networks in real-world applications is mostly restricted by their high inference costs. Extensive efforts have been made to improve the accuracy with expert-designed or algorithm-searched architectures. However, the incremental improvement is typically achieved with increasingly more expensive models that only a small portion of input instances really need. Inference with a static architecture that processes all input instances via the same transformation would thus incur unnecessary computational costs. Therefore, customizing the model capacity in an instance-aware manner is much needed for higher inference efficiency. In this paper, we propose Dynamic Routing Networks (DRNets), which support efficient instance-aware inference by routing the input instance to only necessary transformation branches selected from a candidate set of branches for each connection between transformation nodes. The branch selection is dynamically determined via the corresponding branch importance weights, which are first generated from lightweight hypernetworks (RouterNets) and then recalibrated with Gumbel-Softmax before the selection. Extensive experiments show that DRNets can reduce a substantial amount of parameter size and FLOPs during inference with prediction performance comparable to state-of-the-art architectures.
Introduction
Standard deep learning models typically employ a "one size fits all" approach, where every input instance—regardless of its complexity—undergoes the same sequence of mathematical operations. This static processing is inherently inefficient, as research suggests that a significant portion of input data consists of "easy" instances that require only a fraction of a model's total capacity. While Neural Architecture Search (NAS) has optimized static architectures, they remain rigid at inference time. Dynamic Routing Networks (DRNets) address this by creating an instance-aware architecture that scales its complexity on-the-fly based on the specific input.
Methodology
DRNets achieve dynamic inference through three primary components: a modular backbone, lightweight RouterNets, and a differentiable routing mechanism.
Architecture and Routing
The backbone consists of a series of cells. Within each cell, nodes are connected by multiple candidate branches, such as various convolutions or identity skip connections. For each connection, a RouterNet—a tiny hypernetwork—analyzes the incoming feature map to generate importance weights for the available branches.
To enable end-to-end training of these discrete routing decisions, the authors employ the Gumbel-Softmax trick. This allows the network to learn discrete branch selections through standard backpropagation by approximating the discrete selection with a differentiable process.
Training Strategy
Training proceeds in two stages. First, the network undergoes pre-training with a high Gumbel-Softmax temperature to ensure all branches are sufficiently optimized. Subsequently, the model is fine-tuned while the temperature is annealed and a resource-aware regularization term is added to the loss function. This term penalizes high-FLOP branches, encouraging the model to favor efficiency unless complexity is necessary for accuracy.
Experimental Results
The performance of DRNets was evaluated on CIFAR-10 and ImageNet datasets, demonstrating significant efficiency gains.
Efficiency and Accuracy
On CIFAR-10, DRNets achieved accuracy comparable to the DARTS model while utilizing 3.71x fewer parameters and 4.53x fewer FLOPs. When compared to the manually designed MobileNetV2 (1.5x), a compact DRNet variant delivered superior accuracy with only 13.48% of the parameters and 46.41% of the FLOPs.
Instance-Aware Behavior
Analysis of the selection ratios across different cells reveals how the model adapts to input. As shown in Figure 6, the model learns to prioritize different operations at different depths. For instance, skip connections are frequently selected in early layers for simpler features, while more complex separable convolutions are reserved for deeper, more challenging transformations.
Conclusion
DRNets provide a robust framework for instance-aware inference, significantly reducing computational overhead without sacrificing predictive performance. By bypassing the heavy search costs of traditional NAS and offering runtime control over the speed-accuracy trade-off, DRNets represent a practical step toward efficient, adaptive AI deployment. Future work may involve exploring more complex cell topologies and optimizing for specific hardware branching behaviors to further bridge the gap between theoretical FLOP reductions and actual inference speed.
Summary updated