Abstract
Neural Functional Transformers (NFTs) represent a significant advancement in the field of neural functionals—models designed to operate directly on the weights of other neural networks. By incorporating specialized attention mechanisms that respect the permutation symmetries inherent in weight spaces, NFTs achieve state-of-the-art performance in tasks such as implicit neural representation (INR) classification and generalization prediction. Notably, the NFT-based INR2ARRAY framework improves CIFAR-10 INR classification accuracy by 17% over previous linear methods.
Introduction
Most machine learning models are engineered to process "natural" data such as images, text, or audio. However, there is a growing interest in neural functionals: models that take other neural networks as input. This capability is critical for tasks like editing a network's behavior, predicting model generalization, or classifying the signal stored within an Implicit Neural Representation (INR).
The fundamental challenge in this domain is that weight spaces possess neuron permutation symmetries. For instance, swapping the positions of two neurons in a hidden layer and adjusting the connecting weights accordingly leaves the network’s mathematical function identical. A robust neural functional must be "equivariant" to these swaps, recognizing that the underlying behavior remains unchanged. While previous approaches utilized linear layers similar to convolutions, they often lacked the expressivity required for complex weight-space tasks.
Architectural Innovation: Neural Functional Transformers
The authors introduce Neural Functional Transformers (NFTs), bringing the power of the attention mechanism to weight-space processing through three primary innovations:
- Weight-Space Self-Attention: This layer is designed to be minimally equivariant. Unlike standard self-attention, which is equivariant to any permutation, this version specifically respects only the "true" neuron permutations that preserve network behavior. This allows the model to focus on structural relationships between weights in adjacent layers without losing track of the network's functional hierarchy.
- Weight-Space Cross-Attention: This mechanism pools high-dimensional weight features into a fixed-size, permutation-invariant representation, facilitating downstream classification or regression tasks.
- INR2ARRAY: Utilizing NFTs, the authors developed the INR2ARRAY framework. This system maps the weights of an INR (e.g., a network representing an image) into a spatial array of latent vectors. This approach captures the local structure of the represented signal more effectively than a single global vector.
Experimental Evaluation
The researchers evaluated NFTs across several weight-space benchmarks, including INR datasets (MNIST, FashionMNIST, CIFAR-10), a "Small CNN Zoo" for generalization prediction, and specific weight-editing tasks (e.g., erosion, dilation, and edge detection performed directly on weights).
Key Results
- State-of-the-Art INR Classification: In INR classification tasks, the INR2ARRAY-NFT architecture achieved 63.4% accuracy on CIFAR-10, representing a 17% improvement over the previous state-of-the-art (NFN). On MNIST, the model reached near-perfect accuracy (98.5%).
- Effective Weight Editing: NFTs consistently outperformed linear weight-space models in editing tasks, achieving lower mean squared error when modifying the signal represented by an INR.
- Generalization Prediction: On the Small CNN Zoo benchmark, NFTs effectively predicted the test accuracy of models based solely on their raw weights, matching or exceeding the performance of traditional hand-engineered statistics.
Discussion and Future Work
The success of NFTs suggests that weight-space processing benefits immensely from the dynamic, global context provided by attention mechanisms. By constraining the model to respect only functional symmetries, the authors provided a strong inductive bias that prevents the model from losing structural information.
However, several limitations remain:
- Computational Complexity: The attention mechanism's $O(n^3)$ or $O(L^2)$ costs make it difficult to process very wide or deep networks.
- Training Stability: Like many Transformer-based architectures, NFTs require careful hyperparameter tuning.
- Scaling: Current experiments focus on MLPs and small CNNs. Future research will need to address the scaling of these functionals to modern architectures like ResNets or large-scale Transformers.
Conclusion
Neural Functional Transformers mark a significant step toward developing AI systems capable of understanding and manipulating other neural networks. By treating weights as a first-class data type and respecting the unique symmetries of weight space, NFTs provide a robust toolkit for the next generation of meta-learning and model analysis.
Summary updated