NN-Former: Rethinking Graph Structure in Neural Architecture Representation

Ruihan Xu, Haokui Zhang, Yaowei Wang, Wei Zeng, Shiliang Zhang
7/1/2025
cs.LGcs.AI

Official code: XuRuihan/NNFormer (7 stars, MIT, last commit 2025-03-05).

Abstract

The growing use of deep learning necessitates efficient network design and deployment, making neural predictors vital for estimating attributes such as accuracy and latency. Recently, Graph Neural Networks (GNNs) and transformers have shown promising performance in representing neural architectures. However, each of both methods has its disadvantages. GNNs lack the capabilities to represent complicated features, while transformers face poor generalization when the depth of architecture grows. To mitigate the above issues, we rethink neural architecture topology and show that sibling nodes are pivotal while overlooked in previous research. We thus propose a novel predictor leveraging the strengths of GNNs and transformers to learn the enhanced topology. We introduce a novel token mixer that considers siblings, and a new channel mixer named bidirectional graph isomorphism feed-forward network. Our approach consistently achieves promising performance in both accuracy and latency prediction, providing valuable insights for learning Directed Acyclic Graph (DAG) topology. The code is available at https://github.com/XuRuihan/NNFormer.

View on arXivView PDF

Code Implementations(1)

XuRuihan/NNFormerOfficial100%
MIT

Neural predictor for neural architecture

70Shell, CythonDec 12, 20231 years agoMIT

Similar Papers

Cite this paper

@article{xu2025nnformer,
  title  = {NN-Former: Rethinking Graph Structure in Neural Architecture Representation},
  author = {Ruihan Xu and Haokui Zhang and Yaowei Wang and Wei Zeng and Shiliang Zhang},
  year   = {2025},
  eprint = {2507.00880},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.00880v1},
  journal = {CVPR 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.00880.svg)](https://codeofpaper.com/paper/2507.00880)

Discussion