SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2504.08051 · ICML · 2025

Compositional Flows for 3D Molecule and Synthesis Pathway Co-design

Martin Ester, Simon Olsson, Woo Kim, Kieran Didi, Seonghwan Seo, Tony Shen, Ross Irwin

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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; 3 no recorded run), measured 2026-11-21; 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/2504.08051.json · badge: /api/ran/2504.08051.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
tsa87/cgflow canonical (classifier label)
classifier basis not recorded on the link
4 ran · 3 no recorded run
FunctionStatusWhere it lives
calc_train_steps Ran
ran on a synthesized input
tsa87/cgflow/src/cgflow/scriptutil.py
code served (permissive licence) · get_code("731974548566274d")
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 math

torch.manual_seed(0)

class StandInDataModule:
    def __init__(self, num_samples=10):
        self.num_samples = num_samples
        self._train_dataloader = None
    
    def setup(self, stage):
        # stage can be 'train', 'val', 'test'
        if stage == 'train':
            # Create a simple train dataloader with num_samples batches
            self._train_dataloader = [
                (torch.randn(2, 4), torch.randint(0, 2, (2,)))
                for _ in range(self.num_samples)
            ]
    
    def train_dataloader(self):
        return self._train_dataloader

dm = StandInDataModule(num_samples=10)
epochs = 3
acc_batches = 2

ARGS = {
    'dm': dm,
    'epochs': epochs,
    'acc_batches': acc_batches
}
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
construct_protein_data_from_graph_gvp Ran
ran on a synthesized input
tsa87/cgflow/src/cgflow/gvp/pocket.py
code served (permissive licence) · get_code("491add0372343e0a")
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 HeteroData. 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
import torch
from torch_geometric.data import HeteroData

torch.manual_seed(0)

# Create small sample data
n_nodes = 4
n_edges = 5
coord_dim = 3
scalar_feat_dim = 8
vector_feat_dim = 16

# protein_coords: (n_nodes, 3) - coordinates of protein nodes
protein_coords = np.random.randn(n_nodes, coord_dim).astype(np.float32)

# protein_seq: (n_nodes,) - sequence data for each node
protein_seq = np.array(['A', 'G', 'C', 'T'], dtype=object)

# protein_node_s: (n_nodes, scalar_feat_dim) - scalar node features
protein_node_s = np.random.randn(n_nodes, scalar_feat_dim).astype(np.float32)

# protein_node_v: (n_nodes, 3, vector_feat_dim) - vector node features
protein_node_v = np.random.randn(n_nodes, 3, vector_feat_dim).astype(np.float32)

# protein_edge_index: (2, n_edges) - edge indices
protein_edge_index = np.array([
    [0, 1, 2, 3, 0],
    [1, 2, 3, 0, 2]
], dtype=np.int64)

# protein_edge_s: (n_edges, scalar_feat_dim) - scalar edge features
protein_edge_s = np.random.randn(n_edges, scalar_feat_dim).astype(np.float32)

# protein_edge_v: (n_edges, vector_feat_dim) - vector edge features
protein_edge_v = np.random.randn(n_edges, vector_feat_dim).astype(np.float32)

ARGS = {
    'protein_coords': protein_coords,
    'protein_seq': protein_seq,
    'protein_node_s': protein_node_s,
    'protein_node_v': protein_node_v,
    'protein_edge_index': protein_edge_index,
    'protein_edge_s': protein_edge_s,
    'protein_edge_v': protein_edge_v,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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 HeteroData — a HeteroData 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
generate_molecules Ran
ran on a synthesized input
tsa87/cgflow/src/cgflow/scriptutil.py
code served (permissive licence) · get_code("bc2c4d4cb0741fd4")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from torch.utils.data import DataLoader

torch.manual_seed(0)

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def eval(self):
        super().eval()
        return self
    
    def to(self, device):
        super().to(device)
        return self
    
    def _generate(self, batch, steps, strategy):
        # Returns mock output structure
        batch_size = list(batch.values())[0].shape[0]
        return {
            'generated': torch.randn(batch_size, 5, 4),
            'logits': torch.randn(batch_size, 5, 3)
        }
    
    def _generate_mols(self, output):
        # Returns list of mock molecules
        batch_size = output['generated'].shape[0]
        return [f"mol_{i}" for i in range(batch_size)]
    
    def _generate_stabilities(self, output):
        # Returns list of mock stabilities
        batch_size = output['generated'].shape[0]
        return [0.95 + i * 0.01 for i in range(batch_size)]

class MockDataModule:
    def test_dataloader(self):
        # Return a dataloader with batches as dicts wrapped in list
        batch1 = {
            'input_ids': torch.randint(0, 10, (2, 4)),
            'attention_mask': torch.ones(2, 4)
        }
        batch2 = {
            'input_ids': torch.randint(0, 10, (2, 4)),
            'attention_mask': torch.ones(2, 4)
        }
        # Each item is (batch_dict,) tuple as the function expects batch[0]
        return [(batch1,), (batch2,)]

model = MockModel()
dm = MockDataModule()
steps = 10
strategy = "greedy"
stabilities = False

ARGS = {
    'model': model,
    'dm': dm,
    'steps': steps,
    'strategy': strategy,
    'stabilities': stabilities
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
get_protein_edge_features_and_index Ran
ran on a synthesized input
tsa87/cgflow/src/cgflow/gvp/pocket.py
code served (permissive licence) · get_code("87534a3436646b52")
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 numpy as np
import torch

torch.manual_seed(0)

# Construct arguments for get_protein_edge_features_and_index
# The function expects:
# - protein_edge_index: array indexing nodes, shape (2, num_edges)
# - protein_edge_s: scalar features for edges, shape (num_edges,)
# - protein_edge_v: vector features for edges, shape (num_edges, feature_dim)
# - keepNode: boolean array for which nodes to keep, shape (num_nodes,)

num_nodes = 5
num_edges = 4
edge_feature_dim = 3

# protein_edge_index: 2 x num_edges array with node indices
# Values should be in range [0, num_nodes)
protein_edge_index = np.array([
    [0, 1, 2, 3],
    [1, 2, 3, 4]
], dtype=np.int64)

# protein_edge_s: scalar edge features, shape (num_edges,)
protein_edge_s = np.array([0.1, 0.2, 0.3, 0.4], dtype=np.float32)

# protein_edge_v: vector edge features, shape (num_edges, feature_dim)
protein_edge_v = np.array([
    [1.0, 2.0, 3.0],
    [4.0, 5.0, 6.0],
    [7.0, 8.0, 9.0],
    [10.0, 11.0, 12.0]
], dtype=np.float32)

# keepNode: boolean array indicating which nodes to keep, shape (num_nodes,)
# At least one node per edge must be kept for edges to survive
keepNode = np.array([True, True, False, True, False], dtype=bool)

ARGS = {
    "protein_edge_index": protein_edge_index,
    "protein_edge_s": protein_edge_s,
    "protein_edge_v": protein_edge_v,
    "keepNode": keepNode
}
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
build_trainer Not yet run
unverified (harvested, no recorded run)
tsa87/cgflow/src/cgflow/buildutil/build_trainer.py
code served (permissive licence) · get_code("45f0b9717247169e")
How it ran

no invocation recorded.

get_protein_feature Not yet run
unverified (harvested, no recorded run)
tsa87/cgflow/src/cgflow/gvp/pocket.py
code served (permissive licence) · get_code("7b2b8e02037c1205")
How it ran

no invocation recorded.

load_config Not yet run
unverified (harvested, no recorded run)
tsa87/cgflow/src/cgflow/scriptutil.py
code served (permissive licence) · get_code("1599187289b700d2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 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.

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-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Many generative applications, such as synthesisbased 3D molecular design, involve constructing compositional objects with continuous features. Here, we introduce Compositional Generative Flows (CGFlow), a novel framework that extends flow matching to generate objects in compositional steps while modeling continuous states. Our key insight is that modeling compositional state transitions can be formulated as a straightforward extension of the flow matching interpolation process. We further build upon the theoretical foundations of generative flow networks (GFlowNets), enabling reward-guided sampling of compositional structures. We apply CGFlow to synthesizable drug design by jointly designing the molecule's synthetic pathway with its 3D binding pose. Our approach achieves state-ofthe-art binding affinity and synthesizability on all 15 targets from the LIT-PCBA benchmark, and 4.2× improvement in sampling efficiency compared to 2D synthesis-based baseline. To our best knowledge, our method is also the first to achieve state of-art-performance in both Vina Dock (-9.42) and AiZynth success rate (36.1%) on the CrossDocked2020 benchmark.

For agents

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

get_harvested_code_for_paper("2504.08051")
get_code_for_paper("2504.08051")
have("2504.08051")

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

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

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

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

Connect an agent — have() is free.