TL;DR
Weight space learning—treating the weights of trained neural networks as a new data modality—has traditionally been restricted to "homogeneous" model zoos where every network shares the exact same architecture and training dataset. This paper breaks that limitation by introducing a masked per-token loss normalization technique, enabling training on diverse, heterogeneous model populations. The authors demonstrate that increasing model zoo diversity significantly boosts the zero-shot generalization of generated weights, outperforming single-zoo training by up to 42.8%.
What Problem Does This Paper Address?
Imagine if every time you wanted to train a generative model for images, you could only train it on a single, perfectly uniform dataset of identical objects. That is roughly where Weight Space Learning has been stuck. This emerging field treats the parameters (weights) of pre-trained neural networks as data points, learning representations to either analyze model properties or generate entirely new, functional network weights.
However, existing approaches require highly homogeneous "model zoos" (collections of trained models). If the models in the zoo are trained on different datasets or feature varying padding configurations, standard weight space learning backbones fail. They struggle to handle the mismatched weight distributions across different layers and datasets, often squashing narrow distributions (like those in batch normalization layers) toward the mean. This severely limits their ability to generalize to unseen tasks or architectures.
Methods
The authors build upon SANE (Sharing Attention Network for Evaluation/Generation), an encoder-decoder transformer backbone that tokenizes neural network weights into sequences. To accommodate heterogeneous model zoos, they introduce a novel Masked Per-Token Loss Normalization applied at runtime.
Instead of performing a global preprocessing step across the entire dataset (which fails when architectures or datasets vary), this method standardizes the target ($T$) and predicted ($\hat{T}$) weight tokens dynamically:
$$\text{Normalized Token} = \frac{Token - \mu}{\sigma}$$
Crucially, because SANE uses zero-padding to align tokens from different architectures or layer sizes, a naive normalization would skew the mean and standard deviation toward zero. To fix this, the authors incorporate a binary mask ($M_i$) that ensures only valid weight signals—and not the padding—contribute to the mean ($\mu$) and standard deviation ($\sigma$) calculations.
Datasets
The approach was evaluated across two distinct structural setups:
- Small CNN Zoos (~2.5k parameters): 4,000 total model samples trained on MNIST, SVHN, USPS, and FMNIST.
- ResNet-18 Zoos (~12M parameters): 3,000 total model samples trained on CIFAR10, CIFAR100, TinyImageNet (TIN), SVHN, and EuroSAT.
The datasets were strategically categorized into In-Distribution (ID) (seen during SANE training), Near-Out-of-Distribution (NOOD) (similar domain but unseen), and Far-Out-of-Distribution (FOOD) (entirely unseen domains, e.g., satellite imagery from EuroSAT) to rigorously test zero-shot knowledge transfer.
Key Insights and Ideas
- Data Diversity Matters for Weights, Too: Just as training computer vision models on diverse image datasets improves robustness, training weight-space models on diverse model zoos prevents overfitting. Increasing the diversity of the model zoo composition yields far better generalization than simply scaling up the number of models from a single dataset.
- Traditional Model Souping Fails Across Zoos: Simple weight-averaging techniques (like model soups or permutation alignment via git re-basin) see a sharp performance drop when combining models from different training runs or datasets, highlighting the need for learned generative approaches.
- Preserving the Mask is Non-Negotiable: Without the proposed masked normalization, the transformer squashes the narrow weight distributions of batch-norm and convolutional layers, destroying the generated model's performance.
Key Results
- Massive Zero-Shot Gains: Multi-zoo SANE (trained jointly on CIFAR10 and CIFAR100 models) outperformed single-zoo baselines across the board. On ResNet-18 architectures, it improved zero-shot weight generation performance by an average of 29.65%, and up to 42.8% when transferring from CIFAR100 to the completely unseen EuroSAT dataset.
- Outperforming Prior State-of-the-Art: The multi-zoo approach beat standard SANE baselines on complex downstream datasets, boosting accuracy by ~15% on TinyImageNet and ~10% on CIFAR100.
- Excellent Fine-Tuning Initializations: Weights generated by SANE proved to be highly effective initializations for subsequent fine-tuning, achieving faster convergence and higher final accuracy compared to HyperNetworks or random initialization.
Limitations and Future Work
The authors note a delicate balancing act between diversity and sample size: increasing dataset diversity without providing enough total model samples can lead to undersampling of complex domains, which occasionally degrades downstream performance.
Additionally, while this work successfully tackles diversity in the underlying training datasets of the model zoos, fully exploring structural heterogeneity—such as training a single weight-space model on entirely different backbone architectures simultaneously (e.g., mixing CNNs, ResNets, and ViTs)—remains an open and exciting frontier for future research.
Summary updated