NAR-Former V2: Rethinking Transformer for Universal Neural Network Representation Learning

As more deep learning models are being applied in real-world applications, there is a growing need for modeling and learning the representations of neural networks themselves. An efficient representation can be used to predict target attributes of networks without the need for actual training and deployment procedures, facilitating efficient network deployment and design. Recently, inspired by the success of Transformer, some Transformer-based representation learning frameworks have been proposed and achieved promising performance in handling cell-structured models. However, graph neural network (GNN) based approaches still dominate the field of learning representation for the entire network. In this paper, we revisit Transformer and compare it with GNN to analyse their different architecture characteristics. We then propose a modified Transformer-based universal neural network representation learning model NAR-Former V2. It can learn efficient representations from both cell-structured networks and entire networks. Specifically, we first take the network as a graph and design a straightforward tokenizer to encode the network into a sequence. Then, we incorporate the inductive representation learning capability of GNN into Transformer, enabling Transformer to generalize better when encountering unseen architecture. Additionally, we introduce a series of simple yet effective modifications to enhance the ability of the Transformer in learning representation from graph structures. Our proposed method surpasses the GNN-based method NNLP by a significant margin in latency estimation on the NNLQP dataset. Furthermore, regarding accuracy prediction on the NASBench101 and NASBench201 datasets, our method achieves highly comparable performance to other state-of-the-art methods.

Paper

Similar papers

Peer review

Reviewer sJnp5/10 · confidence 4/52023-07-01

Summary

This paper studies how to model and learn the representations of neural networks themselves. Inspired by Transformer and GNN, NAR-Former V2 is proposed which is a modified Transformer-based universal neural network representation learning model. Extensive experiments demonstrate its effectiveness.

Strengths

- This paper is well-motivated. It is reasonable to incorporate graph-specific properties into the vanilla Transformer. A new graph-aided attention-based Transformer block is proposed. The novelty of this paper is good. - Compared to the baseline NAR-Former, NAR-Former V2 improves latency prediction performance significantly. And the authors conduct experiments on the recently released benchmark. Hence, NAR-Former V2 can be considered as a new baseline in this field. - The whole paper enjoys well writing and good organization.

Weaknesses

- The latency of the proposed NAR-Former V2 is not considered. It is better to make a comparison of the model latency. - In lines 331-338, please report the specific number when comparing NAR-Former V2 with NAR-Former. - In Tab. 2, NAR-Former V2 suffers from poor performance on AlexNet and VGG. Both of them have no residual connections. Why does NAR-Former V2 perform badly on these networks?

Questions

Please see weaknesses.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

3 good

Presentation

3 good

Contribution

3 good

Limitations

The authors have adequately addressed the limitations

Reviewer kdkx5/10 · confidence 2/52023-07-04

Summary

This paper proposes to design graph-aided attention Transformer blocks that can be used to model and learn the representation of neural networks. Specifically, one can leverage this kind of representation learning framework to provide more accurate latency and accuracy predictions of given deep neural networks. The proposed method surpasses the GNN-based NNLP baseline in latency estimation on the NNLQP dataset, and improves accuracy prediction on the NASBench101 and NASBench201 datasets.

Strengths

* Leveraging graph topology to help the attention networks seems new to me. And the target problem of how to predict latency or accuracy is of great significance to the NAS and representation learning community. * Results indeed show better predictions for latency and accuracy as compared to baselines.

Weaknesses

* The author does not provide a context for what "NAR" refers to. Also, the writer assumes all the audience is familiar with NAR-Fromer, which is not the case. Most audiences are still new to this field so better to make it more accessible to a general audience. * The paper organization could be better, it starts with quite some details telling us what is Graph-aided attentions. But why should we care about it? I would suggest moving the Fig. 2 to the front, so the readers know what is going on and what module exactly are we talking about. Without this big picture, one can easily get lost and lose interest in this work. * How is the proposed representation learning methods surpass other network selection algorithms, like general NAS algorithms as they are also designed with the philosophy of predicting accuracy given networks? In terms of both prediction accuracy and computational costs. * I would like to know the efficiency of the proposed techniques as compared to pure attention-based or pure graph-based variants.

Questions

See weaknesses.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

2: You are willing to defend your assessment, but it is quite likely that you did not understand the central parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

2 fair

Contribution

3 good

Limitations

N/A. Not provided in the main context.

Reviewer L4c16/10 · confidence 3/52023-07-05

Summary

This submission builds on previous work and proposes NAR-Former V2, an updated transformer architecture to learn representations of neural network architectures. NAR-Former V2 targets NAS tasks, predicting model properties like performance or latency, to improve NAS runtime and cost. NAR-Former V2 makes use of a proposed graph-aided attention block, which uses the network's adjacency matrix to condition the attention matrix. The proposed NAR-Former V2 is empirically evaluated on NASBench101 and NASBench201 where it achieves comparable performance to state-of-the art models.

Strengths

The submission is generally well written. It identifies a specific problem,latency and accuracy prediction for NAS, for which separate approaches have so far been suitable. The proposed method bridges that gap as a unified property predictor that covers both aspects. The idea of using network connectivity by conditioning on the adjacency matrix of the network's graph is well motivated and convincing. The empirical evaluation follows previous work and is thorough. The method achieves its goal of closing the performance gap between NNLP and NAR Former on latency and accuracy prediction.

Weaknesses

While I find the submission generally of high quality, there are a few weaknesses. While it may not have been the goal for this work, there are only small improvements over NAR-Formver v1, particularly on NASbench family. On these results (Table 3 and 4) there are also only average performance values reported. I'd ask the authors to add standard deviations or similar metrics, since the performance differences are very small. Further, the submission shows different baselines for different experiments. While some numbers are mentioned in the text, I would find it more convincing to have the two main baselines the authors identified (NNLP and NAR-Former) in all results. Also, the authors propose their method for universal neural network representation learning. However, they only show results on latency prediction and accuracy, which are important but relatively coarse labels. NasBench201 at least contains more detailed information on each model, which may be used to assess the quality of the representation on a more fine-grained level. Lastly, there is an entire field of work that attempts to learn representations of neural networks, for example to predict model properties. While many of them use the actual weights, some use graph-based features. E.g., - You et al, 2020: Graph Structure of Neural Networks - Corneanu et al, 2020: Computing the Testing Error Without a Testing Set. They may merit discussion in the related work and may be used as different baselines.

Questions

Question 1: Have you encountered any kind of ‘receptive field’ effect? Conditioning on the adjacency matrix should lead to several hops being necessary to aggregate information globally, unless I'm mistaken? What is your intuition into why that doesn’t seem to be an issue. Question 2: Have you investigated other ways of encoding graph connectivity in transformers, e.g. like Kim et al, 2022: Pure Transformers are Powerful Graph Learners?

Rating

6: Weak Accept: Technically solid, moderate-to-high impact paper, with no major concerns with respect to evaluation, resources, reproducibility, ethical considerations.

Confidence

3: You are fairly confident in your assessment. It is possible that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work. Math/other details were not carefully checked.

Soundness

3 good

Presentation

3 good

Contribution

2 fair

Limitations

Not discussed explicitly.

Reviewer 9nHL5/10 · confidence 4/52023-07-18

Summary

The paper proposes a transformer based neural network representation learning model that incorporates the inductive representation capabilities of graph neural networks into the transformer architecture to improve it's generalizability on unseen architectures. The NAR-Former framework, which the proposed model builds on, has poor generalization performance when the depth of the input architecture gets large(eg: in the hundreds). The authors argue that for a neural network representation model to process neural architectures in varying tasks, a combination of both the Transformer and GNN architectures is necessary. The resulting model, NAR-Former V2, is a combination of the self-attention mechanism of transformers which discovers pair-wise correlations between its inputs and the graph aggregation mechanism of graph neural networks which is capable of discovering topological structures in its inputs.

Strengths

- The proposed method can handle cell-structured networks and can learn representations of entire networks extending the capabilites of NAR-Former. - The method is extensively benchmarked on various tasks such as attribute and latency prediction as well as on varaious NAS benchmarks. - The proposed method is scalable and can encode networks with hundreds of operations. - The paper is easy to read and follow.

Weaknesses

- There are many claims made in the paper which, perhaps made by intution, are not supported quantitatively (See questions). - Comparison with NAR-Former is missing for some crucial results used to validate the proposed method which is a direct modification to NAR-Former.

Questions

- Lines[176-178] How does the Type-aware Enhancement module actually 'enhance' the representation? What does enhance mean here? Was there a comparison with the representations of NAR-Former's representations? The usage of the term seems a bit loose and i'm not sure how to intepret this. If this is by some metric? Then it is best to provide this to the reader. - In Tables 3 and 4 where NAR-Former is compared with NAR-FormerV2, there seems to be no difference between the two models when averaged over all the test samples. Specifically, averaging the results in Table 3 gives 0.82 for both NAR-Former and the proposed NAR-FormerV2. Similarly for Table 4, taking an average over all testing settings gives 0.875 and 0.881 for NAR-Former and NAR-FormerV2 respectively. Since the proposed method is supposed to be a direct enhancement of NAR-Former, do these results still justify the modifications made to the original model? - Since the proposed model is a direct improvement on NAR-Former, why isn't there a comparison with NAR-Former in Tables 1 and 2? - What is the parameter count of NAR-Former V2 compared to NAR-Former? While the latency measurements on an RTX 3090 GPU is provided in Table 2, the actual parameter count could be useful. - In the ablation study (Table 5), what happens when: - Only GFFN is incorporated in the Transformer. - Only TA-Enhance is incorporated in the Transformer. - A combination of only GraphAtnn and TA-Enhance only. Table 5 suggests than combining all 3 leads to the best performance but the ablation ignores the combinations listed above. For instance it might be the case that combining either TA-Enhance or GFFN with the regular transformer based attention performs better than the combinations with the GraphAttn. - In the Appendix(Lines 16-18), again claims that the inadequacy of Eq. 5 are directed at the usage of the softmax function with a description of why this is the case together with how Eq. 2 restricts attention to connected nodes only. Could the attention matrix and adjacency matrix be visualized to actually confirm if the models behave as the authors say? This would be a much better quantitative illustration of the benefits of the proposed model over regular Transformer based attention. - [Minor] Typo on line 59.

Rating

5: Borderline accept: Technically solid paper where reasons to accept outweigh reasons to reject, e.g., limited evaluation. Please use sparingly.

Confidence

4: You are confident in your assessment, but not absolutely certain. It is unlikely, but not impossible, that you did not understand some parts of the submission or that you are unfamiliar with some pieces of related work.

Soundness

2 fair

Presentation

2 fair

Contribution

2 fair

Limitations

No obvious limitations.

Authorsrebuttal2023-08-21

Author Comment to Reviewer 9nHL

We sincerely thank you for the thoughtful feedback and comments you've given. Your investment of time in reviewing our work is greatly valued. Should you have any further questions or require additional clarification on any points, please do not hesitate to ask. Considering the clarifications provided, we would be grateful if you could reconsider the score you've assigned, in light of the recent explanations. Your understanding and continued support are deeply appreciated.

Area Chair gaYu2023-08-22

Please provide feedback

Dear Reviewer 9nHL, The official author-reviewer discussion period is over. However, it would be great if you could go over the authors' responses and the reviews from the others and provide feedback. Thanks, AC

Reviewer L4c12023-08-13

Reviewer response to rebuttal

I'd like to thank the authors for the extensive response, which is much appreciated. I'm not entirely sure how to understand the 'more stringent 10% error bound'. Is there any reason why the authors do not report mean +- std of the performance metric? I feel like this has become standard and is accessible to the reader, while other metrics are more obscure. The additional experiments improve the submission in my view, in particular the rank order of performance measured in kendall's tau. This seems to be a much more relevant and robust metric to make a choice between different architectures, and increases the evidence for the expressiveness of the method. I have therefore increased the score.

Authorsrebuttal2023-08-15

Author response to Reviewer L4c1

First of all, we really appreciate your positive comments and raising our score! Below are the responses to the questions you asked. > How to understand the 'more stringent 10% error bound'. A definition of error bound accuracy is presented in the supplementary material. In contrast to Kendall's Tau, which focuses on the correlation between the relative ordering of the predicted values and that of the true values, the assessment of the error bound accuracy is based on the exact error between the predicted value and the true value. Thus here we describe it as a more "stringent" metric. > Is there any reason why the authors do not report mean +- std of the performance metric? The results of the comparison of error bound accuracy show that our NAR-Former V2 outperforms NAR-Former in the prediction of exact values, in addition to the relative ordering, which also reflects that our method learns a more reasonable representation. We regret that we neglected to compare standard deviations. We performed 12 replicate experiments for each method, and calculate the mean and standard deviation of the Kendall's Tau values after removing the maximum and minimum. The results are shown in the following table: | | 781/all | 1563/all | |---------------|------------------------|------------------------| | NAR-Former | 0.8631$\pm$0.0080 | 0.8967$\pm$0.0029 | | NAR-Former V2 | 0.8735$\pm$0.0026 | 0.8875$\pm$0.0013 | Comparing the standard deviations of the two methods shows that our NAR-Former V2 is more stable than NAR-Former. Finally, thank you again for your feedback. If you have any further questions or suggestions, please let us know. We will be happy to answer them for you.

Reviewer kdkx2023-08-16

Response to the rebuttal

Thank you for providing the detailed rebuttal. Many revisions were promised but I feel hard to find them in the paper without any highlights. And after reading other reviewers' comments. I agree that the performance improvements seem marginal. And the writing style seems vague, i.e., a lot of intuition without grounding data to support or without clear explanation. Also, there are typos in the rebuttal text, e.g., "origination" should be "organization"? Considering pros and cons, I will keep the current rating with a low confidence.

Authorsrebuttal2023-08-18

Author response to Reviewer kdkx

We appreciate your feedback. Here are our responses. > Being hard to find the promised revisions in the paper without any highlights. Thank you and the other reviewers for the many valuable suggestions that led us to revise the paper into a more readable and rigorous version. For many of the questions in the rebuttal, we have corresponding short versions of the answers or explanations in the submission. However, thanks to the comments of the reviewers, we were inspired to elaborate on these issues in detail as demonstrated in the rebuttal. For example, the question about the choice of baseline mentioned by reviewer L4c1 is briefly answered in lines 261 to 263 of the submission. Based on the inspiration from the reviewer's comment, we demonstrate the rationality of our choice of baseline through additional experiments. Therefore, many of the suggestions given by all the reviewers helped us to revise our paper to be more readable and rigorous. Below is a portion of our revised paper: (1) Line 47: ... As shown in the latency prediction experiment in NAR-Former **(Transformer-based neural architecture representation learning framework)**... (2) We will make the overall architecture diagram (original Figure 2) the first diagram, and add the following blurb at the beginning of Section 3.1: **As similar to our final framework in Figure. 1, existing neural network representation learning and attribute prediction methods consist of three main phases: neural network encoding, backbone-based representation learning, and attributes predicting using prediction heads. In this subsection, we will mainly focus on the backbone-based representation learning part to introduce our motivation.** (3)Add other experiments, details, etc. mentioned by other reviewers Unfortunately, at the moment, the system does not allow uploading our updated papers. But all the changes mentioned in the rebuttal have been already added in the revised version. > The performance improvements seem marginal. For the performance improvements of our proposed NAR-Former V2, there is evidence that our method is an improved version of NAR-Former and achieves SOTA in encoding both small cell components and complete deep neural networks. On the one hand, as can be seen from Tables 1 and 2 in the main text and the standard deviation comparisons in the table below, we more stably achieve accuracy prediction results comparable to the SOTA NAR-Former. More importantly, the results presented in Table 3 of the supplementary materials demonstrate that we have solved the problem of NAR-Former's poor generalization ability when encoding complete neural networks. On the other hand, the results in Tables 1 and 2 in the main text show that we achieve a considerable improvement compared to the SOTA of the complete deep neural network encoding. Standard deviation comparison on NAS-Bench-201: | | 781/all | 1563/all | |---------------|------------------------|------------------------| | NAR-Former | 0.8631$\pm$0.0080 | 0.8967$\pm$0.0029 | | NAR-Former V2 | 0.8735$\pm$0.0026 | 0.8875$\pm$0.0013 | > The writing style seems vague. For the statements and designs in the paper, we have verified them by corresponding experiments. We apologize for the typos and the absence of some detailed explanations, which will be amended and added in the final version based on the reviewers' comments. We thank you again for your response. If you have any further questions, suggestions, or concerns, please let us know. We believe that this will further help us to improve our paper!

Program Chairsdecision2023-09-21

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC