SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2507.11229 · NeurIPS · 2025

DuetGraph: Coarse-to-Fine Knowledge Graph Reasoning with Dual-Pathway Global-Local Fusion

Jin Li, Xike Xie, Zezhong Ding

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2507.11229.json · badge: /api/ran/2507.11229.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
USTC-DataDarknessLab/DuetGraph canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
add_data_specific_args Ran
ran; our contract draft was wrong, not the code
USTC-DataDarknessLab/DuetGraph/dual_pathway/lightning.py
code served (permissive licence) · get_code("6babaadc2ce7d715")
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 ArgumentParser. 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 argparse

# Create a parent argument parser
parent_parser = argparse.ArgumentParser(add_help=False)

# Call the function with the parent parser
def add_data_specific_args(parent_args):
    parser = parent_args.add_argument_group('Data')
    parser.add_argument('--data_path', type=str, help='the path to dataset directory')
    parser.add_argument('--num_workers', default=8, type=int)
    parser.add_argument('--batch_size', default=16, type=int)
    parser.add_argument('--test_batch_size', default=16, type=int)
    return parent_args

# Construct ARGS dict with valid arguments for add_data_specific_args
ARGS = {
    'parent_args': parent_parser
}
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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
add_model_specific_args Ran
ran; our contract draft was wrong, not the code
USTC-DataDarknessLab/DuetGraph/dual_pathway/lightning.py
code served (permissive licence) · get_code("2be9484ef16908d8")
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 SimpleArgumentParser. 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 argparse
import torch

torch.manual_seed(0)

class SimpleArgumentParser:
    def __init__(self):
        self.groups = {}
    
    def add_argument_group(self, name):
        group = ArgumentGroup(name)
        self.groups[name] = group
        return group

class ArgumentGroup:
    def __init__(self, name):
        self.name = name
        self.arguments = []
    
    def add_argument(self, *args, **kwargs):
        self.arguments.append((args, kwargs))
        return self

ARGS = {
    'parent_args': SimpleArgumentParser()
}
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 SimpleArgumentParser — a SimpleArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleArgumentParser 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
cal_performance Ran
ran; our contract draft was wrong, not the code
USTC-DataDarknessLab/DuetGraph/RED-GNN/inductive/utils.py
code served (permissive licence) · get_code("c02f55c5f11539dd")
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 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
import numpy as np

torch.manual_seed(0)

# The function cal_performance takes 'ranks' parameter
# Looking at the function body:
# - ranks is used with (1.0 / ranks) so it needs to support division
# - ranks is used with .sum() so it needs to be a sequence/tensor
# - ranks is used with len(ranks)
# - ranks is used with <= comparisons (ranks <= 1, ranks <= 10)
# This suggests ranks should be a 1D array-like of numeric values

# Create a small tensor of rank values (some <= 1, some <= 10, some > 10)
ranks = torch.tensor([1.0, 2.0, 5.0, 15.0, 3.0, 8.0], dtype=torch.float32)

ARGS = {
    "ranks": ranks
}
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 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
cal_ranks Ran
ran, honoured the contract we drafted
USTC-DataDarknessLab/DuetGraph/RED-GNN/inductive/utils.py
code served (permissive licence) · get_code("78de15054eb2f1ef")
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 numpy as np
from scipy.stats import rankdata

# Set random seed for reproducibility
np.random.seed(0)

# Create small test data
batch_size = 2
num_items = 4

# scores: array of shape (batch_size, num_items) with numeric values
scores = np.array([
    [0.5, 0.3, 0.8, 0.2],
    [0.9, 0.1, 0.4, 0.6]
], dtype=np.float32)

# labels: array of shape (batch_size, num_items) with binary or numeric values
labels = np.array([
    [1, 0, 1, 0],
    [0, 1, 1, 0]
], dtype=np.float32)

# filters: array of shape (batch_size, num_items) with binary or numeric values
# Used as a mask to filter scores
filters = np.array([
    [1, 1, 0, 1],
    [1, 0, 1, 1]
], dtype=np.float32)

ARGS = {
    "scores": scores,
    "labels": labels,
    "filters": filters
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
create_products_of_givens_rotations Ran
ran, honoured the contract we drafted
USTC-DataDarknessLab/DuetGraph/dual_pathway/src/model.py
code served (permissive licence) · get_code("9aa9925d9d73da70")
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 math
import numpy as np
import torch

torch.manual_seed(0)

ARGS = {
    "dim": 4,
    "seed": 42
}
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 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
create_projection_matrix Ran
ran, honoured the contract we drafted
USTC-DataDarknessLab/DuetGraph/dual_pathway/src/model.py
code served (permissive licence) · get_code("f25c793f69e42fc5")
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 (8, 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
import math

torch.manual_seed(0)

ARGS = {
    "m": 8,
    "d": 4,
    "seed": torch.tensor(42),
    "scaling": 0,
    "struct_mode": False,
}
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 Tensor, ndim 2, dtype family float, shape (8, 4) — shape (8, 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
eval Ran
ran; our contract draft was wrong, not the code
USTC-DataDarknessLab/DuetGraph/dual_pathway/coarse_to_fine_evaluate.py
code served (permissive licence) · get_code("5775330dacfc1d0c")
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 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)

# Small tensors: batch_size=2, num_entities=4
batch_size = 2
num_entities = 4

# score_fine: [batch_size, num_entities] - fine-grained scores
score_fine = torch.randn(batch_size, num_entities)

# score_coarse: [batch_size, num_entities] - coarse-grained scores
score_coarse = torch.randn(batch_size, num_entities)

# mask: [batch_size, num_entities] - boolean mask for filtering
# True means the entity should be masked out (invalid)
mask = torch.zeros(batch_size, num_entities, dtype=torch.bool)
mask[0, 1] = True  # mask out entity 1 for sample 0
mask[1, 2] = True  # mask out entity 2 for sample 1

# answer: [batch_size] - indices of correct answers (0 to num_entities-1)
answer = torch.tensor([0, 3], dtype=torch.long)

# top_k: number of top candidates to consider
top_k = 3

# delta: threshold for comparison
delta = 0.5

ARGS = {
    'score_fine': score_fine,
    'score_coarse': score_coarse,
    'mask': mask,
    'answer': answer,
    'top_k': top_k,
    'delta': delta,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchmetrics — 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 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
positive_sample Ran
ran; our contract draft was wrong, not the code
USTC-DataDarknessLab/DuetGraph/dual_pathway/lightning.py
code served (permissive licence) · get_code("3f82e0ecdfbcc2b6")
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 int, shape (2, 1) 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 a 'mask' parameter which should be a tensor
# The function calls:
# - torch.ones_like(mask) - so mask must be a tensor
# - mask operations (multiplication)
# - torch.multinomial(p, num_samples=1) - requires p to be 1D or 2D with valid probabilities
# 
# For multinomial to work, we need a tensor where at least one element per row is non-zero
# (after masking). Let's create a small mask tensor.

# Create a small mask tensor (batch_size=2, some dimension=4)
# Make sure it has at least one positive value per row for multinomial sampling
mask = torch.tensor([
    [1.0, 0.0, 1.0, 0.0],
    [0.0, 1.0, 0.0, 1.0]
], dtype=torch.float32)

ARGS = {
    "mask": mask
}
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 int, shape (2, 1) — shape (2, 1) 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
load_extension Not yet run
unverified (harvested, no recorded run)
USTC-DataDarknessLab/DuetGraph/dual_pathway/src/rspmm/rspmm.py
code served (permissive licence) · get_code("f74db61d101d23e4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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
cal_performance 1 other paper
1 dated earlier
2303.12306 (2023-03)
Understanding Expressivity of GNN in Rule Learning
cal_ranks 1 other paper
1 dated earlier
2303.12306 (2023-03)
Understanding Expressivity of GNN in Rule Learning

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

Knowledge graphs (KGs) are vital for enabling knowledge reasoning across various domains. Recent KG reasoning methods that integrate both global and local information have achieved promising results. However, existing methods often suffer from score over-smoothing, which blurs the distinction between correct and incorrect answers and hinders reasoning effectiveness. To address this, we propose DuetGraph, a coarse-to-fine KG reasoning mechanism with dual-pathway global-local fusion. DuetGraph tackles over-smoothing by segregating-rather than stacking-the processing of local (via message passing) and global (via attention) information into two distinct pathways, preventing mutual interference and preserving representational discrimination. In addition, DuetGraph introduces a coarse-to-fine optimization, which partitions entities into high-and low-score subsets. This strategy narrows the candidate space and sharpens the score gap between the two subsets, which alleviates over-smoothing and enhances inference quality. Extensive experiments on various datasets demonstrate that DuetGraph achieves state-of-the-art (SOTA) performance, with up to an 8.7% improvement in reasoning quality and a 1.8× acceleration in training efficiency. Our code is available at https://github.com/USTC-DataDarknessLab/DuetGraph.git.

For agents

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

get_harvested_code_for_paper("2507.11229")
get_code_for_paper("2507.11229")
have("2507.11229")

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

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

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

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

Connect an agent — have() is free.