SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.01788 · ICML · 2023

Hierarchical Grammar-Induced Geometry for Data-Efficient Molecular Property Prediction

Payel Das, Wojciech Matusik, Jie Chen, Veronika Thost, Minghao Guo, Samuel Song, Adithya Balachandran, Cl Cl

arXiv · PDF · Open in the Atlas

Code that ran

7 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; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 2 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/2309.01788.json · badge: /api/ran/2309.01788.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
gmh14/Geo-DEG canonical (classifier label)
classifier basis: census
7 ran · 2 no recorded run
FunctionStatusWhere it lives
cycle_index Ran
ran, honoured the contract we drafted
gmh14/Geo-DEG/GCN/pretrain_contextpred.py
pointer only (licence: MIT); the stored copy get_code serves, from shen-lab/graphcl_automated, is pointer only (licence: NONE) · get_code("b822dd00427403bf")
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 shen-lab/graphcl_automated, 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.

eval Ran
ran, honoured the contract we drafted
gmh14/Geo-DEG/GCN/finetune_mutag_ptc.py
code served (permissive licence) · get_code("b9e621ce8971cd48")
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 float64, ndim 0, 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 torch.nn as nn
import numpy as np
from torch_geometric.data import Data, DataLoader

torch.manual_seed(0)

# Define a minimal model that matches the function's usage
class SimpleGNNModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)  # input dim 4, output dim 3 (num tasks)
    
    def forward(self, x, edge_index, edge_attr, batch):
        # x: node features
        # edge_index: edge connectivity
        # edge_attr: edge attributes
        # batch: batch indices
        # Returns predictions for each graph in the batch
        return self.linear(x).mean(dim=0, keepdim=True).expand(batch.max().item() + 1, -1)

# Create a minimal data loader with graph batches
# Each batch needs: x (node features), edge_index, edge_attr, batch (graph indices), y (labels)
batch1 = Data(
    x=torch.randn(5, 4),  # 5 nodes, 4 features
    edge_index=torch.tensor([[0, 1, 2], [1, 2, 3]], dtype=torch.long),
    edge_attr=torch.randn(3, 2),  # 3 edges, 2 attributes
    batch=torch.tensor([0, 0, 0, 0, 1], dtype=torch.long),  # 2 graphs
    y=torch.tensor([[1, -1, 1], [-1, 1, -1]], dtype=torch.float32)  # 2 graphs, 3 tasks
)

batch2 = Data(
    x=torch.randn(4, 4),  # 4 nodes, 4 features
    edge_index=torch.tensor([[0, 1], [1, 2]], dtype=torch.long),
    edge_attr=torch.randn(2, 2),  # 2 edges, 2 attributes
    batch=torch.tensor([0, 0, 1, 1], dtype=torch.long),  # 2 graphs
    y=torch.tensor([[1, 1, -1], [1, -1, 1]], dtype=torch.float32)  # 2 graphs, 3 tasks
)

loader = [batch1, batch2]

model = SimpleGNNModel()
device = torch.device('cpu')

ARGS = {
    'args': None,
    'model': model,
    'device': device,
    'loader': loader
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, torch_geometric, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
graph_data_obj_to_nx_simple Ran
ran, honoured the contract we drafted
gmh14/Geo-DEG/GCN/loader.py
code served (permissive licence) · get_code("287484b87212f47d")
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 Graph. 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 numpy as np
from torch_geometric.data import Data

torch.manual_seed(0)

# Create a small graph Data object with 3 atoms and 2 bonds
# Atom features: [atomic_num_idx, chirality_tag_idx]
atom_features = torch.tensor([
    [6, 0],      # atom 0: carbon, no chirality
    [7, 1],      # atom 1: nitrogen, chirality 1
    [8, 0]       # atom 2: oxygen, no chirality
], dtype=torch.float32)

# Edge index: [2, 4] tensor representing edges
# Each pair of rows represents one undirected edge (stored twice in PyG convention)
edge_index = torch.tensor([
    [0, 1, 1, 0],    # source atoms
    [1, 0, 2, 2]     # target atoms
], dtype=torch.long)

# Edge attributes: [bond_type_idx, bond_dir_idx]
edge_attr = torch.tensor([
    [1, 0],          # bond 0-1: single bond, no direction
    [1, 0],          # bond 1-0: single bond, no direction
    [2, 1],          # bond 1-2: double bond, direction 1
    [2, 1]           # bond 2-1: double bond, direction 1
], dtype=torch.float32)

# Create PyG Data object
data_obj = Data(x=atom_features, edge_index=edge_index, edge_attr=edge_attr)

ARGS = {
    "data": data_obj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy, torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Graph — a Graph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Graph output the recorded ndim 1 and dtype family int 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
pool_func Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gmh14/Geo-DEG/GCN/pretrain_contextpred.py
code served (permissive licence) · get_code("7164f5ee51907055")
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
from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool

torch.manual_seed(0)

# Create node features tensor: shape (num_nodes, num_features)
# Using 6 nodes with 4 features each
x = torch.randn(6, 4)

# Create batch tensor: indicates which graph each node belongs to
# Two graphs: nodes 0-2 belong to graph 0, nodes 3-5 belong to graph 1
batch = torch.tensor([0, 0, 0, 1, 1, 1], dtype=torch.long)

# Mode parameter for pooling operation
mode = 'sum'

ARGS = {
    'x': x,
    'batch': batch,
    'mode': mode
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — 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
sample Ran
ran; our contract draft was wrong, not the code
gmh14/Geo-DEG/agent.py
code served (permissive licence) · get_code("0bd562e4c29a723d")
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
import torch.nn as nn
import numpy as np
from torch.distributions import Categorical

torch.manual_seed(0)

class SimpleAgent(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.saved_log_probs = {}
    
    def forward(self, x):
        logits = self.linear(x)
        probs = torch.softmax(logits, dim=-1)
        return probs

agent = SimpleAgent()
subgraph_feature = torch.randn(2, 4)
iter_num = 0
sample_number = 0

ARGS = {
    "agent": agent,
    "subgraph_feature": subgraph_feature,
    "iter_num": iter_num,
    "sample_number": sample_number
}
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 — 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
train Ran
ran, honoured the contract we drafted
gmh14/Geo-DEG/GCN/pretrain_contextpred.py
code served (permissive licence) · get_code("fa82f5b97a3162ed")
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 torch.nn as nn
from torch_geometric.data import Data, DataLoader

torch.manual_seed(0)

# Small GNN model that takes x, edge_index, edge_attr
class SmallGNN(nn.Module):
    def __init__(self, in_channels=4, out_channels=3):
        super().__init__()
        self.lin1 = nn.Linear(in_channels, out_channels)
    
    def forward(self, x, edge_index, edge_attr):
        # Simple passthrough with linear transformation
        return self.lin1(x)

# Arguments config
class ArgsConfig:
    def __init__(self):
        self.mode = 'cbow'  # or 'skipgram'
        self.context_pooling = 'sum'
        self.neg_samples = 2

# Create small geometric graphs for batch
def create_small_batch():
    # Substruct graph: 3 nodes
    x_substruct = torch.randn(3, 4)
    edge_index_substruct = torch.tensor([[0, 1], [1, 2]]).t().contiguous()
    edge_attr_substruct = torch.randn(2, 4)
    center_substruct_idx = torch.tensor([0, 1])
    
    # Context graph: 4 nodes
    x_context = torch.randn(4, 4)
    edge_index_context = torch.tensor([[0, 1, 2], [1, 2, 3]]).t().contiguous()
    edge_attr_context = torch.randn(3, 4)
    overlap_context_substruct_idx = torch.tensor([0, 2])
    batch_overlapped_context = torch.tensor([0, 1])
    overlapped_context_size = torch.tensor([1, 1])
    
    data = Data(
        x_substruct=x_substruct,
        edge_index_substruct=edge_index_substruct,
        edge_attr_substruct=edge_attr_substruct,
        center_substruct_idx=center_substruct_idx,
        x_context=x_context,
        edge_index_context=edge_index_context,
        edge_attr_context=edge_attr_context,
        overlap_context_substruct_idx=overlap_context_substruct_idx,
        batch_overlapped_context=batch_overlapped_context,
        overlapped_context_size=overlapped_context_size,
    )
    return data

# Create loader with 2 samples
loader = [create_small_batch(), create_small_batch()]

# Create models
model_substruct = SmallGNN(in_channels=4, out_channels=3)
model_context = SmallGNN(in_channels=4, out_channels=3)

# Create optimizers
optimizer_substruct = torch.optim.Adam(model_substruct.parameters(), lr=0.01)
optimizer_context = torch.optim.Adam(model_context.parameters(), lr=0.01)

# Create args
args = ArgsConfig()

# Device
device = 'cpu'

ARGS = {
    'args': args,
    'model_substruct': model_substruct,
    'model_context': model_context,
    'loader': loader,
    'optimizer_substruct': optimizer_substruct,
    'optimizer_context': optimizer_context,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric, tqdm — 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
train Ran
ran, honoured the contract we drafted
gmh14/Geo-DEG/GCN/pretrain_deepgraphinfomax.py
code served (permissive licence) · get_code("26bd6db6fc4f8df4")
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 torch.nn as nn
from torch_geometric.data import Data, DataLoader

torch.manual_seed(0)

# Build a minimal GNN model
class MinimalGNN(nn.Module):
    def __init__(self, in_dim, hidden_dim, out_dim):
        super().__init__()
        self.lin1 = nn.Linear(in_dim, hidden_dim)
        self.lin2 = nn.Linear(hidden_dim, out_dim)
    
    def forward(self, x, edge_index, edge_attr):
        x = self.lin1(x)
        x = self.lin2(x)
        return x

# Build a minimal pool model
class MinimalPool(nn.Module):
    def __init__(self, in_dim, out_dim):
        super().__init__()
        self.lin = nn.Linear(in_dim, out_dim)
    
    def forward(self, x, batch):
        # Simple mean pooling per graph
        num_graphs = batch.max().item() + 1
        out = torch.zeros(num_graphs, x.size(1), device=x.device)
        for i in range(num_graphs):
            mask = batch == i
            out[i] = x[mask].mean(dim=0)
        return self.lin(out)

# Build a minimal discriminator model
class MinimalDiscriminator(nn.Module):
    def __init__(self, node_dim, summary_dim):
        super().__init__()
        self.lin = nn.Linear(node_dim + summary_dim, 1)
    
    def forward(self, node_emb, summary_emb):
        combined = torch.cat([node_emb, summary_emb], dim=1)
        return self.lin(combined)

# Build the full model
class FullModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.gnn = MinimalGNN(in_dim=4, hidden_dim=8, out_dim=4)
        self.pool = MinimalPool(in_dim=4, out_dim=3)
        self.discriminator = MinimalDiscriminator(node_dim=4, summary_dim=3)
        self.loss = nn.BCEWithLogitsLoss()

model = FullModel()

# Create minimal batch data
x1 = torch.randn(5, 4)
edge_index1 = torch.tensor([[0, 1, 2], [1, 2, 3]], dtype=torch.long)
edge_attr1 = torch.randn(3, 4)
batch1 = torch.tensor([0, 0, 0, 0, 0], dtype=torch.long)
data1 = Data(x=x1, edge_index=edge_index1, edge_attr=edge_attr1, batch=batch1)

x2 = torch.randn(4, 4)
edge_index2 = torch.tensor([[0, 1], [1, 2]], dtype=torch.long)
edge_attr2 = torch.randn(2, 4)
batch2 = torch.tensor([1, 1, 1, 1], dtype=torch.long)
data2 = Data(x=x2, edge_index=edge_index2, edge_attr=edge_attr2, batch=batch2)

loader = [data1, data2]

optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

device = torch.device('cpu')

ARGS = {
    'args': None,
    'model': model,
    'device': device,
    'loader': loader,
    'optimizer': optimizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric, tqdm — 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
eval Not yet run
unverified (harvested, no recorded run)
gmh14/Geo-DEG/GCN/finetune.py
pointer only (licence: MIT); the stored copy get_code serves, from DeepGraphLearning/GraphLoG, is pointer only (licence: NONE) · get_code("f6e29229f7916056")
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 DeepGraphLearning/GraphLoG, 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. No invocation recorded.

get_test_acc Not yet run
unverified (harvested, no recorded run)
gmh14/Geo-DEG/GCN/parse_result.py
pointer only (licence: MIT); the stored copy get_code serves, from LiuChuang0059/StructMAE, is pointer only (licence: NONE) · get_code("7a2bb855a3e02bfe")
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 LiuChuang0059/StructMAE, 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. 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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 4 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
graph_data_obj_to_nx_simple 9 other papers
3 dated earlier, 2 the same month, 4 later
1905.12265 (2019-05)
Strategies for Pre-training Graph Neural Networks
2302.04451 (2023-02)
Generalization in Graph Neural Networks: Improved PAC-Bayesian Bounds on Graph Diffusion
2306.07812 (2023-06)
Automated 3D Pre-Training for Molecular Property Prediction
and 6 more not named here
cycle_index 8 other papers
5 dated earlier, 3 later
1905.12265 (2019-05)
Strategies for Pre-training Graph Neural Networks
2010.13902 (2020-10)
Graph Contrastive Learning with Augmentations
2106.07594 (2021-06)
Graph Contrastive Learning Automated
and 5 more not named here
eval 5 other papers
4 dated earlier, 1 later
2106.04113 (2021-06)
Self-supervised Graph-level Representation Learning with Local and Global Structure
2106.09645 (2021-06)
Prototypical Graph Contrastive Learning
2109.10259 (2021-09)
AutoGCL: Automated Graph Contrastive Learning via Learnable View Generators
and 2 more not named here
get_test_acc 2 other papers
1 dated earlier, 1 later
2302.04451 (2023-02)
Generalization in Graph Neural Networks: Improved PAC-Bayesian Bounds on Graph Diffusion
2404.15806 (2024-04)
Where to Mask: Structure-Guided Masking for Graph Masked Autoencoders
pool_func 1 other paper
1 dated earlier
1905.12265 (2019-05)
Strategies for Pre-training Graph Neural Networks

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

The prediction of molecular properties is a crucial task in the field of material and drug discovery. The potential benefits of using deep learning techniques are reflected in the wealth of recent literature. Still, these techniques are faced with a common challenge in practice: Labeled data are limited by the cost of manual extraction from literature and laborious experimentation. In this work, we propose a data-efficient property predictor by utilizing a learnable hierarchical molecular grammar that can generate molecules from grammar production rules. Such a grammar induces an explicit geometry of the space of molecular graphs, which provides an informative prior on molecular structural similarity. The property prediction is performed using graph neural diffusion over the grammar-induced geometry. On both small and large datasets, our evaluation shows that this approach outperforms a wide spectrum of baselines, including supervised and pre-trained graph neural networks. We include a detailed ablation study and further analysis of our solution, showing its effectiveness in cases with extremely limited data. Code is available at https: //github.com/gmh14/Geo-DEG.

For agents

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

get_harvested_code_for_paper("2309.01788")
get_code_for_paper("2309.01788")
have("2309.01788")

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

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

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

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

Connect an agent — have() is free.