Understanding Weight Similarity of Neural Networks via Chain Normalization Rule and Hypothesis-Training-Testing

Guangcong Wang, Guangrun Wang, Wenqi Liang, Jianhuang LaiarXiv 2022 · DOI

Abstract

A long-standing question in deep learning is whether neural networks trained on the same task converge to structurally similar internal representations or remain disparate "black boxes." This research introduces the Chain Normalization Rule to address the challenge of permutation symmetry and proposes a novel Hypothesis-Training-Testing (HTT) framework. Our findings demonstrate that Stochastic Gradient Descent (SGD) consistently finds solutions that are remarkably similar in a high-dimensional metric space, allowing for highly accurate task identification based solely on model weights.

Introduction

While different training runs of the same neural network architecture often achieve comparable accuracy, the internal weight configurations ($W$) have traditionally been viewed as structurally distinct due to the non-convex nature of the loss landscape. A primary obstacle in comparing these weights is permutation symmetry: neurons within a hidden layer can be reordered without changing the network's output function, yet this reordering fundamentally alters the raw weight matrices. Consequently, standard statistical metrics often fail to detect underlying similarities. This paper seeks to "open the black box" by providing a mathematical framework to quantify structural weight similarity.

Methodology

To bridge the gap between raw weights and meaningful similarity measures, we propose two core innovations:

1. Chain Normalization Rule

To overcome permutation noise, we developed a transformation that makes weights invariant to neuron swapping. Instead of analyzing an individual layer's weights ($W_l$), we examine a "chain" of weights from the input to that layer. The rule utilizes the transformation $\phi(W_1, \dots, W_l) = W_1 W_2 \dots W_l W_l^T \dots W_2^T W_1^T$. This ensures that even if neurons were randomly permuted during training, the resulting "normalized" representation remains consistent across different models trained on the same task.

Figure 1: Illustration of weight permutation and the normalization process that aligns disparate weight configurations.

2. Hypothesis-Training-Testing (HTT)

We extend traditional hypothesis testing by treating trained weights as discriminative data points. Under the HTT framework, we hypothesize that weights from the same task are equivalent in a metric space. We then train a "weight classifier" to distinguish between weights generated by different tasks and evaluate its performance on weights from a held-out set of models. High classification accuracy serves as empirical proof of consistent, task-specific weight structures.

Experimental Results

We validated our approach across standard benchmarks including Tiny ImageNet, CIFAR-100, and NameData, covering Multi-Layer Perceptrons (MLP), Convolutional Neural Networks (CNN), and Recurrent Neural Networks (RNN).

The Impact of Normalization

Our results highlight that normalization is critical for revealing weight similarity. As shown in the comparative analysis, unnormalized weights provide poor discriminative power. For instance, in MLP classification, accuracy drops from 99.4% with normalization to just 62.9% without it. In more complex CNN architectures, the gap is even more pronounced, with unnormalized weights often yielding near-random performance.

Figure 2: Top-1 and Rank-1 accuracy for classification and retrieval tasks, comparing unnormalized (blue) vs. normalized (orange) weight representations across different layers (L1-L3) and chains (C1-C3).

Key Findings

  • Weights as Features: Trained weights are themselves highly discriminative. A simple classifier can identify the training task of a previously unseen model with near-perfect accuracy (>99% for Tiny ImageNet).
  • SGD Consistency: Despite random initialization, SGD is not a random walk; it consistently navigates toward structurally related local solutions.
  • Architectural Robustness: Minor architectural tweaks (e.g., changing activation functions) do not significantly shift the local solution, though major changes like introducing residual connections (ResNet) do have a measurable impact on weight configuration.

Conclusion and Future Work

This work provides a rigorous framework for understanding the internal consistency of neural networks. By accounting for permutation symmetry, we show that deep learning models are far more structured and predictable than previously thought. Future research may leverage these insights for improved AutoML, 3D scene recognition via implicit representations, and new methods for auditing data privacy by analyzing model weights.

Summary updated

BibTeX
@misc{wang2022understanding,
  author = {Guangcong Wang and Guangrun Wang and Wenqi Liang and Jianhuang Lai},
  title = {{Understanding Weight Similarity of Neural Networks via Chain Normalization Rule and Hypothesis-Training-Testing}},
  year = {2022},
  eprint = {2208.04369},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.04369},
}
Figure