Interfaces and Modules: A Scalable Representation for Weight-Space Learning across Architectures
Organizations: University of Oxford · AITHYRA
Abstract
Weight-space learning across architectures requires representations that respect parameter symmetries and scale to large networks. Existing equivariant tensor encoders require architecture-specific symmetry specifications, while neuron graphs make global attention costly. We introduce a typed graph organized around shared coordinate-permutation actions. Its nodes, called interfaces, represent coordinate spaces whose bound tensor axes must be permuted jointly; operation occurrences, called modules, form typed hyperedges. A compiler derives this graph from supported PyTorch models, with exact recovery of the permutation factors defined by its constraints. The Universal Weight Encoder (UWE) combines local equivariant updates to parameter features with global attention over invariant interface summaries. The small number of interfaces makes global attention practical, and a single encoder processes different supported architectures. UWE is competitive with architecture-specific state-of-the-art methods on established benchmarks. On a new zoo of 1,200 transformers spanning 100 architectures, it outperforms the evaluated baselines at ranking networks within unseen architectures, including architectures larger than those used for training, while using substantially less memory.
Figures & tables
| Network | Parameters | Interface widths | ||
| ResNet-18 (20 convolutions) | 11.7M | 12 | 2,880 | 64–512, three of each |
| ResNeXt-50 d (53 convolutions) | 25.0M | 1,029 | 19,008 | mostly 4–32 |
| ViT-S/16 | 22.1M | 157 | 28,032 | 384, 64, 1536 |
| ViT-B/16 | 86.6M | 301 | 56,064 | 768, 64, 3072 |
| ViT-L/16 | 304.3M | 793 | 148,480 | 1024, 64, 4096 |
| GPT-2 Small | 124.4M | 301 | 56,064 | 768, 64, 3072 |
| INR accuracy (%) | CNN zoo | ||
|---|---|---|---|
| Method | MNIST | F-MNIST | |
| DWSNet | – | ||
| NFN NP | |||
| NFN HNP | |||
| NG-GNN | |||
| NG-T | |||
| common, common | common, beyond | full, full | |||||||
| Model | Params | MSE | h | MSE | MSE | h | |||
| Predict the training mean | — | 0.9720 | — | — | 1.5510 | — | 1.2860 | — | — |
| NG-T, node 16, edge 4 | 72k | 0.9519 | 0.2165 | 23.1 H | — | — | — | — | — |
| Transformer-NFN, | 1.18B | 0.8206 | 0.3420 | 2.9 H | — | — | — | — | — |
| GMN, width 64 | 0.19M | 0.9594 | 0.3766 | 1.5 H | 1.4273 | 0.4015 | — | — | — |
| NG-GNN, released readout | 0.20M | 0.5263 | 0.5022 | 2.7 | 1.0320 | 0.5795 | 0.4007 | 0.6990 | 13.7 |
| common | beyond | ||||
|---|---|---|---|---|---|
| Variant | Params | MSE | MSE | ||
| UWE | 73k | 0.28 | 0.71 | 0.54 | 0.72 |
| Without codes | 67k | 0.27 | 0.67 | 0.75 | 0.66 |
| Without global attention | 56k | 0.73 | 0.33 | 1.15 | 0.44 |
| Without either | 50k | 0.84 | 0.38 | 1.40 | 0.05 |
| UWE | NG-GNN | GMN | Transformer-NFN | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Target | 0.2M | 0.9M | 1.8M | 0.2M | 0.9M | 1.8M | 0.2M | 0.9M | 1.8M | |||
| MLP | 1M | 0.46 | 0.54 | 0.59 | 2.28 | 5.11 | 7.21 | 3.81 | 8.19 | 11.39 | – | – |
| MLP | 30M | 10.34 | 10.70 | 10.97 | 66.16 | OOM i | OOM i | OOM t | OOM i | OOM i | – | – |
| CNN | 10M | 0.55 | 0.63 | 0.69 | 2.63 | 5.80 | 8.09 | 37.47 | OOM t | OOM i | – | – |
| CNN | 100M | 4.30 | 4.54 | 4.72 | 25.47 | 56.77 | OOM t | OOM i | OOM i | OOM i | – | – |
| Residual CNN | 100M | 4.20 | 4.52 | 4.79 | 25.49 | 56.82 | OOM t | – | – | – | – | – |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Symmetry | Origin | Group | In |
| hidden-unit permutation | coordinatewise activation | yes | |
| channel permutation | convolution on channel axes | yes | |
| within-group permutation | grouped-convolution layout | yes | |
| head exchange | exchange of complete heads | no; included in | |
| positive rescaling | positively homogeneous | no | |
| sign flip | odd | no |
| Architectures | 100 distinct |
|---|---|
| Parameters | 112,676 to 9,061,732; median 1.05M |
| Width | 64 to 608 |
| Depth | 2 (30), 3 (31), 4 (23), 6 (16) |
| Heads | 2 to 16; head width 32 to 96 |
| FFN ratio | 2 (34), 3 (38), 4 (28) |
| Runs | 1,200: one per recipe per architecture |
| Setting | MNIST-INR | Fashion-MNIST-INR | CNN zoo |
|---|---|---|---|
| 16 | 16 | 40 | |
| 80 | 80 | 160 | |
| Layers | 4 | 4 | 8 |
| Attention heads | 4 | 4 | 8 |
| Global tokens | 4 | 4 | 4 |
| Learned probes | 64 | 64 | 0 |
| Experiment | Layers | Readout | Parameters | |||
| Loss profile, small | 16 | 32 | 0 | 4 | 72,636 | |
| Loss profile, large | 32 | 256 | 0 | 4 | 3,458,684 | |
| Budget ladder, small | 16 | 56 | 4 | 4 | 190,057 | |
| Budget ladder, medium | 16 | 128 | 4 | 4 | 906,529 | |
| Budget ladder, large | 16 | 180 | 4 | 4 | 1,759,277 | |
| Native ViT/GPT-2 | 4 | 128 | 4 | 4 | 887,881 |
| Metamodel | Trainable parameters |
|---|---|
| UWE, , | 72,636 |
| UWE, , | 3,458,684 |
| NG-GNN, output-node concatenation | 203,516 |
| NG-GNN, all-node mean | 102,140 |
| NG-T, node 16, edge 4 | 72,388 |
| GMN, width 64 | 185,340 |
| Fits, of 85 | Peak GiB by target size, H100 | Step | ||||||
|---|---|---|---|---|---|---|---|---|
| Method | Params | H100 | A10 | 0.1–0.3M | 0.3–1M | 1–3M | 3–10M | (s) |
| UWE, , | 3.46M | 85 | 85 | 0.72 | 1.43 | 3.24 | 9.17 | 0.81 |
| UWE, , | 73k | 85 | 85 | 0.22 | 0.46 | 1.13 | 3.19 | 0.82 |
| NG-GNN, width 32 | 0.20M | 85 | 85 | 0.54 | 1.60 | 4.32 | 12.91 | 0.10 |
| GMN, width 64 | 0.19M | 85 | 69 | 1.66 | 5.13 | 14.58 | 44.14 | 0.15 |
| NG-T, node 16, edge 4 | 72k | 52 | 26 | 21.93 17 | 57.54 | 68.47 12 | – | 1.47 |
| Target | (M) | Encoder | Infer. (s) | Infer. (GiB) | Step (s) | Step (GiB) |
|---|---|---|---|---|---|---|
| ViT-B/16 | 86.57 | UWE, | 2.66 | 3.64 | 17.95 | 17.72 |
| UWE, | 2.54 | 5.93 | 17.37 | 24.35 | ||
| UWE, | 2.57 | 11.12 | 17.66 | 37.39 | ||
| NG-GNN | OOM | – | – | – | ||
| GMN | OOM | – | – | – | ||
| ViT-L/16 | 304.33 | UWE, | 7.83 | 12.49 | 54.60 | 58.19 |
| Operation | Constraints |
|---|---|
| Linear layer without parameter sharing | No input–output glue. |
| Elementwise operation; addition or multiplication with aligned coordinate axes | Glue the participating coordinate axes. |
| Concatenation along the coordinate axis | Glue each input to its output interval and split at the interval boundaries. |
| Concatenation along another axis | Glue each input coordinate axis to the output coordinate axis; no coordinate splits. |
| Depthwise convolution with | Glue input and output coordinate axes. |
| Other grouped convolution, | Split input and output coordinate axes at group boundaries; no input–output glue. |
| Representation | Permutation action | Order | Non-symmetries |
|---|---|---|---|
| Reference subgroup | 663,552 | 0 | |
| QKV-triple graph ( Kofinas et al., 2024 ) | 40,320 | 39,168 | |
| With fixed head labels ( Lim et al., 2024 ) | 576 | 0 | |
| Transformer-NFN ( Tran et al., 2025 ) | 663,552 | 0 | |
| UWE | 663,552 | 0 |
| Operation | Permutation constraints | State bindings |
|---|---|---|
| Linear layer; convolution with one group | No input–output glue. | Rectangular weights; biases bind the output. Kernel offsets are folded. |
| Depthwise convolution, | Glue input and output. | Diagonal kernels and biases; kernel offsets are folded. |
| Other grouped convolution, | Split input and output at group boundaries; no input–output glue. | Rectangular kernels connect matching groups; biases bind the output. |
| BatchNorm; single-axis LayerNorm | Glue input and output. | Diagonal affine parameters. BatchNorm running statistics follow the channel action. |
| Pointwise activation, spatial pooling, evaluation-mode dropout | Glue input and output. | No stored state. |
| Aligned addition or multiplication | Glue both operands and output. | No stored state. |