SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.11135 · 2026

Context-aware Graph Causality Inference for Few-Shot Molecular Property Prediction

Van Hoang, O-Joun Lee

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 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 0 have no contract verdict; 7 failures of our instrument; 4 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/2601.11135.json · badge: /api/ran/2601.11135.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
NSLab-CUK/CaMol canonical (classifier label)
classifier basis: census
8 ran · 4 no recorded run
FunctionStatusWhere it lives
DigitizeY Ran
ran; our contract draft was wrong, not the code
NSLab-CUK/CaMol/gnnutils.py
code served (permissive licence) · get_code("be384a8aa916b3d6")
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 MockPyGData. 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

torch.manual_seed(0)

class MockPyGData:
    def __init__(self, y):
        self.y = y

# Create a small tensor with values that will work with np.log10
# Values should be positive and in a reasonable range for log10
y_values = np.array([1.0, 5.0, 10.0, 50.0])
y_tensor = torch.from_numpy(y_values).float()

pyg_data = MockPyGData(y=y_tensor)

ARGS = {
    'pyg_data': pyg_data
}
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 MockPyGData — a MockPyGData output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockPyGData 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
Fidelity Ran
ran; our contract draft was wrong, not the code
NSLab-CUK/CaMol/metrics.py
code served (permissive licence) · get_code("c3680da6d88cfc57")
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)

# Create small tensors with batch size 2
batch_size = 2

# scores: shape (batch_size, num_classes) - used with .argmax(dim=1)
# Let's use 3 classes to make argmax meaningful
scores = torch.randn(batch_size, 3)

# targets: shape (batch_size, 1) - used with .squeeze(dim=-1) and compared with argmax results
targets = torch.tensor([[1], [0]], dtype=torch.float32)

# pos: shape (batch_size, num_classes) - used with .argmax(dim=1)
pos = torch.randn(batch_size, 3)

# neg: shape (batch_size, num_classes) - used with .argmax(dim=1) and compared with 0/1
neg = torch.randn(batch_size, 3)

ARGS = {
    "scores": scores,
    "targets": targets,
    "pos": pos,
    "neg": neg,
}
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
compute_kl_divergence1ds Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NSLab-CUK/CaMol/train_moleculenetBACE.py
code served (permissive licence) · get_code("357cd13d5f773613")
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 numpy as np
from sklearn.neighbors import KernelDensity

# Create sample 1D distributions
p = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
q = np.array([1.5, 2.5, 3.5, 4.5, 5.5])

ARGS = {
    "p": p,
    "q": q,
    "bandwidth": 0.5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
cosinSim Ran
ran; our contract draft was wrong, not the code
NSLab-CUK/CaMol/train_moleculenet.py
code served (permissive licence) · get_code("1049f188f6da7eff")
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, 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)

# Create a small tensor with batch size 2 and dimension 4
x_hat = torch.randn(2, 4)

ARGS = {
    "x_hat": x_hat
}
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, 2) — shape (2, 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
count_params Ran
ran, honoured the contract we drafted
NSLab-CUK/CaMol/exp_moleculeSTCT_p.py
code served (permissive licence) · get_code("a2be2682c142677f")
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 int, ndim 0, dtype family int, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a simple nn.Module with some parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

module = SimpleModel()

ARGS = {
    "module": module
}
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 int, ndim 0, dtype family int, 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
eval_ap Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NSLab-CUK/CaMol/metrics.py
code served (permissive licence) · get_code("3f2d728682b53e0a")
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 numpy as np

np.random.seed(0)

# Create sample data for eval_ap
# y_true: shape (n_samples, n_tasks) with binary labels
# y_pred: shape (n_samples, n_tasks) with prediction scores

n_samples = 10
n_tasks = 4

# Create y_true with binary labels (0 and 1)
# Ensure each task has both positive and negative examples
y_true = np.array([
    [1, 0, 1, 0],
    [0, 1, 0, 1],
    [1, 1, 0, 0],
    [0, 0, 1, 1],
    [1, 0, 1, 0],
    [0, 1, 0, 1],
    [1, 1, 0, 0],
    [0, 0, 1, 1],
    [1, 0, 1, 1],
    [1, 1, 0, 0],
], dtype=np.int32)

# Create y_pred with prediction scores between 0 and 1
y_pred = np.random.rand(n_samples, n_tasks).astype(np.float32)

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
eval_rocauc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NSLab-CUK/CaMol/metrics.py
code served (permissive licence) · get_code("7cae08c15fd4d60b")
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 numpy as np

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

# Create sample data for eval_rocauc
# y_true: shape (n_samples, n_tasks) with binary labels (0 or 1)
# y_pred: shape (n_samples, n_tasks) with prediction scores in [0, 1]

n_samples = 10
n_tasks = 4

# Create y_true with binary labels, ensuring each task has both 0s and 1s
y_true = np.array([
    [1, 0, 1, 0],
    [0, 1, 0, 1],
    [1, 1, 0, 0],
    [0, 0, 1, 1],
    [1, 0, 1, 0],
    [0, 1, 0, 1],
    [1, 1, 0, 0],
    [0, 0, 1, 1],
    [1, 0, 1, 0],
    [0, 1, 0, 1],
], dtype=np.int64)

# Create y_pred with random prediction scores
y_pred = np.random.rand(n_samples, n_tasks).astype(np.float32)

ARGS = {
    'y_true': y_true,
    'y_pred': y_pred,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
mask_getitem Ran
ran; our contract draft was wrong, not the code
NSLab-CUK/CaMol/dataset.py
code served (permissive licence) · get_code("9a5805281d49fe0f")
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 MockDatum. 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)

class MockDatum(dict):
    """A dict subclass that supports __setitem__ for the function to use."""
    def __init__(self):
        super().__init__()
        self['data'] = torch.randn(2, 4)

class MockSelf:
    """Mock self object with train_mask, val_mask, test_mask attributes."""
    def __init__(self):
        self.train_mask = torch.tensor([True, False, True, False])
        self.val_mask = torch.tensor([False, True, False, True])
        self.test_mask = torch.tensor([False, False, True, True])

mock_self = MockSelf()
mock_datum = MockDatum()

ARGS = {
    'self': mock_self,
    'datum': mock_datum
}
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 MockDatum — a MockDatum output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockDatum 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
build_multigraph_from_layers Not yet run
unverified (harvested, no recorded run)
NSLab-CUK/CaMol/build_multigraph.py
code served (permissive licence) · get_code("5d28fa208f6b62a9")
How it ran

no invocation recorded.

even_quantile_labels Not yet run
unverified (harvested, no recorded run)
NSLab-CUK/CaMol/dataset.py
code served (permissive licence) · get_code("be162bddd27d9fac")
How it ran

no invocation recorded.

load_Cora_ML Not yet run
unverified (harvested, no recorded run)
NSLab-CUK/CaMol/gnnutils.py
code served (permissive licence) · get_code("699ec24a50a1213a")
How it ran

no invocation recorded.

process_diff Not yet run
unverified (harvested, no recorded run)
NSLab-CUK/CaMol/train_moleculenetBACE.py
code served (permissive licence) · get_code("37a6352e459f9037")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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
even_quantile_labels 8 other papers
8 dated earlier
2210.07606 (2022-10)
Revisiting Heterophily For Graph Neural Networks
2302.01524 (2023-02)
Ordered GNN: Ordering Message Passing to Deal with Heterophily and Over-smoothing
2306.08274 (2023-06)
A Simple and Scalable Graph Neural Network for Large Directed Graphs
and 5 more not named here
eval_ap 2 other papers
2 dated earlier
2312.01538 (2023-12)
Recurrent Distance Filtering for Graph Representation Learning
2405.17163 (2024-05)
Port-Hamiltonian Architectural Bias for Long-Range Propagation in Deep Graph Networks
eval_rocauc 2 other papers
2 dated earlier
2411.16278 (2024-11)
Even Sparser Graph Transformers
2412.09805 (2024-12)
Making Classic GNNs Strong Baselines Across Varying Homophily: A Smoothness-Generalization Perspective
DigitizeY 1 other paper
1 dated earlier
2308.09517 (2023-08)
Transitivity-Preserving Graph Representation Learning for Bridging Local Connectivity and Role-based Similarity
build_multigraph_from_layers 1 other paper
1 dated earlier
2106.06586 (2021-06)
Breaking the Limit of Graph Neural Networks by Improving the Assortativity of Graphs with Local Mixing Patterns
load_Cora_ML 1 other paper
1 dated earlier
2308.09517 (2023-08)
Transitivity-Preserving Graph Representation Learning for Bridging Local Connectivity and Role-based Similarity
mask_getitem 1 other paper
1 dated earlier
2308.09517 (2023-08)
Transitivity-Preserving Graph Representation Learning for Bridging Local Connectivity and Role-based Similarity

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

Molecular property prediction is becoming one of the major applications of graph learning in Web-based services, e.g., online protein structure prediction and drug discovery. A key challenge arises in few-shot scenarios, where only a few labeled molecules are available for predicting unseen properties. Recently, several studies have used in-context learning to capture relationships among molecules and properties, but they face two limitations in: (1) exploiting prior knowledge of functional groups that are causally linked to properties and (2) identifying key substructures directly correlated with properties. We propose CaMol, a context-aware graph causality inference framework, to address these challenges by using a causal inference perspective, assuming that each molecule consists of a latent causal structure that determines a specific property. First, we introduce a context graph that encodes chemical knowledge by linking functional groups, molecules, and properties to guide the discovery of causal substructures. Second, we propose a learnable atom masking strategy to disentangle causal substructures from confounding ones. Third, we introduce a distribution intervener that applies backdoor adjustment by combining causal substructures with chemically grounded confounders, disentangling causal effects from real-world chemical variations. Experiments on diverse molecular datasets showed that CaMol achieved superior accuracy and sample efficiency in few-shot tasks, showing its generalizability to unseen properties. Also, the discovered causal substructures were strongly aligned with chemical knowledge about functional groups, supporting the model interpretability.

For agents

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

get_harvested_code_for_paper("2601.11135")
get_code_for_paper("2601.11135")
have("2601.11135")

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

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

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

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

Connect an agent — have() is free.