NNiT: Width-Agnostic Neural Network Generation with Structurally Aligned Weight Spaces

Jiwoo Kim, Swarajh Mehta, Hao-Lun Hsu, Hyunwoo Ryu, Yudong Liu, Miroslav Pajic

Abstract: Generative modeling of neural network parameters is often tied to architectures because standard parameter representations rely on known weight-matrix dimensions. Generation is further complicated by permutation symmetries that allow networks to model similar input-output functions while having widely different, unaligned parameterizations. In this work, we introduce Neural Network Diffusion Transformers (NNiTs), which generate weights in a width-agnostic manner by tokenizing weight matrices into patches and modeling them as locally structured fields. We establish that Graph HyperNetworks (GHNs) with a convolutional neural network (CNN) decoder structurally align the weight space, creating the local correlation necessary for patch-based processing. Focusing on MLPs, where permutation symmetry is especially apparent, NNiT generates fully functional networks across a range of architectures. Our approach jointly models discrete architecture tokens and continuous weight patches within a single sequence model. On ManiSkill3 robotics tasks, NNiT achieves >85% success on architecture topologies unseen during training, while baseline approaches fail to generalize.

Introduction

While generative AI has revolutionized image and text synthesis, generating functional neural network weights remains a significant challenge. Two primary obstacles hinder progress: permutation symmetry and rigid architectural constraints. Permutation symmetry allows for the swapping of neuron orders without altering output, which renders standard weight spaces unstructured and difficult for generative models to learn. Furthermore, most existing models are "width-locked," meaning they cannot generate weights for architectures with dimensions differing from those seen during training.

NNiT enables the generation of functional MLP weights across varying widths (Wide, Medium, Narrow) without retraining.

NNiT (Neural Network Diffusion Transformers) addresses these issues by treating weight generation as a multimodal sequence modeling task. By viewing weights as continuous spatial fields rather than flat vectors, NNiT enables zero-shot synthesis of high-performing weights for previously unseen network topologies.

Methodology

The NNiT framework relies on three core innovations to achieve width-agnostic generation:

  1. Structural Alignment via GHNs: To overcome permutation chaos, the authors utilize Graph HyperNetworks (GHNs) with a CNN decoder to produce training data. The CNN decoder imposes a locality bias, forcing weights into a consistent spatial structure that aligns the weight space for the generative model.
  2. Patch Tokenization: Inspired by Vision Transformers (ViTs), NNiT breaks weight matrices into $p \times p$ patches. This allows the model to handle varying widths simply by processing more or fewer patches, decoupling functional logic from specific matrix dimensions.
  3. Multimodal Diffusion Transformer: The backbone is a Diffusion Transformer (DiT) that processes a sequence of discrete architecture tokens (defining layer widths) and continuous weight patches. This is trained using a Mixture of Noise Levels (MoNL) to support both joint generation and conditional synthesis.
The NNiT architecture utilizes a DiT block with AdaLN to process architecture tokens and weight matrix patches, ultimately constructing a functional MLP.

Experimental Results

The model was evaluated on the ManiSkill3 robotics benchmark across tasks such as PickCube-v1, PushCube-v1, and StackCubeEasy-v1. Training involved a dataset of 6,400 expert policies across 64 MLP architectures, with 8 configurations held out to test generalization.

  • Zero-Shot Generalization: NNiT achieved a success rate exceeding 85% on architectures never encountered during training. In contrast, baselines like D2NWG and SANE failed to generalize to unseen widths, often dropping to 0% success.
  • Robustness: On the PushCube-v1 task, NNiT maintained a 100% success rate even on novel architectures, matching expert performance.
  • Joint Synthesis: The model demonstrated the ability to generate entirely new, functional architecture-weight pairs from scratch, proving it had learned the underlying relationship between network shape and parameters.

Discussion and Future Work

NNiT represents a shift toward treating neural weights as "fields," allowing for resolution-flexible generation. While currently focused on MLPs with up to four hidden layers, the "weight-as-video" analogy (depth as time, width as space) suggests a path toward scaling to larger architectures like Transformers or deep CNNs. Future research will address the high variance of continuous weights in deeper models to eventually enable the generation of billion-parameter foundation models.

Summary updated

BibTeX
@inproceedings{kim2026nnit,
  author = {Jiwoo Kim and Swarajh Mehta and Hao-Lun Hsu and Hyunwoo Ryu and Yudong Liu and Miroslav Pajic},
  title = {{NNiT: Width-Agnostic Neural Network Generation with Structurally Aligned Weight Spaces}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=O1hWiHDrvw},
}
Figure