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

Expand-and-Cluster: Exact Parameter Recovery of Neural Networks

Flavio Martinelli, Berfin Simsek, Johanni Brea, Wulfram Gerstner · DOI

Abstract

Identifying the exact weights and architecture of a black-box neural network—known as parameter recovery—is a long-standing challenge in machine learning. Inherent symmetries and the non-convex nature of the loss landscape typically make this problem intractable. This paper, presented at ICML 2024, introduces Expand-and-Cluster (E&C), a novel framework that turns overparameterization from a hurdle into a solution. By training multiple overparameterized "student" networks to imitate a target "teacher" network, E&C leverages the smoothed loss landscape to reliably reach global minima. Subsequent hierarchical clustering of the student weights allows for the precise identification and extraction of the original teacher parameters.

Introduction: The Challenge of Parameter Recovery

In theory, recovering the weights of a neural network from its input-output mapping is plagued by several types of symmetries:

  1. Permutation Symmetries: Neurons within a layer can be reordered without affecting the output.
  2. Scaling and Sign Symmetries: For activations like ReLU or Tanh, weights can be scaled or flipped if compensated for in adjacent layers.
  3. Overparameterization Symmetries: Redundant neurons can be added that functionally cancel each other out.

These symmetries create a "rough" loss landscape for networks of minimal size, causing standard gradient descent to stall in local minima. The authors propose bypassing this complexity by intentionally overparameterizing the search space.

The Expand-and-Cluster (E&C) Framework

The E&C method operates in two primary phases to navigate the symmetry-laden landscape.

1. The Expand Phase

Instead of training a student network of the same size as the target teacher, the authors train $N$ independent student networks that are significantly larger (e.g., 4x the width). This overparameterization "lifts" the optimization problem, smoothing the loss landscape and allowing students to reach near-zero imitation loss consistently.

The Expand-and-Cluster cycle: lifting the optimization problem to a higher-dimensional space to find global minima.

2. The Cluster Phase

At near-zero loss, the students are functionally equivalent to the teacher but contain many redundant neurons. The authors categorize these into a "Symmetry Catalogue":

  • Duplicate-type: Neurons that directly copy a teacher neuron.
  • Zero-type: Neurons that cancel each other out.
  • Linear-type: Neurons that contribute only to the linear component of the mapping.

By applying hierarchical clustering to the weight vectors across all $N$ students, the algorithm identifies "teacher-like" neurons that appear consistently across different initializations.

Hierarchical clustering of weight vectors across multiple student networks identifies valid teacher neurons while filtering out 'junk' clusters.

Experimental Evaluation

The authors tested E&C on both synthetic and real-world datasets:

  • Synthetic Tasks: Challenging regression problems like multidimensional XOR and checkerboard patterns, where precise hyperplane alignment is critical.
  • Standard Benchmarks: Teacher networks pre-trained on MNIST, FashionMNIST, and CIFAR10. E&C was used to "steal" these models using only their probabilistic outputs.

Key Results

  • High Fidelity: E&C recovered the exact number of neurons and their weights with minimal overhead (less than 10%) in the final reconstructed architecture.
  • Superior to Pruning: Unlike standard pruning methods (e.g., OTOv2), which often lose accuracy when trying to reach the minimal architecture, E&C successfully compressed overparameterized students back to the teacher's original size with near-zero error.
  • Multi-layer Scalability: The method successfully extended to deep fully connected and convolutional networks, demonstrating that the clustering logic holds across hierarchical representations.

Discussion and Future Work

While E&C provides a path to exact recovery, it faces practical limitations. Training dozens of overparameterized students is computationally expensive. Furthermore, the method currently requires a high number of input-output queries. Future research may focus on reducing query complexity or scaling the approach to massive architectures like Transformers. Beyond machine learning, the authors suggest E&C could eventually assist in reverse-engineering biological neural circuits by analyzing unit activity patterns.

Summary updated

BibTeX
@inproceedings{martinelli2024expand,
  author = {Flavio Martinelli and Berfin Simsek and Johanni Brea and Wulfram Gerstner},
  title = {{Expand-and-Cluster: Exact Parameter Recovery of Neural Networks}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=3MIuPRJYwf},
}
Figure