NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Mining the Weights Knowledge for Optimizing Neural Network Structures

Mengqiao Han, Xiabi Liu, Zhaoyang Hai, Xin DuanarXiv 2021

Abstract

Knowledge embedded in the weights of the artificial neural network can be used to improve the network structure, such as in network compression. However, the knowledge is set up by hand, which may not be very accurate, and relevant information may be overlooked. Inspired by how learning works in the mammalian brain, we mine the knowledge contained in the weights of the neural network toward automatic architecture learning in this paper. We introduce a switcher neural network (SNN) that uses as inputs the weights of a task-specific neural network (called TNN for short). By mining the knowledge contained in the weights, the SNN outputs scaling factors for turning off and weighting neurons in the TNN. To optimize the structure and the parameters of TNN simultaneously, the SNN and TNN are learned alternately under the same performance evaluation of TNN using stochastic gradient descent. We test our method on widely used datasets and popular networks in classification applications. In terms of accuracy, we outperform baseline networks and other structure learning methods stably and significantly. At the same time, we compress the baseline networks without introducing any sparse induction mechanism, and our method, in particular, leads to a lower compression rate when dealing with simpler baselines or more difficult tasks. These results demonstrate that our method can produce a more reasonable structure.

Introduction

Modern Deep Neural Networks (DNNs) are notoriously over-parameterized, often requiring massive models to ensure they can learn complex tasks. This leads to significant inefficiency and a high risk of overfitting. While techniques like Neural Architecture Search (NAS) and network compression exist, they often rely on manual heuristics—such as human-defined rules for pruning—which may overlook subtle but critical patterns. Furthermore, NAS is often restricted to pre-defined building blocks, and pruning is frequently treated as a post-processing step rather than an integrated part of the learning process. This paper proposes a method to automatically "mine" the structural knowledge hidden within a network's weights to optimize its architecture dynamically.

Methodology

The core innovation is the Switcher Neural Network (SNN). Unlike traditional networks that process raw data like images, the SNN takes the weight matrices of a Task-specific Neural Network (TNN) as its input.

Overview of the Switcher Neural Network (SNN) framework for optimizing a Task-specific Neural Network (TNN).

The Switcher Architecture and Scaling

The SNN employs a U-Net-like structure to extract features from the TNN’s weights. It outputs "scaling factors" for every neuron, which can result in three distinct states:

  • Pruning (0): Redundant neurons are removed.
  • Weakening (< 1): The neuron's influence is reduced but preserved.
  • Strengthening (≥ 1): Critical neurons are identified, and their signals are amplified.

This mechanism is inspired by biological processes in the mammalian brain, specifically the pruning of unused synapses and the myelination of active axons to speed up electrical impulses.

Alternate Optimization

The SNN and TNN are optimized using a two-phase training algorithm. In the first phase, TNN weights are frozen while the SNN learns to optimize the structure via scaling factors. In the second phase, the SNN is frozen while the TNN updates its weights to adapt to the optimized structure. This cycle repeats until convergence, ensuring that structure and parameters are learned simultaneously.

Key Results

The researchers evaluated the SNN across standard benchmarks including MNIST, CIFAR-10, and Mini-ImageNet. The SNN-optimized models consistently outperformed both original baselines and state-of-the-art compression techniques.

Performance comparison of SNN-optimized models against baselines and other pruning methods on CIFAR-10.

On CIFAR-10, the SNN improved the accuracy of a VGG-cov2 model from 78.90% to 85.13% while reducing the parameter count to approximately 40% of the original. For MobileNetV1 on the same dataset, the SNN achieved 91.00% accuracy, surpassing "Lottery Ticket" and "DNW" methods.

A key insight is that the SNN naturally adjusts compression rates based on task difficulty. For simpler tasks like MNIST, it prunes aggressively, whereas for harder tasks like Mini-ImageNet, it retains more neurons and focuses on strengthening active pathways. This demonstrates that treating weights as data allows for discovering structural efficiencies that human-defined rules might miss.

Conclusion

The Switcher Neural Network offers a novel approach to architecture optimization by mining knowledge directly from model weights. By moving beyond simple sparsity and incorporating neuron strengthening, the SNN produces more reasonable and efficient structures. While currently limited by hardware constraints when optimizing very deep networks, future work will focus on memory-efficient SNN structures to enable full-layer optimization in ultra-deep models.

Summary updated

BibTeX
@misc{han2021mining,
  author = {Mengqiao Han and Xiabi Liu and Zhaoyang Hai and Xin Duan},
  title = {{Mining the Weights Knowledge for Optimizing Neural Network Structures}},
  year = {2021},
  eprint = {2110.05954},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2110.05954},
}
Figure