SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.20719 · ICLR · 2025

A Genetic Algorithm for Navigating Synthesizable Molecular Spaces

Connor Coley, Wojciech Matusik, Alston Lo

arXiv · PDF · Open in the Atlas

Code that ran

1 of 8 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 0 have no contract verdict; 1 failure of our instrument; 7 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/2509.20719.json · badge: /api/ran/2509.20719.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
alstonlo/synga community
Papers with Code archive
1 ran · 7 no recorded run
FunctionStatusWhere it lives
synthesis_crossmut Ran
ran; our contract draft was wrong, not the code
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("7f32c9e212527220")
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 SynthesisTree. 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 numpy.random import RandomState

# Mock classes for the chemistry/synthesis tree domain
class Node:
    def __init__(self, node_id):
        self.node_id = node_id

class SynthesisTree:
    def __init__(self, tree_id, num_nodes=3):
        self.tree_id = tree_id
        self.G = list(range(num_nodes))  # vertices
        self._steps_count = 1
        self._nodes = {i: Node(i) for i in range(num_nodes)}
    
    def steps(self, v):
        return self._steps_count
    
    def node(self, v):
        return self._nodes[v]
    
    def subtree(self, v):
        return SynthesisTree(self.tree_id * 10 + v, num_nodes=2)
    
    def grow(self, lib, rng):
        if self._steps_count < lib.max_steps - 1:
            new_tree = SynthesisTree(self.tree_id + 1000, num_nodes=4)
            new_tree._steps_count = self._steps_count + 1
            return new_tree, True
        return None, False
    
    def shrink(self, lib, rng):
        if self._steps_count > 1:
            new_tree = SynthesisTree(self.tree_id + 2000, num_nodes=2)
            new_tree._steps_count = max(1, self._steps_count - 1)
            return new_tree, True
        return None, False
    
    def rerun(self, lib, rng):
        new_tree = SynthesisTree(self.tree_id + 3000, num_nodes=3)
        new_tree._steps_count = self._steps_count
        return new_tree, True
    
    def change_internal(self, lib, rng):
        new_tree = SynthesisTree(self.tree_id + 4000, num_nodes=3)
        new_tree._steps_count = self._steps_count
        return new_tree, True
    
    def change_leaf(self, lib, rng):
        new_tree = SynthesisTree(self.tree_id + 5000, num_nodes=3)
        new_tree._steps_count = self._steps_count
        return new_tree, True
    
    @staticmethod
    def join(lib, rxnid, subtrees, rng):
        new_tree = SynthesisTree(100 + rxnid, num_nodes=5)
        new_tree._steps_count = sum(s._steps_count for s in subtrees) + 1
        return new_tree

class ReactionLibrary:
    def __init__(self, max_steps=20, num_reactions=5):
        self.max_steps = max_steps
        self.reactions = list(range(num_reactions))
    
    def can_react(self, rxnid, nodes):
        return rxnid % 2 == 0

class OpsModule:
    @staticmethod
    def choice(options, rng, p=None):
        idx = rng.choice(len(options))
        return options[idx]
    
    @staticmethod
    def normalize(arr):
        total = sum(arr)
        if total == 0:
            return arr
        return [x / total for x in arr]

class ChemModule:
    SynthesisTree = SynthesisTree
    
    @staticmethod
    def silence_rdlogger():
        pass

# Global mock library
_lib = ReactionLibrary(max_steps=20, num_reactions=5)

# Create module-like objects for ops and chem
class MockModule:
    pass

ops = OpsModule()
chem = ChemModule()

# Set up globals for the function
import sys
current_module = sys.modules[__name__]
current_module.ops = ops
current_module.chem = chem
current_module._lib = _lib

# Create input arguments
rng = RandomState(42)
parent1 = SynthesisTree(tree_id=1, num_nodes=3)
parent2 = SynthesisTree(tree_id=2, num_nodes=3)
parents = [parent1, parent2]

ARGS = {
    'input': (parents, rng),
    'pcross': 0.7,
    'pmut': 0.5,
    'tries': 10
}
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 SynthesisTree — a SynthesisTree output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SynthesisTree 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
GA Not yet run
unverified (harvested, no recorded run)
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("038622c9c761de69")
How it ran

no invocation recorded.

MolecularOptimizer Not yet run
unverified (harvested, no recorded run)
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("2ec43d8dbdad6e8c")
How it ran

no invocation recorded.

SynthesisGA Not yet run
unverified (harvested, no recorded run)
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("41f92d9f9de1d0fc")
How it ran

no invocation recorded.

synthesis_cross Not yet run
unverified (harvested, no recorded run)
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("92bcbba5a06c4c7a")
How it ran

no invocation recorded.

synthesis_init Not yet run
unverified (harvested, no recorded run)
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("253f865e1c3fdd8b")
How it ran

no invocation recorded.

synthesis_mutate Not yet run
unverified (harvested, no recorded run)
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("68ad7adf169fc26e")
How it ran

no invocation recorded.

synthesis_start Not yet run
unverified (harvested, no recorded run)
alstonlo/synga/src/optim/synga.py
code served (permissive licence) · get_code("3c5bcdf151d7eda6")
How it ran

no invocation recorded.

Also present in other papers' code

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

Inspired by the effectiveness of genetic algorithms and the importance of synthesizability in molecular design, we present SynGA, a simple genetic algorithm that operates directly over synthesis routes. Our method features custom crossover and mutation operators that explicitly constrain it to synthesizable molecular space. By modifying the fitness function, we demonstrate the effectiveness of SynGA on a variety of design tasks, including synthesizable analog search and sample-efficient property optimization, for both 2D and 3D objectives. Furthermore, by coupling SynGA with a machine learning-based filter that focuses the building block set, we boost SynGA to state-of-the-art performance. For property optimization, this manifests as a model-based variant SynGBO, which employs SynGA and block filtering in the inner loop of Bayesian optimization. Since SynGA is lightweight and enforces synthesizability by construction, our hope is that SynGA can not only serve as a strong standalone baseline but also as a versatile module that can be incorporated into larger synthesis-aware workflows in the future. Our code is available at https://github.com/alstonlo/synga.

For agents

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

get_harvested_code_for_paper("2509.20719")
get_code_for_paper("2509.20719")
have("2509.20719")

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

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

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

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

Connect an agent — have() is free.