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

Self-Supervised Representation Learning on Neural Network Weights for Model Characteristic Prediction

Konstantin Schürholt, Dimche Kostadinov, Damian Borth

Introduction

While neural networks are ubiquitous, the high-dimensional "weight space" they inhabit remains largely a mystery. We know how to train these models, but we lack a deep understanding of why two networks with similar architectures might converge to entirely different regions of weight space, or how those specific regions correlate with critical characteristics like accuracy, generalization, or the hyperparameters used during training.

Previous attempts to analyze weights have typically relied on manually designed statistics (such as layer-wise mean or variance) or supervised learning. However, manual features are often too simplistic to capture complex network dynamics, and supervised models trained directly on weights tend to overfit to specific labels rather than learning the underlying structure of the model population. The core challenge is finding a task-agnostic way to extract meaningful, compact features from the complex "soup" of neural network weights.

To address this, researchers have introduced a self-supervised framework to learn informative embeddings of neural network weights, termed hyper-representations. By leveraging structural symmetries in weight space and attention-based architectures, these representations can accurately predict a model's performance, hyperparameters, and generalization gap.

A Self-Supervised Framework for Weights

The proposed method utilizes a Self-Supervised Learning (SSL) approach to learn representations from "Model Zoos"—large collections of trained neural network models.

Overview of the self-supervised representation learning framework, from model zoos to hyper-representations.

The framework relies on three main components:

  1. The Architecture: The system uses an encoder-decoder framework. While standard fully-connected networks are tested, the primary innovation is an attention-based transformer architecture. Weights (or groups of weights belonging to a neuron) are treated as tokens in a sequence. A special "compression token" aggregates information across the entire network into a single latent vector ($z$).
  2. Learning Objectives: The framework experiments with three SSL tasks:
  3. Reconstruction (ED): An autoencoder task where the model attempts to reconstruct the original weights.
  4. Contrastive (Ec): Utilizing the NT-Xent loss to ensure that different "augmented" versions of the same model have similar representations, while versions of different models are pushed apart in the latent space.
  5. Hybrid (EcD): A combination of both reconstruction and contrastive losses.
  6. Domain-Specific Augmentations: Because standard image augmentations do not apply to weights, the authors introduce domain-specific techniques:
  7. Permutation: Exploiting the fact that hidden layer neurons can be reordered without changing the network's function.
  8. Erasing: Randomly zeroing out sections of the weight vector.
  9. Noise: Adding Gaussian noise to the weights.

Key Insights: Symmetry and Attention

A major takeaway from the research is that symmetry is key. The permutation augmentation proved crucial for robust learning. By teaching the encoder that the order of neurons does not change the "identity" or function of the model, the resulting hyper-representations become significantly more generalizable.

Illustration of weight permutation, a crucial augmentation that exploits structural symmetries in neural networks.

Furthermore, unlike simple Multi-Layer Perceptrons (MLPs), the attention mechanism allows the model to capture long-range dependencies between weights in different layers. This is vital for understanding the global behavior of the network rather than just localized weight distributions. Ultimately, these hyper-representations capture a "latent footprint" of the training process, encoding not just performance, but the specific hyperparameters and data fractions used to train the original model.

Experimental Results

The authors evaluated their hyper-representations using linear probing—training a simple linear model on top of the fixed embeddings to predict various model characteristics across several Model Zoos (like MNIST-HYP, CIFAR10-HYP, and custom TETRIS zoos).

  • Superior Prediction: Hyper-representations consistently outperformed raw weights ($W$) and layer-wise statistics ($s(W)$). On the TETRIS-SEED zoo, the $R^2$ score for accuracy prediction reached 90.2%, compared to 86.9% for basic statistics.
  • Hyperparameter Recovery: The embeddings successfully predicted the original learning rate, dropout rate, and even the activation function used during training with high accuracy (often $>90\%$).
  • Out-of-Distribution (OOD) Generalization: Because the representations are learned in a task-agnostic way, they capture fundamental properties of weight space that transfer across datasets. A probe trained to predict the generalization gap on MNIST models successfully ranked the generalization gap of models trained on Fashion-MNIST, achieving a high Kendall’s $\tau$ correlation.

Limitations and Future Directions

While highly effective for small and medium-sized networks, scaling this method to massive modern architectures (like ResNets or Large Language Models) remains a challenge. It would require significant computational resources and potentially new ways to tokenize millions or billions of weights. Additionally, the authors noted that adding noise as an augmentation yielded inconsistent results and was difficult to tune compared to permutation and erasing.

Future work may explore learning representations across zoos trained on entirely different datasets, which could further improve OOD capabilities and lead to a more universal, foundational understanding of neural network weight spaces.

Summary updated

BibTeX
@inproceedings{schurholt2021self,
  author = {Konstantin Schürholt and Dimche Kostadinov and Damian Borth},
  title = {{Self-Supervised Representation Learning on Neural Network Weights for Model Characteristic Prediction}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
}
Figure