SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2501.08001 · AAAI · 2025

GDiffRetro: Retrosynthesis Prediction with Dual Graph Enhanced Molecular Representation and Diffusion Generation

Wenhao Yu, Weitao Du, Chen Ma, Xuecang Zhang, Ying Hu, Liwei Liu, Yuxiang Ren, Shengyin Sun

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 0 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/2501.08001.json · badge: /api/ran/2501.08001.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
sunshy-1/GDiffRetro canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
check_if_generated Ran
ran on a synthesized input
sunshy-1/GDiffRetro/code/known_class/stage2/sample.py
code served (permissive licence) · get_code("a6c6a9a4c605eb89")
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 os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create some test directories and files
uuids = ["uuid_1", "uuid_2"]
n_samples = 5

for uuid in uuids:
    uuid_dir = os.path.join(temp_dir, uuid)
    os.makedirs(uuid_dir, exist_ok=True)
    
    # For uuid_1, create files with numbers 0, 1, 2, 3, 4 (complete)
    if uuid == "uuid_1":
        for i in range(n_samples):
            filename = f"{i}_sample.txt"
            filepath = os.path.join(uuid_dir, filename)
            with open(filepath, 'w') as f:
                f.write(f"sample {i}")
    
    # For uuid_2, create files with numbers 0, 1, 2 (incomplete)
    elif uuid == "uuid_2":
        for i in range(3):
            filename = f"{i}_sample.txt"
            filepath = os.path.join(uuid_dir, filename)
            with open(filepath, 'w') as f:
                f.write(f"sample {i}")

ARGS = {
    "_output_dir": temp_dir,
    "_uuids": uuids,
    "n_samples": n_samples
}
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 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
coord2diff Ran
ran on a synthesized input
sunshy-1/GDiffRetro/code/known_class/stage2/src/egnn.py
code served (permissive licence) · get_code("25c33b90e279b288")
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 torch

torch.manual_seed(0)

# x: coordinate tensor, shape [num_nodes, coordinate_dim]
# The function indexes x with row and col, so we need at least 2 nodes
x = torch.randn(2, 4)

# edge_index: tensor of shape [2, num_edges] with node indices
# row contains source node indices, col contains target node indices
# We'll create 3 edges
edge_index = torch.tensor([[0, 1, 0], [1, 0, 1]], dtype=torch.long)

# norm_constant: scalar, default is 1
norm_constant = 1

ARGS = {
    'x': x,
    'edge_index': edge_index,
    'norm_constant': norm_constant,
}
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 — 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
find_last_checkpoint Ran
ran on a synthesized input
sunshy-1/GDiffRetro/code/known_class/stage2/train_gdiffretro.py
code served (permissive licence) · get_code("f2d97083a5482c00")
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 str. 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 os
import tempfile

def find_last_checkpoint(checkpoints_dir):
    latest_fname = 'last.ckpt'
    return os.path.join(checkpoints_dir, latest_fname)

# Create a temporary directory to use as checkpoints_dir
temp_dir = tempfile.mkdtemp()

ARGS = {
    'checkpoints_dir': temp_dir
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_activation Ran
ran on a synthesized input
sunshy-1/GDiffRetro/code/known_class/stage2/src/lightning.py
code served (permissive licence) · get_code("087751a4b93d7ac4")
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 SiLU. 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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'activation': 'silu'
}
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 SiLU — a SiLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SiLU 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
get_one_hot Ran
ran, honoured the contract we drafted
sunshy-1/GDiffRetro/code/known_class/stage2/src/datasets.py
code served (permissive licence) · get_code("df7905f72eeb0cfa")
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 1, dtype family float, shape (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 numpy as np

# Analyze the function:
# - get_one_hot takes two parameters: atom (a key) and atoms_dict (a dict)
# - It accesses atoms_dict[atom] to get an index
# - It creates a zero array of size len(atoms_dict)
# - It sets one_hot[atoms_dict[atom]] = 1

# Create a simple atoms dictionary mapping atom names to indices
atoms_dict = {
    'H': 0,
    'C': 1,
    'N': 2,
    'O': 3
}

# Pick an atom that exists in the dictionary
atom = 'C'

ARGS = {
    'atom': atom,
    'atoms_dict': atoms_dict
}
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 1, dtype family float, shape (4,) — shape (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
unsorted_segment_sum Ran
ran on a synthesized input
sunshy-1/GDiffRetro/code/known_class/stage2/src/egnn.py
code served (permissive licence) · get_code("0833f5f54b9e99ed")
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 (2, 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 torch.nn as nn

torch.manual_seed(0)

# Create small tensors
# data: shape (batch_size, feature_dim) = (2, 4)
data = torch.randn(2, 4)

# segment_ids: shape (batch_size,) = (2,) with values in range [0, num_segments)
segment_ids = torch.tensor([0, 1], dtype=torch.long)

# num_segments: number of unique segments
num_segments = 2

# normalization_factor: scalar for 'sum' aggregation method
normalization_factor = 1.0

# aggregation_method: either 'sum' or 'mean'
aggregation_method = 'mean'

ARGS = {
    'data': data,
    'segment_ids': segment_ids,
    'num_segments': num_segments,
    'normalization_factor': normalization_factor,
    'aggregation_method': aggregation_method,
}
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 (2, 4) — shape (2, 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 4 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_one_hot 2 other papers
2 dated earlier
2210.05274 (2022-10)
Equivariant 3D-Conditional Diffusion Models for Molecular Linker Design
2401.05370 (2024-01)
Autoregressive fragment-based diffusion for pocket-aware ligand design
check_if_generated 1 other paper
1 dated earlier
2210.05274 (2022-10)
Equivariant 3D-Conditional Diffusion Models for Molecular Linker Design

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

Retrosynthesis prediction focuses on identifying reactants capable of synthesizing a target product. Typically, the retrosynthesis prediction involves two phases: Reaction Center Identification and Reactant Generation. However, we argue that most existing methods suffer from two limitations in the two phases: (i) Existing models do not adequately capture the "face" information in molecular graphs for the reaction center identification. (ii) Current approaches for the reactant generation predominantly use sequence generation in a 2D space, which lacks versatility in generating reasonable distributions for completed reactive groups and overlooks molecules' inherent 3D properties. To overcome the above limitations, we propose GDiffRetro. For the reaction center identification, GDiffRetro uniquely integrates the original graph with its corresponding dual graph to represent molecular structures, which helps guide the model to focus more on the faces in the graph. For the reactant generation, GDiffRetro employs a conditional diffusion model in 3D to further transform the obtained synthon into a complete reactant. Our experimental findings reveal that GDiffRetro outperforms state-of-the-art semi-template models across various evaluative metrics.

For agents

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

get_harvested_code_for_paper("2501.08001")
get_code_for_paper("2501.08001")
have("2501.08001")

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

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

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

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

Connect an agent — have() is free.