Skip to main content
    Drug Discovery

    10 min read

    GenMol vs REINVENT 4: Discrete Diffusion vs RL Molecule Generation

    Fragment-native sampling vs a scored optimization loop, and which one fits de novo design, scaffold decoration and linker design

    Ivy Biosciences

    · updated

    how this was written

    an AI agent, from a research brief and primary literature. reviewed and edited by the ivy biosciences team before publishing.

    Reach for GenMol when the constraint is structural — a scaffold to decorate, two fragments to link, a motif to extend — and for REINVENT 4 when the constraint is a numeric objective you want a model to optimize against over many rounds. GenMol generates molecules as sequences of fragments using masked discrete diffusion, so substructure constraints are expressed in the representation itself rather than bolted onto a decoder. REINVENT 4 generates SMILES from an RNN or transformer prior and then reshapes that prior with reinforcement learning, transfer learning and curriculum stages against a scoring function you define. Neither is a screening tool: both produce candidate structures that still have to be filtered, docked and costed for synthesis. If you want the wider map of open tools first, see open-source computational drug discovery tools; for what happens to generated molecules downstream, see in silico ADMET vs in vivo.

    The two methods, side by side#

    GenMolREINVENT 4
    RepresentationSAFE: molecules as an unordered sequence of fragment blocksSMILES strings
    Generative modelMasked discrete diffusion, non-autoregressive bidirectional parallel decodingRNN and transformer priors, generated left to right
    How you steer itMasking: fix the fragments you want kept, regenerate the restA scoring function, optimized by reinforcement learning with curriculum stages
    Built-in modesDe novo, scaffold decoration, linker design, motif extension, lead optimizationDe novo design, R-group replacement, library design, linker design, scaffold hopping, molecule optimization
    Multi-objective designNot intrinsic: score the output in a separate stepIntrinsic: weighted scoring components inside the loop
    Interface upstreamNVIDIA model, GitHubCommand-line tool reading TOML or JSON config, Apache 2.0, GitHub
    On .bloom*genmol_generate, the preferred generator — docsreinvent4_generate, soft-deprecated — docs

    How GenMol works: fragments as the unit of generation#

    The interesting choice in GenMol is not the diffusion, it is what the diffusion operates on. GenMol generates SAFE sequences — Sequential Attachment-based Fragment Embedding, a line notation introduced by Noutahi et al. that rewrites a SMILES string as an unordered sequence of interconnected fragment blocks while staying parseable by ordinary SMILES parsers (Digital Discovery 2024). Because the fragments are blocks rather than characters, tasks like scaffold decoration, fragment linking and scaffold hopping become ordinary sequence-completion problems instead of special decoding procedures. The SAFE authors demonstrated the representation by training an 87-million-parameter GPT2-like model on a dataset of 1.1 billion SAFE representations.

    GenMol builds on that representation with a single masked discrete diffusion model rather than an autoregressive one. Per the GenMol paper, it decodes SAFE sequences through non-autoregressive bidirectional parallel decoding, so the model can use molecular context that does not depend on token ordering; it introduces fragment remasking, which optimizes a molecule by masking and regenerating chosen fragments; and it adds molecular context guidance, a guidance method tailored to its masked diffusion (Lee et al., arXiv:2501.06158). The authors report that GenMol significantly outperforms the previous GPT-based model on de novo and fragment-constrained generation, and reaches state-of-the-art performance on goal-directed hit generation and lead optimization.

    Fragment remasking is the part worth internalizing, because it explains the fit. "Keep this hinge binder, regenerate the solvent-exposed arm" is a masking pattern. You do not need a reward signal to express it.

    How REINVENT 4 works: a prior plus an optimization loop#

    REINVENT 4 is AstraZeneca's open-source generative framework, published in the Journal of Cheminformatics in 2024. Its design is explicitly two-part: recurrent neural network and transformer architectures drive molecule generation, and those generators are embedded within general machine learning optimization algorithms — transfer learning, reinforcement learning and curriculum learning (Loeffler et al., 2024). The framework covers de novo design, R-group replacement, library design, linker design, scaffold hopping and molecule optimization, and it runs as a command-line tool that reads a user configuration in TOML or JSON. It is released under Apache 2.0.

    The optimization loop is the product. A scoring function made of weighted components — a QED term, a Tanimoto similarity to a reference, physicochemical filters, SMARTS blocklists, a custom Python scorer — defines the target profile, and the RL loop samples, scores and updates the agent so that high-scoring structures become more likely. Curriculum stages let you warm up on an easy objective before switching to the real one, and diversity filters such as penalizing repeated Murcko scaffolds are there because the failure mode of a well-rewarded agent is collapsing onto one scaffold. Our scoring functions and RL loops and curriculum pages walk through the config.

    This is a genuinely different shape of control from masking. You are not saying which atoms to keep; you are saying what "better" means and paying compute until the model believes it.

    Which tasks suit which method#

    Pick GenMol for structural constraints. Scaffold decoration, linker design between two fragments, and motif extension all reduce to "hold these blocks fixed, generate the rest" — which is exactly what SAFE plus masking expresses natively. Lead optimization around a starting molecule under a similarity constraint is the same shape: fragment remasking regenerates part of a known compound rather than sampling a new one from scratch. Unconstrained de novo generation also works, and is the default.

    Pick REINVENT 4 for a numeric objective over many rounds. If the question is "give me molecules that are simultaneously drug-like, similar to this reference, free of these alerts, and predicted active", you want a loop that scores and reweights, not a sampler you post-filter. The same applies when you need the surrounding machinery: transfer learning onto a focused dataset, diversity filters, curriculum stages, or a reproducible config you can commit to a repository.

    Neither is the right answer when the real task is enumeration. If you want analogues of a known compound by matched-molecular-pair logic or scaffold replacement rules, a cheminformatics approach gets there faster and more interpretably — see the RDKit tooling. Generative models earn their cost when you want structures the rules would not propose.

    What GuacaMol and MOSES do and do not tell you#

    Both tools get compared on two standard suites, and it is worth knowing what each one measures.

    GuacaMol (Brown et al., Journal of Chemical Information and Modeling 2019) splits evaluation into distribution-learning benchmarks — validity, uniqueness, novelty, how well the generated set matches ChEMBL's property distributions — and goal-directed benchmarks, where a model must optimize toward specified objectives (doi:10.1021/acs.jcim.8b00839).

    MOSES (Polykovskiy et al.) standardizes the training and test datasets and the metric set so that models are compared on the same footing rather than on each author's own split (arXiv:1811.12823).

    The caveat that matters for a project decision: these suites measure properties of the generated distribution and performance against computational objectives. A high score on a goal-directed benchmark means the model optimized a cheap oracle well. It is not evidence that the molecules are synthesizable, selective, or active in an assay. Treat benchmark rankings as a reason to try a model, never as a substitute for running your own filters on your own series.

    Limitations to plan around#

    • Validity is a setting, not a constant. On .bloom*, GenMol's default generation_priority="quality" uses BRICS fragment slicing and produces around 95% chemically valid outputs; switching to "novelty" uses HR slicing for more diverse structures at roughly 75–85% validity. Expect to generate more than you need and deduplicate.
    • A valid molecule is not a makeable molecule. Chemical validity is a parser check. Route feasibility is a separate question, and the honest way to answer it is to run retrosynthesis on the output — see AiZynthFinder.
    • Fragments must be fragments. GenMol's constrained modes take small substructures with attachment points, not complete drug molecules. Decompose first, then pass the pieces; the backend rejects whole molecules supplied as fragments.
    • An RL run can converge on one scaffold. Reward hacking in generative chemistry looks like a thousand near-identical molecules with excellent scores. Diversity filters exist for this and should be on by default.
    • Scoring components inherit their own error bars. A REINVENT objective built on predicted properties optimizes the predictor, not the property. If a component model is weak on your chemotype, the loop will exploit that weakness.
    • reinvent4_generate is soft-deprecated on .bloom*. It still runs, and we have kept it rather than removing it, but GenMol is the default generator. Reach for REINVENT by name when you specifically want its RL features.

    How to run both on .bloom*#

    Both generators run as GPU jobs and both need you to be signed in. Ask for what you want in plain language and the platform routes it; the Generative and de novo overview lists the whole domain.

    GenMol (genmol_generate) takes a run type, a molecule count from 1 to 10,000, a sampling temperature, and — for the constrained modes — an array of fragment SMILES. Its modes are de novo, scaffold decoration, linker design, motif extension and lead optimization, the last of which takes a starting molecule plus a minimum Tanimoto similarity. It returns a CSV of SMILES with computed properties alongside a JSON results file, so the output drops straight into a downstream tool. Note that scoring against an objective is an explicit next step here, not a loop inside the job: generate, then score. Start with the GenMol quickstart and inputs.

    REINVENT 4 (reinvent4_generate) runs sampling, sampling-with-scoring, or scoring of molecules you supply, across the reinvent, libinvent, linkinvent, mol2mol and pepinvent generators. It returns a CSV of SMILES with the model's negative log-likelihood per molecule. Multi-stage transfer learning and staged RL campaigns are configured through the dedicated REINVENT form rather than a single chat request — the datasets and outputs pages cover setup and what comes back.

    The chain after either one matters more than the choice between them. A useful default: generate, filter for drug-likeness and structural alerts with RDKit, screen the survivors with ADMET-AI, then run retrosynthesis on whatever is left to see which candidates have a route. The filter compounds for drug-likeness and hit to lead recipes are runnable versions of that pass. Reporting the attrition at each stage is the honest measure of a generative run — not the number of molecules it produced.

    Generate, filter and cost a route for your own series on the .bloom* platform.

    References#

    1. Lee, S. et al. "GenMol: A Drug Discovery Generalist with Discrete Diffusion." (2025). arXiv:2501.06158 · GitHub
    2. Loeffler, H. H., He, J., Tibo, A., Janet, J. P., Voronov, A., Mervin, L. H. & Engkvist, O. "Reinvent 4: Modern AI-driven generative molecule design." Journal of Cheminformatics 16, 20 (2024). doi:10.1186/s13321-024-00812-5 · GitHub
    3. Noutahi, E., Gabellini, C., Craig, M., Lim, J. S. C. & Tossou, P. "Gotta be SAFE: a new framework for molecular design." Digital Discovery 3, 796–804 (2024). doi:10.1039/D4DD00019F · arXiv:2310.10773 · GitHub
    4. Brown, N., Fiscato, M., Segler, M. H. S. & Vaucher, A. C. "GuacaMol: Benchmarking Models for de Novo Molecular Design." Journal of Chemical Information and Modeling 59, 1096–1108 (2019). doi:10.1021/acs.jcim.8b00839 · GitHub
    5. Polykovskiy, D. et al. "Molecular Sets (MOSES): A Benchmarking Platform for Molecular Generation Models." (2018). arXiv:1811.12823 · GitHub

    Frequently asked

    Should I use GenMol or REINVENT 4 for molecule generation?

    Match the tool to the shape of the constraint. GenMol fits structural constraints — a scaffold to decorate, two fragments to link, a motif to extend — because it generates molecules as sequences of SAFE fragment blocks, so you fix the fragments you want kept and regenerate the rest by masking. REINVENT 4 fits a numeric objective pursued over many rounds: it generates SMILES from an RNN or transformer prior and reshapes that prior with reinforcement learning, transfer learning and curriculum stages against a scoring function you define. On .bloom*, GenMol is the preferred generator and reinvent4_generate is soft-deprecated, though it still runs.

    Does GenMol optimize molecules against a scoring function?

    Not inside the job. GenMol samples molecules under structural constraints and returns a CSV of SMILES with computed properties alongside a JSON results file; scoring against an objective is an explicit next step, not a loop around the generator. Multi-objective design is intrinsic to REINVENT 4 instead, where weighted scoring components sit inside a reinforcement-learning loop that samples, scores and updates the agent. If you want molecules that are simultaneously drug-like, similar to a reference, free of given alerts and predicted active, that loop is the right shape; if the constraint is which fragments to keep, masking expresses it with no reward signal at all.

    How many GenMol outputs are chemically valid?

    It depends on the sampling setting. The default generation_priority of quality uses BRICS fragment slicing and produces around 95% chemically valid outputs, while switching to novelty uses HR slicing for more diverse structures at roughly 75 to 85% validity, so plan to generate more than you need and deduplicate. Validity is also a weaker claim than it sounds: chemical validity is a parser check, not evidence that a molecule can be made. Route feasibility is a separate question, and the honest way to answer it is to run retrosynthesis on the output.

    What do GuacaMol and MOSES benchmark scores actually tell you?

    They describe the generated distribution and performance against computational objectives, not behaviour in an experiment. GuacaMol splits evaluation into distribution-learning benchmarks — validity, uniqueness, novelty, and how well the generated set matches ChEMBL's property distributions — and goal-directed benchmarks, where a model must optimize toward specified objectives. MOSES standardizes the training and test datasets and the metric set so models are compared on the same footing rather than on each author's own split. A high goal-directed score means the model optimized a cheap oracle well; it is not evidence that the molecules are synthesizable, selective or active in an assay.

    Can I pass a whole drug molecule as a fragment input to GenMol?

    No. The constrained modes — scaffold decoration, linker design and motif extension — take small substructures with attachment points rather than complete drug molecules, and the backend rejects whole molecules supplied as fragments. Decompose the compound first and pass the pieces. The one mode that does take a complete starting molecule is lead optimization, which also takes a minimum Tanimoto similarity. Besides the fragment array, the job takes a run type, a molecule count from 1 to 10,000 and a sampling temperature.


    tags

    • generative chemistry
    • GenMol
    • REINVENT 4
    • de novo design
    • molecular design

    about the author

    Ivy Biosciences

    The Ivy Biosciences team builds AI tools for computational drug discovery.

    Loading...