OGB

ogbg-code2

Graph Classification Dataset page ↗

Structure

452,741Graphs
125Nodes
124Edges
1Classes

Coverage

39Results
1Variants
17Papers
Set-valued graph prediction Predict the subtokens in a Python method’s name from the method body represented as an abstract syntax tree. Evaluated by F1.

Dataset details

Task

Predict the subtokens in a Python method’s name from the method body represented as an abstract syntax tree. The graph-level output is a sequence, but the official F1 score compares sets of predicted and reference subtokens and therefore does not reward the correct subtoken order.

Data

The 452,741 methods originate from CodeSearchNet and were extracted from 13,587 popular GitHub repositories. OGB parses each method into an abstract syntax tree and augments the tree with next-token edges; inverse edges are normally added for bidirectional message passing.

Features

AST nodes encode a node type drawn from 97 types, an attribute such as a variable name, depth, and preorder traversal position. The target method name on the root function-definition node, including recursive occurrences, is replaced with a special mask token to prevent direct target leakage. Edge features distinguish AST, next-token, and inverse-edge direction information.

Splits and evaluation

The official project split assigns whole repositories to only one of training, validation, or test, testing transfer to unseen codebases. Targets are truncated to five subtokens for the published baseline setup, using a 5,000-subtoken vocabulary plus an unknown token. Performance is the F1 score over predicted and reference subtokens.

Quirks and pitfalls

The predecessor ogbg-code dataset is deprecated because method names leaked through the input AST; results from it are not comparable to ogbg-code2. A random method-level split is substantially easier and permits project-specific naming conventions to cross split boundaries. The usual F1 metric is order-insensitive, so it does not fully measure method-name generation quality.

Sources

OGB project split.

OGB coverage note: We have not copied the official OGB leaderboard yet. Where possible, we locate the corresponding papers on arXiv and parse their reported results, so some entries may be missing. We plan to integrate the complete leaderboard soon.

SOTA Progression

new SOTA matches SOTA at that time other proposed result other baseline result

Leaderboard

#ModelF1 ↑Paper
1
GMN
0.2060 ± 0.0020
Sep 2025 Sep '25
2
DirGraphSSM
0.2050 ± 0.0023
Sep 2025 Sep '25
3
Graph-Mamba
0.2030 ± 0.0023
Sep 2025 Sep '25
4
DAG+SAT
0.2020 ± 0.0020
Sep 2025 Sep '25
5
Exphormer
0.1990 ± 0.0020
Sep 2025 Sep '25
6
LPE
0.1948 ± 0.0021
7
RRWP
0.1942 ± 0.0010
8
SAT
0.1940 ± 0.0030
Sep 2025 Sep '25
9
RWSE
0.1939 ± 0.0047
10
K-Subtree SAT
0.1937 ± 0.0028
11
k-subtree SAT-PNA
0.1937 ± 0.0028
12
SPE
0.1935 ± 0.0021
13
k-subtree SAT-GCN
0.1934 ± 0.0020
14
NoPE
0.1927 ± 0.0020
15
GECO
0.1915 ± 0.0020
16
k-subtree SAT-GIN
0.1910 ± 0.0023
17
GPS
0.1894 ± 0.0024
18
GraphGPS
0.1890 ± 0.0020
Sep 2025 Sep '25
19
DAG+Transformer
0.1880 ± 0.0020
Sep 2025 Sep '25
20
GraphTrans (GCN-Virtual)
0.1830 ± 0.0024
21
GraphTrans
0.1830 ± 0.0024
22
PACE
0.1780 ± 0.0020
Sep 2025 Sep '25
23
DAGNN (SOTA)
0.1751 ± 0.0049
24
DAGNN
0.1750 ± 0.0050
Sep 2025 Sep '25
25
MPNN + VN + NoPE
0.1727 ± 0.0017
26
MagNet
0.1690 ± 0.0020
Sep 2025 Sep '25
27
Transformer
0.1670 ± 0.0015
28
DiGCN
0.1670 ± 0.0020
Sep 2025 Sep '25
29
DirGNN
0.1660 ± 0.0020
Sep 2025 Sep '25
30
GCN-virtual
0.1595 ± 0.0018
31
GIN-virtual
0.1581 ± 0.0020
32
PNA
0.1570 ± 0.0032
33
GAT
0.1570 ± 0.0020
Sep 2025 Sep '25
34
higher-order expander graph propagation
0.1519 ± 0.0020
Nov 2023 Nov '23
35
GCN
0.1507 ± 0.0018
36
EGP
0.1497 ± 0.0015
Nov 2023 Nov '23
37
GIN
0.1495 ± 0.0023
38
Plain GIN
0.1495 ± 0.0023
Nov 2023 Nov '23
39
GIN + 3-Regular Bipartite Expander + Summation
0.1254 ± 0.0029
Nov 2023 Nov '23
SOTA performance set a new SOTA at the time matched the SOTA at the time