Introduction
Can you reconstruct the exact internal weights of a "black-box" neural network just by watching how it responds to inputs? In machine learning, we usually focus on function approximation—training a model to produce the correct output. However, in fields like neuroscience (reverse-engineering brain circuits) or cybersecurity (model stealing), the goal shifts to parameter recovery: identifying the specific weights and architecture of a target "teacher" network.
This task is notoriously difficult because neural networks are riddled with symmetries. You can swap two neurons in a hidden layer (permutation) or scale weights up in one layer and down in the next (scaling), and the network's output remains identical. Furthermore, the optimization landscape is highly non-convex; training a "student" network of the exact same size as the teacher often gets stuck in local minima.
To bypass these hurdles, this paper introduces Expand-and-Cluster (E&C), a novel method demonstrating that parameter recovery is possible by training multiple overparameterized student networks and using hierarchical clustering to distill the teacher's original parameters from the resulting noise.
The Expand-and-Cluster Methodology
The authors propose a systematic, two-phase strategy to reverse-engineer a target network's weights:
1. The Expansion Phase
Instead of training a student network of the same size as the target, the method trains $N$ different student networks that are significantly overparameterized (e.g., 4x to 8x wider). Recent theory suggests that while minimal networks have "rough" loss landscapes, overparameterized ones become "effectively convex." This relaxation makes it much easier for gradient descent to reach a global minimum where the student perfectly imitates the teacher's input-output mapping.
2. The Clustering Phase
After training, the $N$ students are functionally identical to the teacher but contain many redundant neurons. The authors collect all the incoming weight vectors from all students and perform hierarchical clustering.
- The "Aha" Moment: Neurons that correspond to actual teacher neurons will appear consistently across different student initializations, forming dense clusters.
- Filtering: Redundant "junk" neurons (categorized into types like "zero-type" or "constant-type") are inconsistent and appear as outliers or small, unaligned clusters. These are discarded.
Finally, the remaining cluster centers become the recovered weights. The authors then solve a simple linear regression problem to find the correct output weights and biases, reconstructing the network layer-by-layer.
Key Insights and Symmetry Taxonomy
- Overparameterization as a Tool: Usually, extra parameters are viewed as an overfitting risk. Here, they are deliberately used to relax a hard optimization problem, turning a needle-in-a-haystack search into a manageable clustering task.
- Symmetry Taxonomy: The paper provides a rigorous breakdown of how different activation functions (ReLU, GeLU, Sigmoid, Tanh) create different symmetries. For example, "even + linear" functions (like GeLU) allow for a "covert" symmetry where groups of neurons can cancel out their non-linear parts to mimic a linear operation.
- The Persistence of Truth: The core philosophy of E&C is that the "true" features of the teacher network are the only ones that students will converge to reliably. Everything else is just noise created by the specific random initialization of the student.
Experimental Results
The method was rigorously evaluated across 150 synthetic problems of varying difficulty (including multidimensional XOR and checkerboard functions) and standard benchmarks (MNIST, FashionMNIST, CIFAR-10).
- High Precision: E&C successfully recovered weights with extremely low error (RMSE as low as $10^{-14}$) and identified the correct hidden layer sizes with less than 10% overhead.
- Deep Recovery: The method successfully scales to deep networks by reconstructing them sequentially, layer-by-layer.
- Superiority over Pruning: Compared to state-of-the-art pruning methods (like the Lottery Ticket Hypothesis), E&C consistently found the minimal underlying architecture. Pruning often fails to reach the minimal teacher size and struggles to maintain perfect functional equivalence.
- Mapping Independence: In a cross-dataset experiment, a teacher trained on MNIST was successfully recovered by training students on FashionMNIST inputs, proving that recovery depends strictly on the mapping, not the original training data.
Limitations and Future Work
While E&C is a significant step forward in parameter identifiability, it comes with computational costs. Training $N$ (often 10–50) overparameterized students is expensive, especially for very large models. Furthermore, while the paper demonstrates success on MLPs and simple convolutional layers, it has not yet tackled modern architectural staples like Residual Connections or Layer Normalization, which likely introduce new, complex symmetries. Finally, exploring the minimum number of input-output queries needed to identify a model remains a critical open question for security and model-stealing contexts.
Summary updated