SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.04115 · ICML · 2022

Biological Sequence Design with GFlowNets

Yoshua Bengio, Dinghuai Zhang, Moksh Jain, Bonaventure Dossou, Payel Das, Jie Fu, Emmanuel Bengio, Tianyu Zhang, Alex-Hernandez Garcia, Jarrid Rector-Brooks, Chanakya Ekbote, Michael Kilgour, and 1 more

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 (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-22; 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/2203.04115.json · badge: /api/ran/2203.04115.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
mj10/bioseq-gfn-al canonical (classifier label)
classifier basis: classifier_2025
4 ran · 3 no recorded run
FunctionStatusWhere it lives
FMGFlowNetGenerator Ran
ran on a synthesized input · constructed an object; no result was computed
mj10/bioseq-gfn-al/lib/generator/gfn.py
code served (permissive licence) · get_code("982fd8c1bc8287aa")
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, FMGFlowNetGenerator: 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

torch.manual_seed(0)

class SimpleTokenizer:
    def __init__(self):
        pass
    
    def process(self, tokens):
        # tokens is a list, convert to tensor
        if isinstance(tokens, list):
            return torch.tensor(tokens, dtype=torch.long)
        return tokens

class SimpleArgs:
    def __init__(self):
        self.gen_leaf_coef = 1.0
        self.gen_output_coef = 1.0
        self.gen_loss_eps = 1e-8
        self.vocab_size = 21
        self.gen_max_len = 10
        self.gen_model_type = 'mlp'
        self.gen_num_hidden = 16
        self.gen_partition_init = 150.0
        self.gen_do_explicit_Z = False
        self.device = torch.device('cpu')
        self.gen_learning_rate = 1e-3
        self.gen_L2 = 1e-5
        self.gen_clip = 1.0
        self.gen_balanced_loss = 0
        self.task = 'tfbind'

tokenizer = SimpleTokenizer()
args = SimpleArgs()

ARGS = {
    'args': args,
    'tokenizer': tokenizer
}
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 FMGFlowNetGenerator — 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 FMGFlowNetGenerator 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
GeneratorBase Ran
ran on a synthesized input · constructed an object; no result was computed
mj10/bioseq-gfn-al/lib/generator/gfn.py
code served (permissive licence) · get_code("690ecad4c3558658")
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, GeneratorBase: 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

torch.manual_seed(0)

class SimpleArgs:
    """Stand-in class for args parameter"""
    def __init__(self):
        self.hidden_dim = 64
        self.learning_rate = 0.001
        self.batch_size = 2
        self.num_epochs = 10

ARGS = {
    "args": SimpleArgs()
}
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 GeneratorBase — 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 GeneratorBase 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
MLP Ran
ran on a synthesized input · constructed an object; no result was computed
mj10/bioseq-gfn-al/lib/generator/gfn.py
code served (permissive licence) · get_code("3f794953e6f4df1a")
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, MLP: 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

torch.manual_seed(0)

# Define the arguments for MLP.__init__
ARGS = {
    'num_tokens': 5,
    'num_outputs': 3,
    'num_hid': 8,
    'num_layers': 2,
    'max_len': 4,
    'dropout': 0.1,
    '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 — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MLP — 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 MLP 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
filter_len Ran
ran; our contract draft was wrong, not the code
mj10/bioseq-gfn-al/run_amp.py
code served (permissive licence) · get_code("a0962a1a5631fcc1")
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) 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

torch.manual_seed(0)

# Analyze the function:
# - x: iterable of items where len(x[i]) is called
# - y: iterable of items (paired with x)
# - max_len: integer threshold
# The function filters pairs where len(x[i]) < max_len

# Create x as a list of sequences with different lengths
x = [
    [1, 2, 3],           # len = 3, < 5, included
    [1, 2, 3, 4, 5, 6],  # len = 6, >= 5, excluded
    [1, 2],              # len = 2, < 5, included
]

# Create y as a list of corresponding labels/values
y = ["label_0", "label_1", "label_2"]

# max_len threshold
max_len = 5

ARGS = {
    "x": x,
    "y": y,
    "max_len": max_len,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
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_generator Not yet run
unverified (harvested, no recorded run)
mj10/bioseq-gfn-al/run_amp.py
code served (permissive licence) · get_code("c86a415a1e59ead4")
How it ran

no invocation recorded.

train_generator Not yet run
unverified (harvested, no recorded run)
mj10/bioseq-gfn-al/run_gfp.py
code served (permissive licence) · get_code("b59d7eff5b869917")
How it ran

no invocation recorded.

train_generator Not yet run
unverified (harvested, no recorded run)
mj10/bioseq-gfn-al/run_tfbind.py
code served (permissive licence) · get_code("ca5a7a447c10afc0")
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, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
filter_len 3 other papers
3 later
2302.09465 (2023-02)
Stochastic Generative Flow Networks
2410.04461 (2024-10)
Improved Off-policy Reinforcement Learning in Biological Sequence Design
2605.26690 (2026-05)
Self-Improvement Imitation with Biologically Guided Search for Protein Design Under Oracle Budgets

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

Design of de novo biological sequences with desired properties, like protein and DNA sequences, often involves an active loop with several rounds of molecule ideation and expensive wet-lab evaluations. These experiments can consist of multiple stages, with increasing levels of precision and cost of evaluation, where candidates are filtered. This makes the diversity of proposed candidates a key consideration in the ideation phase. In this work, we propose an active learning algorithm leveraging epistemic uncertainty estimation and the recently proposed GFlowNets as a generator of diverse candidate solutions, with the objective to obtain a diverse batch of useful (as defined by some utility function, for example, the predicted anti-microbial activity of a peptide) and informative candidates after each round. We also propose a scheme to incorporate existing labeled datasets of candidates, in addition to a reward function, to speed up learning in GFlowNets. We present empirical results on several biological sequence design tasks, and we find that our method generates more diverse and novel batches with high scoring candidates compared to existing approaches. Feedback on Proposed Candidates Set of Proposed Candidates

For agents

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

get_harvested_code_for_paper("2203.04115")
get_code_for_paper("2203.04115")
have("2203.04115")

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

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

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

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

Connect an agent — have() is free.