Abstract
The learned weights of a neural network have often been considered devoid of scrutable internal structure. In this paper, however, we look for structure in the form of clusterability: how well a network can be divided into groups of neurons with strong internal connectivity but weak external connectivity. We find that a trained neural network is typically more clusterable than randomly initialized networks, and often clusterable relative to random networks with the same distribution of weights. We also exhibit novel methods to promote clusterability in neural network training, and find that in multi-layer perceptrons they lead to more clusterable networks with little reduction in accuracy. Understanding and controlling the clusterability of neural networks will hopefully render their inner workings more interpretable to engineers by facilitating partitioning into meaningful clusters.
Introduction
Deep learning models are frequently criticized as "black boxes"—monolithic structures where every parameter potentially interacts with every other, making interpretation difficult. In contrast, biological brains and complex engineered systems are typically modular, consisting of distinct components that perform specialized sub-tasks. This research investigates whether artificial neural networks naturally develop such modularity during training and explores methods to quantify and encourage this structural organization, termed clusterability.
Methodology
To analyze modularity, the authors represent a neural network as a weighted, undirected graph. In this representation, neurons (or channels in CNNs) serve as nodes, while the absolute values of the weights connecting them define the edge weights.
The primary metric for measuring modularity is the normalized cut (n-cut), derived from spectral clustering. A low n-cut value indicates that the network can be partitioned into groups with dense internal connections and sparse external connections. To determine if observed clusterability is a meaningful property of the learned weights rather than just a byproduct of the weight distribution, the authors compare trained networks against "shuffled" baselines—networks with identical weight values rearranged randomly.
Experimental Setup
The study evaluates clusterability across a diverse range of benchmarks:
- Standard Datasets: MNIST, Fashion-MNIST, and CIFAR-10 for basic image classification.
- Large-Scale Models: ImageNet-trained architectures including VGG, ResNet, and Inception-V3.
- Synthetic Benchmarks: The "Halves" and "Stack" datasets, where two distinct images are combined (side-by-side or in different color channels). These datasets test if task-level independence (e.g., classifying two separate images simultaneously) forces the network to adopt a modular architecture.
Drivers of Clusterability
The research identifies several key factors that influence the development of modular structure:
- Pruning: Removing small weights is the most significant driver of absolute clusterability, effectively carving out distinct functional modules from the initial dense connectivity.
- Dropout: This technique encourages "relative" clusterability. By forcing the network to be robust to the absence of specific paths, it leads to weight arrangements that are significantly more modular than their shuffled counterparts.
- Task Complexity: Large-scale models like Inception-V3 exhibit high natural clusterability, suggesting that modularity may be a prerequisite for solving complex, high-dimensional tasks.
Results
Quantitative analysis reveals that trained Multi-Layer Perceptrons (MLPs) are consistently more clusterable than 98% of their shuffled counterparts. In the case of ImageNet models, modularity is even more pronounced, with Inception-V3 outperforming 99% of its shuffled versions.
The authors also introduced Clusterable Initialization and Clusterability Regularization (penalizing the network based on the Laplacian matrix's eigenvalues). These methods successfully increased modularity in MLPs with minimal impact on accuracy. For instance, regularized MLPs on MNIST maintained approximately 96% accuracy while achieving significantly higher modularity scores than standard models.
Discussion and Future Work
While these findings provide a path toward more interpretable AI, computational challenges remain. Calculating the eigenvalues required for regularization is expensive, limiting its current applicability to very large models. Additionally, while MLPs responded well to these techniques, Convolutional Neural Networks (CNNs) proved more resistant, likely because the convolutional operation itself imposes a form of local modularity. Future research will focus on extending these methods to other domains, such as Natural Language Processing, and investigating whether these structural clusters correspond to specific, human-understandable sub-functions.
Summary updated