Introduction
Generating the parameters of a neural network is significantly more complex than synthesizing images or text. While generative AI has mastered pixels and tokens, generating functional neural network weights has been hindered by the fundamental nature of network architectures. In this paper, researchers introduce Neural Network Diffusion Transformers (NNiTs), a generative framework capable of synthesizing functional neural network weights for architectures it has never seen before. By treating weight matrices as spatially correlated "patches" rather than flat vectors, NNiT achieves over 85% success on zero-shot robotics tasks, effectively decoupling weight generation from fixed network dimensions.
The Challenge: Permutation Symmetry and Rigid Dimensions
Two major "walls" stand in the way of effective neural network parameter generation:
- Permutation Symmetry: In a standard Multilayer Perceptron (MLP), the positions of two neurons in a hidden layer (and their associated weights) can be swapped without altering the network's output. Consequently, there are countless ways to represent the exact same mathematical function. To a standard generative model, this permutation symmetry looks like unstructured noise, as adjacent weights lack a meaningful spatial relationship.
- Rigid Dimensions: Most existing weight-generation models are "width-locked." They are trained to produce a fixed-size vector corresponding to a specific architecture. If tasked with generating weights for a network that is even slightly wider or narrower than the training set, the model's coordinate system breaks down, leading to a failure in generalization.
The authors of NNiT aim to create a width-agnostic generator that treats weights as a continuous field, allowing the model to dynamically "fill in" weights for arbitrary architecture sizes.
Methodology: Taming the Weight Space
To overcome these hurdles, the researchers introduce a two-stage approach designed to structure and tokenize the weight space:
Structural Alignment via Graph HyperNetworks (GHNs)
To solve the permutation problem, the authors utilize Graph HyperNetworks (GHNs) equipped with a Convolutional Neural Network (CNN) decoder. Because CNNs possess an inherent "locality bias," they force the generated weights to exhibit local spatial correlations (often visible as vertical banding in heatmaps). This process "aligns" the weight space into a consistent topological structure that a transformer can effectively process, acting as a "canonicalizer" that filters the messy, unaligned space of standard Stochastic Gradient Descent (SGD) weights into a structured subset of functional networks.
Patch Tokenization
Borrowing concepts from Vision Transformers (ViTs), NNiT breaks these structurally aligned weight matrices into $p \times p$ patches. Instead of viewing a layer as a single, rigid block, the model interprets it as a collection of local features. In this framework, making a layer wider is analogous to increasing the resolution of an image—you do not need a new model; you simply generate more patches.
The NNiT Architecture
NNiT is built as a multimodal Diffusion Transformer. It processes a sequence containing both discrete architecture tokens (representing layer widths) and continuous weight patches. The model employs a Mixture of Noise Levels (MoNL) training strategy, enabling it to handle two distinct modes:
- Joint Generation: Creating a novel architecture and its corresponding weights entirely from scratch.
- Conditional Synthesis: Taking a user-defined architecture and generating the functional weights to populate it.
Experimental Setup
The authors evaluated NNiT across two distinct domains to prove its versatility:
- ManiSkill3 (Robotics): A dataset of 6,400 expert policies was created for continuous control tasks like
PickCube,PushCube, andStackCube. These policies were MLPs with varying hidden layer widths. Specific "unseen" architectures were held out to rigorously test zero-shot generalization. - MNIST: A standard image classification benchmark used to demonstrate that the method generalizes beyond robotic control.
The "ground truth" training weights were generated by an ensemble of 128 independent GHNs, providing the structurally aligned data necessary for the diffusion model.
Key Results
- Zero-Shot Mastery: On the ManiSkill3 robotics tasks, NNiT maintained a remarkable >85% success rate on architecture topologies it had never encountered during training.
- Baseline Comparisons: Existing state-of-the-art models, such as D2NWG and SANE, struggled significantly in width-agnostic settings. On the
PickCubetask, D2NWG's success dropped to 59% on unseen widths. SANE failed almost entirely (1% success) because its global positional embeddings could not adapt to the shift in token counts. - Functional Diversity: Using Centered Kernel Alignment (CKA), the authors demonstrated that NNiT does not simply memorize a single type of weight distribution; it generates a diverse range of functional solutions.
- MNIST Generalization: NNiT achieved 96.1% test accuracy on MNIST using architectures entirely absent from the training set, proving its efficacy in standard classification tasks.
Limitations and Future Directions
While NNiT represents a significant leap forward, the authors note several limitations and avenues for future research:
- Depth and Scale: Current experiments are limited to 4-hidden-layer MLPs. While patch tokenization theoretically supports any depth, training very deep diffusion models for continuous, unbounded weights remains computationally expensive and prone to instability.
- Weight Range Variance: Unlike image pixels (which are bounded between 0-255), neural weights have high variance and are unbounded. Future work could adapt stabilization techniques from high-resolution pixel diffusion models to better handle weight variance.
- The Video Analogy: The authors suggest that framing network depth as a "temporal" dimension could allow the integration of Video Diffusion Transformers. This conceptual leap could potentially scale the NNiT approach to synthesize billion-parameter foundation models in the future.
Summary updated