PAD-Net: An Efficient Framework for Dynamic Networks

Shwai He, Liang Ding, Daize Dong, Boan Liu, Fuqiang Yu, Dacheng Tao

Abstract

Dynamic neural networks, such as Mixture-of-Experts (MoE) and Dynamic Convolution (DY-Conv), offer enhanced representation power by adapting parameters to specific inputs. However, this flexibility often results in a significant increase in parameter count and memory footprint. This paper introduces PAD-Net (Partially Dynamic Network), a framework that strategically converts redundant dynamic parameters into static ones. By employing an Iterative Mode Partition (IMP) algorithm, PAD-Net identifies essential dynamic components, achieving superior performance with significantly fewer parameters and reduced computational costs across both vision and language tasks.

Introduction

In the pursuit of higher model capacity, researchers have increasingly adopted dynamic networks. Unlike static models where weights remain fixed after training, dynamic models adapt their parameters for every input. While this boosts representation power, it imposes a heavy "tax": a fully dynamic model can possess five times the parameters of its static counterpart, leading to substantial memory overhead and high computational costs. PAD-Net addresses a fundamental question: Is it necessary for every parameter in a dynamic layer to be dynamic? The authors argue that the current "all-or-nothing" approach leads to significant redundancy, where many parameters are recalculated without contributing to improved performance.

Methods

The PAD-Net framework introduces a novel approach to balancing model capacity and efficiency through two primary components:

  1. Partially Dynamic Architecture: Instead of maintaining 100% dynamism, PAD-Net splits layers into a dynamic subnetwork (input-dependent) and a static subnetwork (fixed). Scale factors are utilized to balance the intensity of these two modes.
  2. Iterative Mode Partition (IMP): Inspired by network pruning, IMP identifies which parameters are essential to remain dynamic. It calculates an importance score based on the sensitivity of the loss function to making a specific dynamic parameter static. Starting from a fully dynamic network, the algorithm iteratively "demotes" the least important dynamic parameters until a target dynamic ratio ((\kappa)) is reached.
Figure 1: Overview of the PAD-Net framework showing the transition from intrinsic parameters to computational parameters through dynamic and static modes.

Key Insights: The Redundancy Paradox

A core finding of this research is that partially dynamic networks often outperform their fully dynamic counterparts. For instance, a ResNet-50 with only 30% dynamic parameters outperformed the 100% dynamic version. This suggests that excessive dynamism may introduce noise or instability into the network's representations. The success of PAD-Net relies on the IMP algorithm's ability to use gradients to find the "winning tickets"—the specific parameters that truly benefit from being input-dependent.

Experimental Results

PAD-Net was rigorously evaluated across Computer Vision (CV) and Natural Language Processing (NLP) domains:

  • Computer Vision: On ImageNet, PAD-Net surpassed fully dynamic networks by +0.7% top-1 accuracy for ResNet-50 while using only 30% dynamic parameters. It also achieved lower FLOPs than standard dynamic convolutions.
  • Natural Language Processing: For BERT models on the GLUE benchmark, PAD-Net achieved a +1.9% average score increase over MoE-BERT while using only 50% dynamic parameters. In a BERT-Base setup, PAD-Net reduced the parameter count from 506M (standard MoE) to 308M while improving results.
Figure 6: Performance comparison of PAD-Net against static and fully dynamic baselines (CondConv, DY-Conv) across different ResNet depths and widths.

Conclusion and Future Work

PAD-Net demonstrates that "less is more" in the context of dynamic networks. By strategically partitioning parameters into static and dynamic modes, the framework achieves state-of-the-art performance with significantly improved efficiency. Future work includes extending this approach to other dynamic structures like Switch Transformers and exploring more complex tasks such as machine translation. Additionally, automating the search for the optimal dynamic ratio per layer via meta-learning remains a promising avenue for further optimization.

Summary updated

BibTeX
@inproceedings{he2023pad,
  author = {Shwai He and Liang Ding and Daize Dong and Boan Liu and Fuqiang Yu and Dacheng Tao},
  title = {{PAD-Net: An Efficient Framework for Dynamic Networks}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.803},
}
Figure