SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.04798 · NeurIPS · 2023

A*Net: A Scalable Path-based Reasoning Approach for Knowledge Graphs

Ming Zhang, Jian Tang, Zhaocheng Zhu, Mikhail Galkin, Xinyu Yuan, Sophie Xhonneux, Maxime Gazeau

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 5 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-22; 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/2206.04798.json · badge: /api/ran/2206.04798.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
DeepGraphLearning/AStarNet community (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
FunctionStatusWhere it lives
bincount Ran
ran on a synthesized input
DeepGraphLearning/AStarNet/reasoning/functional.py
code served (permissive licence) · get_code("4efd55e35064eee0")
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 1, dtype family int, shape (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 torch

torch.manual_seed(0)

# Create a small input tensor of integers
# The function expects a 1D tensor of non-negative integers
input_tensor = torch.tensor([0, 1, 1, 2, 3, 3, 3], dtype=torch.long)

ARGS = {
    "input": input_tensor,
    "minlength": 5
}
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 1, dtype family int, shape (5,) — shape (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
get_entity_types Ran
ran on a synthesized input
DeepGraphLearning/AStarNet/script/chat.py
code served (permissive licence) · get_code("087b2ca22ed58ea1")
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 float; 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 json
import urllib.parse
import urllib.request
from unittest.mock import patch, MagicMock

# Mock the urllib.request.urlopen to avoid actual network calls
def mock_urlopen(url):
    mock_response = MagicMock()
    response_data = {
        "claims": {
            "P31": [
                {
                    "mainsnak": {
                        "datavalue": {
                            "value": {
                                "id": "Q5"
                            }
                        }
                    }
                },
                {
                    "mainsnak": {
                        "datavalue": {
                            "value": {
                                "id": "Q7"
                            }
                        }
                    }
                }
            ]
        }
    }
    mock_response.read.return_value = json.dumps(response_data).encode('utf-8')
    mock_response.__enter__ = MagicMock(return_value=mock_response)
    mock_response.__exit__ = MagicMock(return_value=False)
    return mock_response

# Patch urllib.request.urlopen globally before defining ARGS
urllib.request.urlopen = mock_urlopen

ARGS = {
    'e_id': 'Q42'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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 float — 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
get_root_logger Ran
ran; our contract draft was wrong, not the code
DeepGraphLearning/AStarNet/reasoning/util.py
pointer only (licence: MIT); the stored copy get_code serves, from ahart34/protein, is pointer only (licence: NONE) · get_code("70a68fd646c6e4a7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ahart34/protein, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_config Ran
ran on a synthesized input
DeepGraphLearning/AStarNet/reasoning/util.py
code served (permissive licence) · get_code("30326895d5ac5a09")
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 EasyDict. 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 tempfile
import os
import yaml

# Create a temporary config file with YAML content and Jinja2 variables
temp_dir = tempfile.mkdtemp()
cfg_file = os.path.join(temp_dir, "test_config.yaml")

# Write a simple YAML config file with Jinja2 template variables
config_content = """
model:
  name: test_model
  layers: {{ num_layers }}
training:
  batch_size: {{ batch_size }}
  learning_rate: 0.001
data:
  path: /data
"""

with open(cfg_file, 'w') as f:
    f.write(config_content)

# Define context dictionary for Jinja2 template rendering
context = {
    'num_layers': 3,
    'batch_size': 32
}

ARGS = {
    'cfg_file': cfg_file,
    'context': context
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
easydict, jinja2, yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EasyDict — a EasyDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a EasyDict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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
multikey_argsort Ran
ran on a synthesized input
DeepGraphLearning/AStarNet/reasoning/functional.py
code served (permissive licence) · get_code("3e66de0bc577cdf1")
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 1, dtype family int, shape (2,) 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)

# The function expects `inputs` to be a list of tensors
# It uses: len(inputs[0]), inputs[0].device, key[order] indexing, .argsort(), .argsort(stable=True, descending=...)
# So we need a list of 1D or 2D tensors with the same length along dimension 0

# Create a small list of tensors for multikey sorting
# Using batch size 2, and 3 different keys to sort by
tensor1 = torch.tensor([3, 1], dtype=torch.float32)  # First sorting key
tensor2 = torch.tensor([2, 2], dtype=torch.float32)  # Second sorting key (for tie-breaking)
tensor3 = torch.tensor([5, 4], dtype=torch.float32)  # Third sorting key

inputs = [tensor1, tensor2, tensor3]

ARGS = {
    "inputs": inputs,
    "descending": False,
    "break_tie": False
}
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 1, dtype family int, shape (2,) — shape (2,) 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
variadic_topks Ran
ran on a synthesized input
DeepGraphLearning/AStarNet/reasoning/functional.py
code served (permissive licence) · get_code("ad69c1e9f5dc269f")
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 2, dtype family float; 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)

# Build tiny tensors for the function
# input: the values to select from
input = torch.tensor([0.5, 0.3, 0.8, 0.2, 0.9, 0.1], dtype=torch.float32)

# size: number of elements per sample/group
size = torch.tensor([3, 3], dtype=torch.long)

# ks: number of top-k elements to select per group
ks = torch.tensor([2, 1], dtype=torch.long)

ARGS = {
    'input': input,
    'size': size,
    'ks': ks,
    'largest': True,
    'break_tie': False,
}
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 tuple, ndim 2, dtype family float — 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
get_wikidata_id Not yet run
unverified (harvested, no recorded run)
DeepGraphLearning/AStarNet/script/chat.py
code served (permissive licence) · get_code("469d65c572e7ba76")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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.

FunctionAlso present inEarliest-datedOthers named
get_root_logger 8 other papers
2 dated earlier, 6 later
2106.06935 (2021-06)
Neural Bellman-Ford Networks: A General Graph Neural Network Framework for Link Prediction
2205.10128 (2022-05)
Neural-Symbolic Models for Logical Queries on Knowledge Graphs
2302.02209 (2023-02)
A Theory of Link Prediction via Relational Weisfeiler-Leman on Knowledge Graphs
and 5 more not named here

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-22.

Repositories linked to this paper

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

Abstract

Reasoning on large-scale knowledge graphs has been long dominated by embedding methods. While path-based methods possess the inductive capacity that embeddings lack, their scalability is limited by the exponential number of paths. Here we present A*Net, a scalable path-based method for knowledge graph reasoning. Inspired by the A* algorithm for shortest path problems, our A*Net learns a priority function to select important nodes and edges at each iteration, to reduce time and memory footprint for both training and inference. The ratio of selected nodes and edges can be specified to trade off between performance and efficiency. Experiments on both transductive and inductive knowledge graph reasoning benchmarks show that A*Net achieves competitive performance with existing state-of-the-art path-based methods, while merely visiting 10% nodes and 10% edges at each iteration. On a million-scale dataset ogbl-wikikg2, A*Net not only achieves a new state-of-the-art result, but also converges faster than embedding methods. A*Net is the first path-based method for knowledge graph reasoning at such scale.

For agents

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

get_harvested_code_for_paper("2206.04798")
get_code_for_paper("2206.04798")
have("2206.04798")

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

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

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

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

Connect an agent — have() is free.