Model Zoo Dataset Samples for Scalable Weight Space Learning

Konstantin Schürholt, Michael W. Mahoney, Damian Borth · DOI

Abstract

Learning representations of well-trained neural network models holds the promise to provide an understanding of the inner workings of those models. However, previous work has either faced limitations when processing larger networks or was task-specific to either discriminative or generative tasks. This paper introduces the SANE approach to weight-space learning. SANE overcomes previous limitations by learning task-agnostic representations of neural networks that are scalable to larger models of varying architectures and that show capabilities beyond a single task. Our method extends the idea of hyper-representations towards sequential processing of subsets of neural network weights, thus allowing one to embed larger neural networks as a set of tokens into the learned representation space. SANE reveals global model information from layer-wise embeddings, and it can sequentially generate unseen neural network models, which was unattainable with previous hyper-representation learning methods. Extensive empirical evaluation demonstrates that SANE matches or exceeds state-of-the-art performance on several weight representation learning benchmarks, particularly in initialization for new tasks and larger ResNet architectures.

Introduction

Deep learning research has long sought to master "weight space learning"—the ability to analyze populations of trained models, known as "model zoos," to uncover fundamental principles or generate optimized new weights. Despite its potential, the field has struggled with two primary challenges: scalability and versatility. Existing "hyper-representation" methods typically attempt to embed entire weight vectors simultaneously. While feasible for small models with a few thousand parameters, this approach fails for modern architectures like ResNets, which contain millions of parameters. Furthermore, most tools are specialized for either discriminative tasks (predicting model properties) or generative tasks (creating new weights), but rarely both.

SANE (Sequential Autoencoder for Neural Embeddings) addresses these gaps by introducing a task-agnostic, scalable representation framework capable of handling diverse model sizes and downstream applications.

Methodology: Sequential Weight Representation

The fundamental innovation of SANE is the tokenization of neural network weights. Rather than treating a network as a single high-dimensional point, SANE decomposes weights into a sequence of tokens, typically organized by layer.

Overview of the SANE framework, from model zoo data to downstream task applications.

Architecture and Training

SANE utilizes a Transformer-based autoencoder. The encoder maps weight tokens into a latent "hyper-representation" space, while the decoder reconstructs the original weights. Training involves a composite loss function:

  1. Reconstruction Loss: Ensures the autoencoder can faithfully recreate the input weights.
  2. Contrastive Loss: Employs augmentations like noise and permutations to help the model learn meaningful, task-agnostic features.

To address "permutation symmetry"—where different weight configurations result in identical functions—SANE aligns all models in the zoo to a common reference model prior to training. For generative applications, SANE employs Kernel Density Estimation (KDE) in the latent space, enabling it to "bootstrap" from a few prompt examples to sample high-performing weight sequences.

Experimental Setup

The researchers evaluated SANE across extensive model zoos:

  • Small CNNs: Models trained on MNIST, SVHN, CIFAR-10, and STL-10 (2.5k to 12k parameters).
  • Large ResNets: ResNet-18 models trained on CIFAR-10, CIFAR-100, and Tiny-ImageNet (~11M parameters).
  • Generalization Tests: Evaluations on VGG architectures and larger ResNets (up to ResNet-101) to assess out-of-distribution performance.

Key Insights and Results

SANE demonstrates that treating weights as a language allows Transformers to capture complex, long-range dependencies between network layers. A significant finding is that global model information, such as overall accuracy, is preserved even within layer-wise embeddings.

Performance comparison of SANE across ResNet and CNN architectures for various discriminative and generative tasks.

Performance Benchmarks

  • Property Prediction: SANE matches or exceeds state-of-the-art performance in predicting test accuracy and generalization gaps.
  • Generative Capabilities: On small CNNs, SANE-generated weights showed a 25% improvement in zero-shot accuracy over previous methods. For ResNet-18 on CIFAR-10, it achieved 68.1% zero-shot accuracy.
  • Smart Initialization: Models initialized with SANE-sampled weights start with high baseline accuracy, significantly outperforming training from scratch even with larger training budgets.
  • Cross-Architecture Transfer: SANE can be "prompted" with weights from one architecture (e.g., ResNet-18) to assist in generating weights for another (e.g., ResNet-34).

Conclusion and Future Work

SANE represents a significant advancement in weight space learning by enabling scalability to modern architectures and versatility across tasks. However, current limitations include a reliance on homogeneous zoos for pretraining and the need for "prompt" examples for very large models. Future research will explore extending SANE to other domains, such as Large Language Models (LLMs) and Reinforcement Learning.

Summary updated

BibTeX
@inproceedings{schurholt2024model,
  author = {Konstantin Schürholt and Michael W. Mahoney and Damian Borth},
  title = {{Model Zoo Dataset Samples for Scalable Weight Space Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=ug2uoAZ9c2},
}
Figure