SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.10792 · 2023

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

arXiv · PDF · Open in the Atlas

Code that ran

9 of 15 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 0 failures of our instrument; 6 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2306.10792.json · badge: /api/ran/2306.10792.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
yuny220/NAR-Former-V2 canonical (classifier label)
classifier basis: census
9 ran · 6 no recorded run
FunctionStatusWhere it lives
flops_conv Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/feature/onnx_flops.py
code served (permissive licence) · get_code("744e1f1434f9addf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class MockNode:
    def __init__(self, op_type, input_list, output_list):
        self.op_type = op_type
        self.input = input_list
        self.output = output_list

node = MockNode(
    op_type='Conv',
    input_list=['input_0', 'weight_1', 'bias_2'],
    output_list=['output_0']
)

attrs = {}

maps = {
    'input_0': np.array([2, 3, 5, 5]),
    'weight_1': np.array([4, 3, 3, 3]),
    'output_0': np.array([2, 4, 3, 3]),
    'bias_2': np.array([4])
}

ARGS = {
    'node': node,
    'attrs': attrs,
    'maps': maps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
flops_gemm Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/feature/onnx_flops.py
code served (permissive licence) · get_code("3b564242dd4a13a1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

class MockNode:
    def __init__(self, op_type, input_list):
        self.op_type = op_type
        self.input = input_list

node = MockNode('Gemm', ['input_0', 'weight', 'bias'])

attrs = {
    'transB': 0
}

maps = {
    'input_0': [2, 4],
    'weight': [4, 3],
    'bias': [3]
}

ARGS = {
    'node': node,
    'attrs': attrs,
    'maps': maps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
flops_matmal Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/feature/onnx_flops.py
code served (permissive licence) · get_code("0f7addd0143bea1b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a mock node object that has op_type and input/output attributes
class MockNode:
    def __init__(self, op_type, input_names, output_names):
        self.op_type = op_type
        self.input = input_names
        self.output = output_names

# Create mock maps dict
# maps[node.input[0]] should be a shape tuple ending with [..., N, K]
# maps[node.output[0]] should be a shape tuple ending with [..., N, M]
# Let's use N=2, K=4, M=3 for distinct dimensions
maps = {
    'input_0': (2, 4),      # Shape ending with N=2, K=4
    'output_0': (2, 3)      # Shape ending with N=2, M=3
}

node = MockNode(
    op_type='MatMul',
    input_names=['input_0'],
    output_names=['output_0']
)

attrs = {}  # Not used in the function

ARGS = {
    'node': node,
    'attrs': attrs,
    'maps': maps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
gen_Khop_adj Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/model.py
code served (permissive licence) · get_code("0bc8a6e84b43d28b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Construct edge_index as a 2 x num_edges tensor
# This represents edges in a graph with COO format (source, target indices)
edge_index = torch.tensor([
    [0, 1, 2, 0],
    [1, 2, 0, 3]
], dtype=torch.long)

# Number of tokens (nodes in the graph)
n_tokens = 4

# Number of hops
k = 1

ARGS = {
    "edge_index": edge_index,
    "n_tokens": n_tokens,
    "k": k
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
padding_for_batch Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/data_process/data_and_encoding_generate.py
code served (permissive licence) · get_code("16c95ce071090988")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

MAX_LEN = 7

# Create a small code matrix with shape (3, 4)
# - 3 rows (less than MAX_LEN=7, so padding will be applied)
# - 4 columns (arbitrary feature dimension)
code = np.random.randn(3, 4).astype(np.float32)

# Create an adjacency list with 3 sublists (less than MAX_LEN=7)
# Each sublist has 3 elements initially
adj = [
    [1, 0, 1],
    [0, 1, 0],
    [1, 1, 0]
]

ARGS = {
    "code": code,
    "adj": adj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
transform_operations Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/data_process/gen_json_101.py
code served (permissive licence) · get_code("9dbe158474b5367f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family int, shape (7, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# The function takes a single parameter 'ops' which should be a list/iterable of strings
# Each string must be a key in the transform_dict
# The function iterates through ops and uses it to index into transform_dict
# It creates a 7x5 array, so ops should have at most 7 elements

ops_list = [
    'input',
    'conv1x1-bn-relu',
    'conv3x3-bn-relu',
    'maxpool3x3',
    'conv1x1-bn-relu',
    'conv3x3-bn-relu',
    'output'
]

ARGS = {
    'ops': ops_list
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (7, 5) — shape (7, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
transform_operations_category Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/data_process/gen_json_101.py
code served (permissive licence) · get_code("9ca1858f61f750f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The function takes a list of operation names as strings
# and transforms them using a predefined dictionary
ops = ['input', 'conv3x3-bn-relu', 'maxpool3x3', 'conv1x1-bn-relu', 'output']

ARGS = {
    'ops': ops
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
transform_operations_category_101 Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/data_process/data_and_encoding_generate.py
code served (permissive licence) · get_code("ed0dbb64178970b6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function takes 'ops' as a parameter
# It expects ops to be a list/sequence of strings that are keys in transform_dict
# The keys are: 'input', 'conv1x1-bn-relu', 'conv3x3-bn-relu', 'maxpool3x3', 'output'

ops = ['input', 'conv1x1-bn-relu', 'conv3x3-bn-relu', 'maxpool3x3', 'output']

ARGS = {
    'ops': ops
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
transform_operations_category_201 Ran
ran on a synthesized input
yuny220/NAR-Former-V2/predictor/data_process/data_and_encoding_generate.py
code served (permissive licence) · get_code("bf2419d10c0e8b96")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function takes 'ops' which is a list of strings that are keys in transform_dict
# It maps each string key to its corresponding integer value
ops = ['input', 'nor_conv_1x1', 'nor_conv_3x3', 'avg_pool_3x3', 'skip_connect', 'none', 'output']

ARGS = {
    'ops': ops
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
embed_attrs Not yet run
unverified (harvested, no recorded run)
yuny220/NAR-Former-V2/predictor/feature/node_feature.py
code served (permissive licence) · get_code("1e37af5cf5320cea")
How it ran

no invocation recorded.

embed_op_code Not yet run
unverified (harvested, no recorded run)
yuny220/NAR-Former-V2/predictor/feature/node_feature.py
code served (permissive licence) · get_code("ff46a1625a9d0cd1")
How it ran

no invocation recorded.

embed_shape Not yet run
unverified (harvested, no recorded run)
yuny220/NAR-Former-V2/predictor/feature/node_feature.py
code served (permissive licence) · get_code("40bf84d585a0d8fb")
How it ran

no invocation recorded.

extract_graph_feature Not yet run
unverified (harvested, no recorded run)
yuny220/NAR-Former-V2/predictor/feature/graph_feature.py
code served (permissive licence) · get_code("bde901526881c504")
How it ran

no invocation recorded.

extract_graph_feature_from_networkx Not yet run
unverified (harvested, no recorded run)
yuny220/NAR-Former-V2/predictor/feature/graph_feature.py
code served (permissive licence) · get_code("cc00ffba3a90caea")
How it ran

no invocation recorded.

parse_from_onnx Not yet run
unverified (harvested, no recorded run)
yuny220/NAR-Former-V2/predictor/feature/graph_feature.py
code served (permissive licence) · get_code("c116bb9f8d8527b3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 15 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2306.10792")
get_code_for_paper("2306.10792")
have("2306.10792")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2306.10792.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2306.10792.svg)](https://syntology.ai/paper/2306.10792)

Connect an agent — have() is free.