[Paper Review] Graph Neural Networks for Learning Equivariant Representations of Neural Networks
This paper proposes a neural graph representation that encodes neural network parameters as graphs, enabling graph neural networks and transformers to learn equivariant, permutation-invariant representations across diverse architectures. By modeling weights as edges and biases as nodes, the method achieves state-of-the-art performance in tasks like classifying implicit neural representations, predicting generalization, and learning optimization, outperforming prior approaches that rely on fixed architectures or complex weight-sharing patterns.
Neural networks that process the parameters of other neural networks find applications in domains as diverse as classifying implicit neural representations, generating neural network weights, and predicting generalization errors. However, existing approaches either overlook the inherent permutation symmetry in the neural network or rely on intricate weight-sharing patterns to achieve equivariance, while ignoring the impact of the network architecture itself. In this work, we propose to represent neural networks as computational graphs of parameters, which allows us to harness powerful graph neural networks and transformers that preserve permutation symmetry. Consequently, our approach enables a single model to encode neural computational graphs with diverse architectures. We showcase the effectiveness of our method on a wide range of tasks, including classification and editing of implicit neural representations, predicting generalization performance, and learning to optimize, while consistently outperforming state-of-the-art methods. The source code is open-sourced at https://github.com/mkofinas/neural-graphs.
Motivation & Objective
- Address the lack of permutation equivariance in existing methods that process neural network parameters, which leads to inconsistent predictions for functionally identical models.
- Overcome the limitation of prior approaches that require manual weight-sharing patterns or are restricted to fixed architectures.
- Enable a single model to generalize across heterogeneous neural network architectures, including varying depth, width, activation functions, and connectivity patterns.
- Introduce a unified, structure-aware representation of neural networks using computational graphs to preserve inherent symmetries.
- Demonstrate the effectiveness of this approach across diverse downstream tasks such as INR classification, generalization error prediction, and learning-to-optimize.
Proposed method
- Represent a neural network as a computational graph where each neuron is a node and each weight matrix entry is an edge, with biases as node features and weights as edge features.
- Introduce 'probe features'—activations from a forward pass on a representative input—to enrich node representations with functional information beyond static parameters.
- Adapt standard graph neural networks (GNNs) and transformers to process these neural graphs, leveraging their inductive biases for permutation equivariance.
- Ensure invariance to neuron permutations by encoding the graph structure explicitly, avoiding reliance on symmetric statistics or data augmentation.
- Train the model end-to-end on tasks such as INR classification, generalization prediction, and learning-to-optimize, using the graph-structured input to capture architectural and functional dependencies.
- Use a unified framework that supports both homogeneous and heterogeneous architectures, including MLPs, CNNs, and theoretical representations of transformers.
Experimental results
Research questions
- RQ1Can a single neural network model learn invariant and equivariant representations of neural network parameters across diverse architectures without architectural constraints?
- RQ2How does incorporating the computational graph structure of a neural network improve performance in tasks like generalization prediction and implicit neural representation classification?
- RQ3To what extent can graph neural networks and transformers trained on neural graphs outperform models that flatten parameters or use symmetric statistics?
- RQ4Can the proposed method generalize across architectures with different numbers of layers, widths, activation functions, and connectivity patterns like residual connections?
- RQ5How does the inclusion of probe features—representing neuron activations—enhance the model’s ability to distinguish between functionally similar but structurally different networks?
Key findings
- The proposed neural graph representation enables GNNs and transformers to achieve state-of-the-art performance across multiple tasks, including INR classification and generalization error prediction.
- On the FashionMNIST validation set, NG-T outperformed all baselines, with NG-GNN achieving the best performance on the CIFAR-10 test set, demonstrating strong generalization.
- NG-GNN outperformed NG-T on CIFAR-10, indicating that message-passing GNNs are particularly effective for complex, high-dimensional tasks in the learning-to-optimize setting.
- The training and test curves on CIFAR-10 show that NG-GNN's performance gap over baselines grows over time, highlighting its superior learning dynamics and scalability.
- The method consistently outperforms prior approaches that rely on flattened parameters or symmetric statistics, which fail to preserve functional invariance under weight permutations.
- The source code is publicly available at https://github.com/mkofinas/neural-graphs, enabling reproducibility and extension to new architectures and tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.