Permutation Equivariant Neural Functionals

Allan Zhou, Kaien Yang, Kaylee Burns, Adriano Cardace, Yiding Jiang, Samuel Sokota, J Zico Kolter, Chelsea Finn

Introduction

As deep learning continues to evolve, a new paradigm has emerged where neural networks themselves are treated as data. This is evident in the rise of hypernetworks that generate weights, learned optimizers that produce gradients, and Implicit Neural Representations (INRs) that encode complex signals like 3D shapes or high-resolution images directly into network parameters. However, processing these parameters effectively requires an understanding of their underlying structure. This paper introduces Neural Functional Networks (NFNs), a class of architectures designed to process the weights of other neural networks by leveraging their inherent structural symmetries.

The Challenge: Neuron Permutation Symmetry

Neural network weights are not merely flat vectors; they possess a specific internal geometry. In a standard Multi-Layer Perceptron (MLP), the function computed by the network remains identical if the positions of two neurons in a hidden layer are swapped, provided the incoming and outgoing weights are rearranged accordingly. This property is known as neuron permutation symmetry.

Standard architectures, such as MLPs or 1D CNNs, are unaware of this symmetry. Consequently, when tasked with processing weight-space data, they must expend significant model capacity to learn these symmetries from scratch. NFNs address this by baking permutation equivariance directly into the architecture as a structural inductive bias, similar to how translational invariance is baked into Convolutional Neural Networks (CNNs).

Methods: Building Neural Functional Layers

The authors propose NF-Layers (Neural Functional Layers) as the fundamental building blocks of NFNs. These layers ensure that if the input weights are permuted, the output weights are permuted in a corresponding manner.

Equivariant Parameter Sharing

To achieve equivariance, the linear maps within NF-Layers utilize a specific parameter-sharing scheme. Weights that perform the same functional role relative to the neurons share parameters, ensuring the model treats symmetric configurations identically.

Symmetry Variants

The framework explores two primary variants of symmetry:

  1. Hidden Neuron Permutation (HNP): This assumes only hidden layers are permutable. While mathematically rigorous for most standard networks, it can be parameter-intensive.
  2. Neuron Permutation (NP): A stronger, more aggressive assumption that all neurons—including input and output layers—are permutable. This variant is significantly more parameter-efficient.

To handle cases where input/output layers have a fixed, meaningful order (such as $x, y$ coordinates in an image INR), the authors introduce IO-Encoding. This uses positional embeddings to break symmetry at the boundaries while maintaining the efficiency of NP-style internal layers.

Experimental Evaluation

The authors evaluated NFNs across several diverse weight-space tasks, demonstrating their versatility and efficiency.

Generalization Prediction

Using the "Small CNN Zoo"—a dataset of weights and accuracies for thousands of CNNs trained on CIFAR-10 and SVHN—NFNs were tasked with predicting test accuracy from raw weights. The $NFN_{HNP}$ variant achieved a Kendall’s $ au$ of 0.934 on CIFAR-10, significantly outperforming previous statistical baselines like STATNN.

INR Classification and Editing

NFNs showed remarkable performance in classifying and editing Implicit Neural Representations. On CIFAR-10 INR classification, the $NFN_{NP}$ achieved 46.6% accuracy, a massive improvement over the 18.9% achieved by an augmented MLP. Beyond classification, NFNs demonstrated "weight-space editing" capabilities, such as dilating handwritten digits or adjusting image contrast by processing the INR weights directly, without ever converting them back into pixel space.

Winning Tickets

The researchers applied NFNs to the Lottery Ticket Hypothesis, attempting to predict sparsity masks at initialization. On MNIST, NFN-predicted masks achieved 95.0% test accuracy. This nearly matches the 96.2% accuracy achieved by Iterative Magnitude Pruning (IMP), but without the massive computational overhead of the full IMP process.

Conclusion and Future Work

Neural Functional Networks represent a significant step forward in weight-space learning by formalizing neuron permutation symmetry as a core inductive bias. While the current work focuses on MLPs and simple CNNs, it opens the door for several future research directions. Key challenges remain in scaling these methods to massive models like Large Language Models (LLMs) and extending the symmetry principles to more complex architectures like Transformers or ResNets with skip connections. Nonetheless, the ability of NFNs to predict generalization and edit representations directly in weight-space suggests a powerful new tool for the deep learning toolkit.

Summary updated

BibTeX
@inproceedings{zhou2023permutation,
  author = {Allan Zhou and Kaien Yang and Kaylee Burns and Adriano Cardace and Yiding Jiang and Samuel Sokota and J Zico Kolter and Chelsea Finn},
  title = {{Permutation Equivariant Neural Functionals}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=fmYmXNPmhv},
}
Figure