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

Diffusion-based Neural Network Weights Generation

Bedionita Soro, Bruno Andreis, Hayeon Lee, Wonyong Jeong, Song Chong, Frank Hutter, Sung Ju Hwang

Introduction

Transfer learning is the cornerstone of modern deep learning, but it is becoming constrained by its own success. Currently, solving a new task usually requires downloading a massive pretrained model and fine-tuning it. D2NWG (Diffusion-based Neural Network Weights Generation) is a novel framework that uses latent diffusion to "hallucinate" task-specific neural network weights on demand. By learning the underlying distribution of weights from diverse pretrained models, it offers a scalable alternative to traditional transfer learning, matching or exceeding the performance of standard models while eliminating the need to store and search through massive model repositories.

The Transfer Learning Bottleneck

The standard paradigm of fine-tuning creates two major bottlenecks:

  1. Model Selection & Storage: We are drowning in "model zoos." Finding the right architecture and weights for a specific dataset is a needle-in-a-haystack problem, and storing thousands of specialized models is computationally expensive.
  2. Fine-tuning Overhead: Traditional fine-tuning is slow and requires significant compute for every new task.

The authors ask a provocative question: Instead of searching for or training weights, can we just generate them? While previous "hypernetworks" tried this, they struggled to scale to complex architectures or generalize to truly novel tasks.

The D2NWG Framework

D2NWG approaches weight generation as a generative modeling problem, specifically using Latent Diffusion Models (LDMs).

The D2NWG training and sampling pipeline, illustrating weight encoding, dataset encoding, and the diffusion process.

The process happens in three distinct stages:

  1. Weight Compression (The VAE Stage): Neural network weights are high-dimensional. To make generation feasible, the authors use a Variational Autoencoder (VAE) to compress these weights into a lower-dimensional "latent space."
  2. Task Understanding (The Encoder Stage): To tell the generator what kind of weights to make, the system needs to understand the target task. For images, they use a Set Transformer to create an embedding of the dataset. For language tasks, they use an LLM (Llama-3-8B) to encode task descriptions.
  3. Conditional Generation (The Diffusion Stage): A diffusion model is trained to reverse-engineer noise into valid weight latents, conditioned on the task embeddings from Stage 2.

For Large Language Models (LLMs), where the parameter count is astronomical, the authors introduce a Layer Selection Strategy based on the Marchenko-Pastur distribution. This mathematical tool helps identify which layers are "signal" (important) versus "noise," allowing the model to focus on generating weights for only the most critical parts of the network.

Core Mechanisms & Insights

  • Weights Live on a Manifold: The core "aha moment" is that successful neural network weights aren't random; they occupy a specific, lower-dimensional manifold. Diffusion models are exceptionally good at capturing these complex, non-linear distributions.
  • Zero-Shot Initialization: One of the most powerful findings is that D2NWG can generate weights for a dataset it has never seen before. These weights serve as a "super-initialization" that converges much faster than random or standard ImageNet initialization.
  • Scaling to Billions: Unlike previous weight-generation methods that were limited to tiny toy networks, D2NWG successfully generated weights for models as large as GPT2-Small and even optimized components for 8-billion-parameter LLaMA models.
  • Task Steering: By conditioning on task descriptions, the model can "steer" the generation process, effectively acting as an automated, generative version of AutoML.

Performance & Efficiency

The authors evaluated D2NWG across a massive range of benchmarks, including Computer Vision datasets (mini-ImageNet, CIFAR-10/100, STL-10) and Natural Language Processing tasks (GLUE, OpenLM Leaderboard v2).

Performance and runtime comparison across various domains, highlighting D2NWG's massive efficiency gains.

Key results include:

  • Efficiency: The model can generate high-performing weights for a 400M+ parameter architecture in seconds on a single GPU (reducing a 6-hour process to roughly 40 seconds), whereas training those weights from scratch would take hours or days.
  • Few-Shot Dominance: In few-shot learning scenarios where data is very scarce, D2NWG provided a 6% improvement over traditional methods.
  • LLM Performance Boost: On the OpenLM leaderboard, D2NWG improved LLaMA-3-2-1B-Instruct performance by 3% on mathematical reasoning and showed a consistent 0.36% gain across all benchmarks without any traditional fine-tuning.
  • Retrieval Capability: D2NWG effectively acts as a "neural weight retriever," generating parameters that are on par with or better than the best models found in a traditional model zoo.

Limitations and Future Directions

The authors acknowledge a few hurdles. First is the Meta-Storage Problem: while D2NWG reduces the need to store thousands of task-specific models, you still need a large "zoo" of weights to train the D2NWG model in the first place. Second, neural networks have permutation symmetries (neurons can be swapped without changing the output), which can confuse generative models. Finally, generating the entire weight set for a 70B+ parameter model remains a massive memory and convergence challenge.

Future work will likely involve making the weight encoders more "symmetry-aware" and exploring how this could lead to truly self-optimizing AI systems that rewrite their own weights as they encounter new environments.

Summary updated

BibTeX
@inproceedings{soro2025diffusion,
  author = {Bedionita Soro and Bruno Andreis and Hayeon Lee and Wonyong Jeong and Song Chong and Frank Hutter and Sung Ju Hwang},
  title = {{Diffusion-based Neural Network Weights Generation}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=j8WHjM9aMm},
}
Figure