TL;DR
Weight Space Learning (WSL) has traditionally been bottlenecked by the need for "model zoos"—expensive, meticulously curated collections of neural networks trained in identical laboratory settings. This paper introduces a novel backbone that drops this requirement entirely, learning high-quality weight representations directly from thousands of uncurated, heterogeneous, and undocumented models downloaded "in the wild" from Hugging Face. The resulting single representation not only matches or outperforms traditional model-zoo baselines but also generalizes across diverse architectures and entirely unseen data modalities.
What Problem Does This Paper Address?
Neural network weights can be treated as a distinct data modality. Weight Space Learning (WSL) aims to learn representations from these weights to perform downstream tasks like predicting a model's accuracy without running it (discriminative) or generating entirely new, high-performing weights (generative).
However, existing WSL methods are severely constrained: they require homogeneous input populations where every model shares the same architecture or training dataset. Creating these "model zoos" requires massive computational overhead and limits flexibility. Meanwhile, public repositories like Hugging Face host millions of models, but they are highly unstructured, vary wildly in architecture and dataset, and are often poorly documented. This paper tackles the challenge of training a single WSL backbone capable of digesting this messy, heterogeneous ecosystem at scale.
Methods
The authors build upon SANE (Sequential Autoencoder for Neural Embeddings), an encoder-decoder transformer architecture, introducing three critical modifications to handle unstructured model populations:
- Masked Loss Normalization (MLN): Traditional methods normalize weights per layer across an entire dataset beforehand. This fails when architectures vary. MLN normalizes loss contributions per-token at runtime, ignoring zero-padding masks. This removes scale-related biases and stabilizes training across completely different weight distributions.
- Dense Tokenization: Instead of slicing weights row-wise along outgoing channels (which introduces heavy zero-padding for diverse architectures), the authors flatten each layer's weight matrix and cut it into fixed-size tokens. This reduces disk usage by 20% and accelerates training.
- Sinusoidal Positional Encoding: To avoid the massive memory overhead of learned positional embeddings when scaling to large models (up to 1.3B parameters), the authors implement parameter-free, scale-invariant sinusoidal encodings.
Datasets
- Training/Validation: A curated subset of 2,000 training and 200 validation computer vision models automatically scraped from Hugging Face (filtered from an initial query of 22,055 models spanning image classification, segmentation, depth estimation, and object detection). This collection comprises a total of 171 billion individual parameters.
- Evaluation/Downstream Tasks:
- Vision Datasets: CIFAR-10, CIFAR-100, TinyImageNet (TIN), SVHN, EuroSAT, and ImageNet-1K.
- Language Datasets: OpenWebText (used to evaluate out-of-distribution generalization).
Key Insights and Ideas
- The Power of "The Wild": Dataset diversity beats laboratory curation. Training on a messy, heterogeneous mix of models from Hugging Face yields weight representations that generalize far better to unseen downstream tasks than backbones trained on clean, homogeneous model zoos.
- Cross-Modality Generalization: In a striking "aha moment," the authors demonstrate that a weight-space model trained exclusively on vision models can successfully generate initialization weights for a language model (GPT-2), leading to faster convergence than standard random initialization.
- Data Volume Compensates for Noise: Hugging Face models are inherently noisy—some are unconverged, others are poorly trained. However, the sheer volume and architectural diversity of the data allow the transformer backbone to overcome this noise and learn the underlying structure of weight spaces.
Key Results
- Normalization Efficiency: As shown in Figure 6, Masked Loss Normalization (MLN) prevents layers with narrow weight distributions from being squashed during reconstruction. On a ResNet-18 generation task, MLN significantly outperformed traditional layer-wise loss normalization (LWLN) on CIFAR-100 (29.00% vs 20.4% accuracy) and TinyImageNet (24.76% vs 11.7% accuracy).
- Generative Performance: The large HF-trained backbone (
HF (L)) outperformed traditional model-zoo-trained SANE baselines across almost all target datasets (SVHN, EuroSAT, TIN, CIFAR-100), except for CIFAR-10. - Multi-Architecture Scalability: The single HF-trained backbone successfully generated weights for 25 distinct architectures (including ResNets, ConvNeXts, EfficientNets, and ViTs) on ImageNet-1K. After just a few epochs of finetuning, these generated models consistently achieved higher validation accuracies than training the same configurations from scratch.
Limitations and Future Work
- The "Impurities" Bottleneck: Generated weights initially perform near random guessing before finetuning. Small weight impurities catastrophically impact initial inference, meaning a few steps of standard SGD optimization are still mandatory to "rescue" the model.
- Selection Bias: The authors applied only basic feasibility checks during downloading. The dataset might suffer from selection bias (e.g., an over-representation of ImageNet-trained models), which warrants further study into how such biases affect representation robustness.
- Modality Constraints: The primary backbone was still trained on computer vision models; future work should expand the training pool to include native language models and audio architectures.
Summary updated