SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2001.01408 · NeurIPS · 2020

Retrosynthesis Prediction with Conditional Graph Logic Network

Hanjun Dai, Chengtao Li, Connor Coley, Bo Dai, Le Song

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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 4 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2001.01408.json · badge: /api/ran/2001.01408.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
Hanjun-Dai/GLN canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
FunctionStatusWhere it lives
get_weighted_f1 Ran
ran on a synthesized input
Hanjun-Dai/GLN/gln/common/evaluate.py
code served (permissive licence) · get_code("8dce8b3c1f2a92f7")
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 float, ndim 0, dtype family float, shape () 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 two string parameters that can be split by '.'
# It splits them, converts to sets, and computes F1 metrics

seq_pred_1 = "apple.banana.cherry"
seq_gnd_1 = "apple.banana.date"

seq_pred_2 = "cat.dog"
seq_gnd_2 = "cat.dog.bird"

# Test with None values
seq_pred_3 = None
seq_gnd_3 = None

ARGS = {
    "seq_pred": seq_pred_1,
    "seq_gnd": seq_gnd_1,
}
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 float, ndim 0, dtype family float, shape () — shape () 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_center_maps Ran
ran on a synthesized input
Hanjun-Dai/GLN/gln/data_process/data_info.py
code served (permissive licence) · get_code("cbf0f257f528c9f0")
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 dict. 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
from tqdm import tqdm
import csv
import numpy as np

# Create a temporary CSV file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.csv', newline='')
temp_fname = temp_file.name

# Write header and test data
writer = csv.writer(temp_file)
writer.writerow(['smiles', 'rxn_type', 'indices'])
writer.writerow(['CCO', 'type_A', '0 1 2'])
writer.writerow(['CC(C)O', 'type_B', '1 3'])
writer.writerow(['c1ccccc1', 'type_A', '0 1 2 3 4 5'])
writer.writerow(['CCN', 'type_C', '0 2'])
temp_file.close()

ARGS = {
    'fname': temp_fname
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_train_reactions Ran
ran on a synthesized input
Hanjun-Dai/GLN/gln/data_process/data_info.py
code served (permissive licence) · get_code("8534f182bb2b44ac")
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 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 os
import tempfile
import csv

# Create a temporary directory structure for the test
temp_dir = tempfile.mkdtemp()
dropbox_dir = os.path.join(temp_dir, 'dropbox')
data_dir = os.path.join(dropbox_dir, 'test_data')
os.makedirs(data_dir, exist_ok=True)

# Create a minimal raw_train.csv file
csv_path = os.path.join(data_dir, 'raw_train.csv')
with open(csv_path, 'w', newline='') as f:
    writer = csv.writer(f)
    # Header with required columns
    writer.writerow(['class', 'reactants>reagents>production', 'other_col'])
    # Sample data rows
    writer.writerow(['class_A', 'C>>D', 'extra1'])
    writer.writerow(['class_B', 'E>>F', 'extra2'])

# Create a simple args object
class Args:
    def __init__(self, dropbox, data_name):
        self.dropbox = dropbox
        self.data_name = data_name

ARGS = {
    'args': Args(dropbox=dropbox_dir, data_name='test_data')
}
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 2, 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
smarts_has_useless_parentheses Ran
ran on a synthesized input
Hanjun-Dai/GLN/gln/common/mol_utils.py
code served (permissive licence) · get_code("660cddde78a2c1a0")
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 bool, ndim 0, dtype family float, shape () 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.

# Analyze the function to understand what it needs
# smarts_has_useless_parentheses takes a single parameter: smarts
# It expects smarts to be a string (it checks len, indexing with [0] and [-1], iterates)
# It checks for parentheses balance and structure

# Test case 1: Empty string - should return False
test_case_1 = ""

# Test case 2: String without outer parentheses - should return False
test_case_2 = "CCO"

# Test case 3: String with outer parentheses but content inside - should return True (useless)
test_case_3 = "(CCO)"

# Test case 4: String with outer parentheses but more content after - should return False
test_case_4 = "(CCO)C"

# Test case 5: String with nested parentheses - should return False (not useless)
test_case_5 = "((CCO))"

# Use test case 3 as the main example (useless parentheses case)
ARGS = {
    "smarts": "(CCO)"
}
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 bool, ndim 0, dtype family float, shape () — shape () 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 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 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 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.

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

Retrosynthesis is one of the fundamental problems in organic chemistry. The task is to identify reactants that can be used to synthesize a specified product molecule. Recently, computer-aided retrosynthesis is finding renewed interest from both chemistry and computer science communities. Most existing approaches rely on template-based models that define subgraph matching rules, but whether or not a chemical reaction can proceed is not defined by hard decision rules. In this work, we propose a new approach to this task using the Conditional Graph Logic Network, a conditional graphical model built upon graph neural networks that learns when rules from reaction templates should be applied, implicitly considering whether the resulting reaction would be both chemically feasible and strategic. We also propose an efficient hierarchical sampling to alleviate the computation cost. While achieving a significant improvement of 8.1% over current state-of-the-art methods on the benchmark dataset, our model also offers interpretations for the prediction.

For agents

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

get_harvested_code_for_paper("2001.01408")
get_code_for_paper("2001.01408")
have("2001.01408")

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

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

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

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

Connect an agent — have() is free.