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

Hyper-Representations as Generative Models: Sampling Unseen Neural Network Weights

Konstantin Schürholt, Boris Knyazev, Xavier Giró-i-Nieto, Damian Borth

Abstract

Deep learning typically treats trained models as isolated artifacts. However, recent evidence suggests that neural network weights reside on a low-dimensional manifold. This paper presents a framework for learning this "hyper-representation" using a Transformer-based autoencoder trained on model zoos. By introducing Layer-Wise Loss Normalization (LWLN), the authors overcome the "weak link" problem that previously hindered weight generation. The resulting generative model can sample entirely new, high-performing weights, enabling applications in rapid initialization, efficient ensemble learning, and cross-dataset transfer.

Introduction

The proliferation of deep learning has resulted in millions of trained models. Rather than viewing these as independent points, this research explores the underlying structure of the parameter space. The goal is to learn a hyper-representation that captures the essence of functional neural networks, allowing us to treat the weight space as a generative domain.

Methods

The core architecture is a Transformer-based autoencoder that compresses flattened weight vectors into a latent code $z$. To make this representation truly generative, the authors address the challenge of high-dimensional parameter spaces where standard reconstruction losses often fail.

The complete pipeline: (1) Curating model zoos, (2) Training the hyper-representation with LWLN, (3) Sampling new weights from the latent space, and (4) Evaluating the generated models.

Layer-Wise Loss Normalization (LWLN)

Previous attempts at weight generation often resulted in models that performed no better than random guessing. The authors identify the "weak link" hypothesis: standard global Mean Squared Error (MSE) loss causes autoencoders to ignore layers with small weight magnitudes. LWLN solves this by normalizing the reconstruction error for each layer individually, ensuring the model pays equal attention to all parameters.

Sampling Strategies

Once the hyper-representation is learned, new models can be generated using several strategies:

  • $S_{KDE}$: Modeling the latent space distribution via Kernel Density Estimation.
  • $S_{Neigh}$: Sampling neighbors of high-performing models in a reduced-dimensional space using UMAP.
  • $S_{GAN}$: Navigating the latent space using a Generative Adversarial Network.

Datasets: Model Zoos

The hyper-representation is trained on "model zoos" for MNIST, SVHN, CIFAR-10, and STL-10. Each zoo contains 1,000 CNNs trained with diverse random seeds and hyperparameters, providing a rich dataset of functional weight configurations.

Key Insights

The failure of traditional generative models in weight space is often due to "reconstruction collapse" in specific layers. LWLN prevents this by balancing the loss across the architecture. Furthermore, the authors find that latent embeddings tend to populate the shell of a high-dimensional sphere rather than a Gaussian distribution, explaining why standard VAEs often struggle with weight data.

Visualizing the 'weak link' problem: The top row shows reconstruction collapse in specific layers leading to poor accuracy. The bottom row shows how LWLN preserves weight distributions across all layers, maintaining model performance.

Collective Memory

The hyper-representation acts as a form of "collective memory" for the model zoo. Sampling from it allows a new model to start with the distilled wisdom of 1,000 previous training runs, rather than starting from scratch.

Key Results

  • Superior Initialization: Weights sampled from the hyper-representation provide a massive head start. On SVHN, sampled weights achieved ~51.5% accuracy at Epoch 0, far exceeding the ~10% of random initialization.
  • Efficient Ensembles: Sampling multiple models from the learned representation allows for the creation of high-performing ensembles without the cost of training each member from scratch.
  • Transfer Learning: Hyper-representations trained on one dataset (e.g., SVHN) generate weights that serve as excellent initializations for related tasks (e.g., MNIST), accelerating convergence and improving final accuracy.

Limitations and Future Work

The current approach is limited by scale, as encoding massive architectures like ResNets remains computationally intensive. Additionally, the decoder is currently architecture-specific. Future research will focus on cross-architecture hyper-representations that can generalize across different neural network designs.

Summary updated

BibTeX
@inproceedings{schurholt2022hyper,
  author = {Konstantin Schürholt and Boris Knyazev and Xavier Giró-i-Nieto and Damian Borth},
  title = {{Hyper-Representations as Generative Models: Sampling Unseen Neural Network Weights}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=V0zdYFeyHo3},
}
Figure