SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.04040 · NeurIPS · 2023

Sample-efficient Multi-objective Molecular Optimization with GFlowNets

Yiheng Zhu, Jialu Wu, Chaowen Hu, Jiahuan Yan, Chang-Yu Hsieh, Tingjun Hou, Jian Wu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 2 violated it and 2 have no contract verdict; 2 failures of our instrument; 2 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/2302.04040.json · badge: /api/ran/2302.04040.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
violet-sto/HN-GFN canonical (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
hyeonahkimm/genetic_gfn community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
GraphAgent Ran
ran on a synthesized input · constructed an object; no result was computed
hyeonahkimm/genetic_gfn/multi_objective/model_block.py
code served (permissive licence) · get_code("7a16eaef3aefaca2")
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 an instance of its own class, GraphAgent: the run constructed the object and did not call it, so no result was computed. 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 torch_geometric.data as tg_data

torch.manual_seed(0)

class MDPConfig:
    def __init__(self):
        self.num_true_blocks = 5
        self.num_stem_types = 3

mdp_cfg = MDPConfig()

nemb = 4
nvec = 3
out_per_stem = 2
out_per_mol = 1
num_conv_steps = 2
version = 'v4'
partition_init = 0

ARGS = {
    'nemb': nemb,
    'nvec': nvec,
    'out_per_stem': out_per_stem,
    'out_per_mol': out_per_mol,
    'num_conv_steps': num_conv_steps,
    'mdp_cfg': mdp_cfg,
    'version': version,
    'partition_init': partition_init,
}
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 GraphAgent — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GraphAgent 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
GraphAgent_Concat Ran
ran on a synthesized input · constructed an object; no result was computed
hyeonahkimm/genetic_gfn/multi_objective/model_block.py
code served (permissive licence) · get_code("43af903ddff3c3e2")
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 an instance of its own class, GraphAgent_Concat: the run constructed the object and did not call it, so no result was computed. 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 torch_geometric.data as gd

torch.manual_seed(0)

# Create a minimal mdp_cfg stand-in
class MDPConfig:
    def __init__(self):
        self.num_true_blocks = 10
        self.num_stem_types = 5

mdp_cfg = MDPConfig()

# Create minimal graph data for forward pass
# The forward method expects: x, batch, edge_index, edge_attr, stemtypes, _slice_dict, stems, stems_batch
graph_data = gd.Data()
num_nodes = 6
num_edges = 8
num_stems = 3

# x: node features (block indices), shape [num_nodes]
graph_data.x = torch.randint(0, mdp_cfg.num_true_blocks, (num_nodes,))

# batch: which graph each node belongs to, shape [num_nodes]
graph_data.batch = torch.tensor([0, 0, 0, 1, 1, 1], dtype=torch.long)

# edge_index: edge connectivity, shape [2, num_edges]
graph_data.edge_index = torch.tensor([
    [0, 1, 2, 3, 4, 5, 0, 1],
    [1, 2, 0, 4, 5, 3, 2, 0]
], dtype=torch.long)

# edge_attr: edge features (bond types), shape [num_edges, 2]
graph_data.edge_attr = torch.randint(0, mdp_cfg.num_stem_types, (num_edges, 2))

# stemtypes: stem type indices, shape [num_stems]
graph_data.stemtypes = torch.randint(0, mdp_cfg.num_stem_types, (num_stems,))

# stems: stem information [stem_block_idx, ...], shape [num_stems, 1]
graph_data.stems = torch.tensor([[0], [1], [4]], dtype=torch.long)

# stems_batch: which graph each stem belongs to, shape [num_stems]
graph_data.stems_batch = torch.tensor([0, 0, 1], dtype=torch.long)

# _slice_dict: slicing info for batching (needed for stem_block_batch_idx calculation)
# This maps node boundaries for each graph
graph_data._slice_dict = {'x': [0, 3, 6], 'stems': [0, 2, 3]}

# vec_data: optional vector data for version v1, v2, v3
vec_data = torch.randn(2, 7)  # [num_graphs, nvec]

ARGS = {
    'nemb': 8,
    'nvec': 7,
    'out_per_stem': 4,
    'out_per_mol': 3,
    'num_conv_steps': 2,
    'mdp_cfg': mdp_cfg,
    'version': 'v1',
    'partition_init': 150.0
}
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 GraphAgent_Concat — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a GraphAgent_Concat 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
edge_match Ran
ran, violated the contract we drafted
violet-sto/HN-GFN/mol_mdp_ext.py
code served (permissive licence) · get_code("6b452c8d0cc45c99")
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 1, dtype family float, shape (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

torch.manual_seed(0)

# The function edge_match compares the 'bond' key in two dictionaries
# x1 and x2 are expected to be dicts with a 'bond' key

x1 = {
    'bond': torch.tensor([1, 0, 1, 0], dtype=torch.int32)
}

x2 = {
    'bond': torch.tensor([1, 0, 1, 0], dtype=torch.int32)
}

ARGS = {
    'x1': x1,
    'x2': x2
}
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 1, dtype family float, shape (4,) — shape (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
mols2batch Ran
ran; our contract draft was wrong, not the code
violet-sto/HN-GFN/model_atom.py
pointer only (licence: MIT); the stored copy get_code serves, from ZRNB/PLUS, is pointer only (licence: NONE) · get_code("06477cbf36090384")
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 ZRNB/PLUS, 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.

mols2batch Ran
ran; our contract draft was wrong, not the code
violet-sto/HN-GFN/model_block.py
pointer only (licence: MIT); the stored copy get_code serves, from ZRNB/PLUS, is pointer only (licence: NONE) · get_code("e2f61d62c1a23b4e")
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 ZRNB/PLUS, 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.

node_match Ran
ran, violated the contract we drafted
violet-sto/HN-GFN/mol_mdp_ext.py
code served (permissive licence) · get_code("514f704ea4cae3e4")
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.

import torch

torch.manual_seed(0)

x1 = {'block': 1}
x2 = {'block': 1}

ARGS = {
    'x1': x1,
    'x2': x2
}
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 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
mol2graph Not yet run
unverified (harvested, no recorded run)
violet-sto/HN-GFN/model_block.py
code served (permissive licence) · get_code("fc7b85a52758c1c3")
How it ran

no invocation recorded.

mols2batch Not yet run
unverified (harvested, no recorded run)
violet-sto/HN-GFN/model_fingerprint.py
pointer only (licence: MIT); the stored copy get_code serves, from ZRNB/PLUS, is pointer only (licence: NONE) · get_code("32208d4977dcb086")
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 ZRNB/PLUS, 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 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, 5 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 4 the same month, 5 later) and 3 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
mols2batch 4 other papers
1 dated earlier, 1 the same month, 2 later
2106.04399 (2021-06)
Flow Network based Generative Models for Non-Iterative Diverse Candidate Generation
2302.05793 (2023-02)
Distributional GFlowNets with Quantile Flows
2310.12934 (2023-10)
Generative Flow Networks as Entropy-Regularized RL
and 1 more not named here
mols2batch 3 other papers
1 dated earlier, 1 the same month, 1 later
2106.04399 (2021-06)
Flow Network based Generative Models for Non-Iterative Diverse Candidate Generation
2302.05793 (2023-02)
Distributional GFlowNets with Quantile Flows
2510.00805 (2025-10)
Planning-Augmented Sampling with Early Guidance for High-Reward Discovery
edge_match 2 other papers
1 the same month, 1 later
2302.05793 (2023-02)
Distributional GFlowNets with Quantile Flows
2310.12934 (2023-10)
Generative Flow Networks as Entropy-Regularized RL
mols2batch 2 other papers
1 dated earlier, 1 later
2106.04399 (2021-06)
Flow Network based Generative Models for Non-Iterative Diverse Candidate Generation
2510.00805 (2025-10)
Planning-Augmented Sampling with Early Guidance for High-Reward Discovery
node_match 2 other papers
1 the same month, 1 later
2302.05793 (2023-02)
Distributional GFlowNets with Quantile Flows
2310.12934 (2023-10)
Generative Flow Networks as Entropy-Regularized RL

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 crucial scientific problems involve designing novel molecules with desired properties, which can be formulated as a black-box optimization problem over the discrete chemical space. In practice, multiple conflicting objectives and costly evaluations (e.g., wet-lab experiments) make the diversity of candidates paramount. Computational methods have achieved initial success but still struggle with considering diversity in both objective and search space. To fill this gap, we propose a multi-objective Bayesian optimization (MOBO) algorithm leveraging the hypernetwork-based GFlowNets (HN-GFN) as an acquisition function optimizer, with the purpose of sampling a diverse batch of candidate molecular graphs from an approximate Pareto front. Using a single preference-conditioned hypernetwork, HN-GFN learns to explore various trade-offs between objectives. We further propose a hindsight-like off-policy strategy to share high-performing molecules among different preferences in order to speed up learning for HN-GFN. We empirically illustrate that HN-GFN has adequate capacity to generalize over preferences. Moreover, experiments in various real-world MOBO settings demonstrate that our framework predominantly outperforms existing methods in terms of candidate quality and sample efficiency. The code is available at https://github.com/violet-sto/HN-GFN.

For agents

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

get_harvested_code_for_paper("2302.04040")
get_code_for_paper("2302.04040")
have("2302.04040")

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

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

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

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

Connect an agent — have() is free.