Dynamic Deep Neural Networks: Optimizing Accuracy-Efficiency Trade-Offs by Selective Execution

Lanlan Liu, Jia Deng

Abstract

Dynamic Deep Neural Networks ($D^2NN$) introduce a flexible architecture for "selective execution," allowing networks to dynamically decide which neurons to activate based on the input. By integrating "control nodes" trained via reinforcement learning alongside standard layers, $D^2NN$ learns to route simple inputs through efficient paths while reserving complex computation for difficult cases. This framework optimizes for non-differentiable metrics and arbitrary graph topologies, achieving significant efficiency gains—such as a 50% reduction in multiplications on ImageNet subsets—without compromising accuracy.

Introduction

Standard deep neural networks (DNNs) are computationally static, applying the same operations to every input regardless of its complexity. This "one-size-fits-all" approach leads to significant inefficiencies, particularly for resource-constrained deployments like mobile devices or high-throughput data centers. While conditional computation and cascaded models have been explored, they often lack the flexibility to handle complex topologies or optimize for non-decomposable metrics like the F-score.

The $D^2NN$ framework addresses these limitations by treating a neural network as a Directed Acyclic Graph (DAG) where execution paths are determined on-the-fly. This allows for end-to-end optimization of arbitrary dynamic execution graphs, balancing accuracy and computational cost.

The $D^2NN$ Framework

The authors define a $D^2NN$ as a DAG consisting of three primary node types:

  1. Regular Nodes: Standard differentiable layers like convolutional or fully connected layers.
  2. Control Nodes: Sub-networks that output a "control score" to determine the downstream execution path.
  3. Dummy Nodes: Placeholders representing skipped computations to minimize power and time costs.
Example of a Chain topology in the D2NN framework, showing sequential control nodes (Q1-Q3) routing between different processing paths.

Hybrid Training and "Mini-Bags"

Because control decisions are discrete and non-differentiable, $D^2NN$ employs a hybrid training strategy. Regular node weights are updated via standard backpropagation, while control nodes are optimized using Q-Learning. The network is rewarded based on a weighted combination of accuracy and efficiency.

To optimize for "set-based" metrics like Precision or F-score, which cannot be calculated for a single example, the authors introduced Mini-Bags. By defining rewards over a small set of images rather than individual instances, the framework can directly optimize for global performance metrics.

Experimental Evaluation

The $D^2NN$ framework was evaluated across diverse tasks, including face detection (LFW-B), hierarchical classification (ILSVRC-10), and spatial attention (Cluttered MNIST).

Key Results and Trade-offs

A central strength of $D^2NN$ is its ability to learn input-dependent routing. For instance, clear, frontal faces are routed through low-capacity sub-networks, while occluded or profile views trigger high-capacity paths. By adjusting a hyperparameter $\lambda$ in the reward function, users can generate a precise accuracy-efficiency trade-off curve.

Accuracy vs. cost trade-off curve for the Chain topology on the LFW-B dataset, demonstrating D2NN's superior performance compared to fixed-size baselines.

On the ILSVRC-10 task, $D^2NN$ matched the accuracy of a full-scale static network while utilizing only 50% of the multiplications. In face classification (LFW-B), the framework achieved a superior trade-off curve compared to simply scaling static networks.

Discussion and Future Work

While $D^2NN$ offers significant theoretical efficiency gains, the authors noted a gap between multiplication reduction (e.g., 53%) and actual wall-time reduction (e.g., 18%). This discrepancy highlights the need for better alignment between dynamic execution graphs and modern GPU kernels, which are optimized for static workloads.

Additionally, training $D^2NN$ is more computationally intensive, typically requiring 2 to 4 times longer to converge than standard DNNs due to the reinforcement learning component. Future work will focus on hardware-aware optimization and improving training efficiency for datasets with high input variance.

Conclusion

Dynamic Deep Neural Networks provide a robust framework for selective execution, enabling fine-grained control over the accuracy-efficiency trade-off. By combining backpropagation with reinforcement learning and supporting complex DAG topologies, $D^2NN$ paves the way for more adaptive and efficient deep learning systems.

Summary updated

BibTeX
@inproceedings{liu2018dynamic,
  author = {Lanlan Liu and Jia Deng},
  title = {{Dynamic Deep Neural Networks: Optimizing Accuracy-Efficiency Trade-Offs by Selective Execution}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.1609/aaai.v32i1.11630},
}
Figure