Three Approaches to De Novo Molecule Generation
De novo molecule generation is the task of designing novel chemical structures that satisfy a set of desired properties, without starting from an existing compound library. REINVENT4, MolMIM, and DrugEx represent three distinct strategies for this problem: reinforcement learning with customizable scoring, masked language modeling for fast generation, and multi-objective reinforcement learning for balancing competing drug design goals.
Each tool makes different trade-offs between generation speed, chemical quality, and optimization flexibility. Understanding these trade-offs helps you select the right tool for your specific drug design stage, or combine them in a pipeline.
REINVENT4: The Mature RL Workhorse
How It Works
REINVENT4 uses a recurrent neural network (RNN) as a generative prior trained on large SMILES datasets, then fine-tunes it with reinforcement learning against user-defined scoring functions. The agent learns to produce molecules that maximize a composite score built from components like docking scores, QED, synthetic accessibility, and custom property predictors. REINVENT4 supports multiple generation modes: de novo design from scratch, scaffold decoration, linker design, and library enumeration.
Strengths
- Customizability: Over 30 built-in scoring components. Users can define custom scoring functions combining any mix of property predictors, docking scores, and structural filters.
- Maturity: Developed by AstraZeneca with multiple published applications in real pharmaceutical projects. The most widely validated open-source generative chemistry tool.
- Multiple modes: Supports de novo, scaffold hopping, R-group exploration, linker design, and library generation within a single framework.
- Chemical validity: RNN prior trained on ChEMBL produces syntactically valid SMILES at rates above 95 percent.
- Interpretability: Each scoring component contributes a visible sub-score, making it clear why a molecule was ranked high or low.
Limitations
- Slower training loop due to sequential RL optimization (minutes to hours per run)
- SMILES-based generation can produce duplicates and requires deduplication
- Configuration requires defining scoring functions in TOML files, which has a learning curve
- Single-objective optimization by default (weighted sum of components)
MolMIM: Fast Masked Language Model Generation
How It Works
MolMIM, developed by NVIDIA as part of the BioNeMo framework, treats molecular generation as a masked language modeling problem. It trains a transformer on SMILES strings by randomly masking tokens and learning to reconstruct them. During generation, MolMIM can produce novel molecules by sampling from the learned distribution, interpolating between known molecules in latent space, or performing conditional generation given partial structures.
Strengths
- Speed: Transformer inference is highly parallelizable. MolMIM generates thousands of molecules per minute on a single GPU.
- Latent space interpolation: Can smoothly interpolate between two molecules, producing structurally intermediate compounds useful for lead optimization.
- NVIDIA ecosystem: Integrates with BioNeMo, Clara, and other NVIDIA drug discovery tools for end-to-end GPU-accelerated pipelines.
- Representation learning: The learned molecular embeddings are useful for downstream tasks like property prediction and similarity search.
Limitations
- Less control over specific property optimization compared to REINVENT4's scoring components
- Requires NVIDIA GPU infrastructure and BioNeMo framework setup
- Fewer published pharmaceutical validation studies than REINVENT4
- No built-in multi-objective optimization framework
DrugEx: Multi-Objective Reinforcement Learning
How It Works
DrugEx uses a recurrent generator similar to REINVENT4 but adds Pareto-based multi-objective reinforcement learning. Instead of collapsing multiple objectives into a single weighted score, DrugEx maintains a population of molecules on the Pareto front, optimizing for non-dominated solutions across competing objectives simultaneously. This allows it to explore trade-offs between properties like potency, selectivity, solubility, and metabolic stability without requiring the user to specify relative weights.
Strengths
- Multi-objective optimization: Natively handles competing objectives without requiring weight tuning. Produces a Pareto front of solutions showing trade-offs.
- Graph and SMILES support: DrugEx v3 supports both SMILES-based and graph-based molecular representations, enabling structure-aware generation.
- Diverse output: Pareto-based selection naturally promotes chemical diversity in the generated set.
- Academic rigor: Well-documented methodology with published comparisons against single-objective approaches.
Limitations
- Smaller community and fewer production deployments than REINVENT4
- Pareto optimization is computationally more expensive than single-objective RL
- Fewer built-in scoring components; users often need to implement custom objectives
- Less active maintenance compared to REINVENT4 and MolMIM
Architecture Comparison
The three tools differ fundamentally in their generative approach and optimization strategy:
- REINVENT4 (RL + RNN): An RNN prior generates SMILES token by token. A reinforcement learning agent adjusts the prior toward a user-defined scoring function. Training data is primarily ChEMBL. Molecular representation is SMILES strings.
- MolMIM (Masked LM + Transformer): A transformer encoder learns bidirectional molecular representations through masked token prediction. Generation uses sampling and latent space operations. Training data includes large proprietary and public SMILES datasets. Representation is SMILES tokens with learned embeddings.
- DrugEx (Multi-objective RL + RNN/Graph): An RNN or graph neural network generates molecules, optimized with Pareto-based RL across multiple objectives simultaneously. Training data is typically ChEMBL or target-specific datasets. Supports both SMILES and molecular graph representations.
Drug-Likeness and Chemical Quality
A critical factor in generative chemistry is whether the output molecules are actually synthesizable and drug-like, not just valid SMILES strings:
- REINVENT4: Achieves high drug-likeness through explicit scoring components for QED, Lipinski rule of five, synthetic accessibility (SA score), and custom structural filters. Users can enforce hard constraints on molecular weight, logP, and ring count during generation.
- MolMIM: Produces molecules that statistically resemble the training distribution. Drug-likeness depends on training data curation. Post-hoc filtering is typically required for strict ADMET compliance.
- DrugEx: Can optimize drug-likeness as one of its Pareto objectives, but the quality depends on how well the scoring functions are defined. Diversity of the Pareto front means some molecules will be less drug-like by design.
ADMET Integration
Generating novel molecules is only useful if they pass absorption, distribution, metabolism, excretion, and toxicity (ADMET) filters. Each tool handles this differently:
- REINVENT4: ADMET predictors can be integrated directly into the scoring function, steering generation toward ADMET-compliant molecules during training.
- MolMIM: ADMET filtering is typically applied as a post-generation step. NVIDIA's BioNeMo suite includes separate ADMET prediction models that can be chained with MolMIM.
- DrugEx: ADMET properties can be added as additional Pareto objectives, allowing the optimizer to balance ADMET compliance against potency and other goals.
Code Examples: Molecule Generation via SciRouter
SciRouter exposes REINVENT4 through a clean API with integrated ADMET filtering. Here is how to generate and filter molecules in a single call:
import requests, time
API_KEY = "sk-sci-your-api-key"
BASE = "https://api.scirouter.ai/v1"
headers = {"Authorization": f"Bearer {API_KEY}"}
# Generate novel molecules targeting a specific scaffold
job = requests.post(f"{BASE}/generate/molecules", headers=headers, json={
"model": "reinvent4",
"mode": "de_novo",
"num_molecules": 100,
"scoring": {
"qed_weight": 0.3,
"sa_score_weight": 0.3,
"custom_alerts": ["PAINS"] # Filter out PAINS compounds
}
}).json()
# Poll for results
while (r := requests.get(f"{BASE}/generate/molecules/{job['job_id']}",
headers=headers).json())["status"] != "completed":
time.sleep(5)
for mol in r["molecules"][:5]:
print(f"SMILES: {mol['smiles']}")
print(f"QED: {mol['qed']:.3f}, SA: {mol['sa_score']:.2f}")
print()# Use the Molecular Design Lab for generation + ADMET in one call
job = requests.post(f"{BASE}/labs/moldesign/generate", headers=headers, json={
"target_smiles": "c1ccc2c(c1)cc1ccccc12", # Seed scaffold
"num_candidates": 50,
"constraints": {
"molecular_weight": {"min": 200, "max": 500},
"logp": {"min": -1, "max": 5},
"hbd": {"max": 5},
"hba": {"max": 10}
},
"admet_filters": {
"solubility": "moderate",
"cyp_inhibition": False,
"herg_safe": True
}
}).json()
while (r := requests.get(f"{BASE}/labs/moldesign/generate/{job['job_id']}",
headers=headers).json())["status"] != "completed":
time.sleep(10)
# Results are pre-ranked and ADMET-filtered
for candidate in r["candidates"][:3]:
print(f"SMILES: {candidate['smiles']}")
print(f"Score: {candidate['composite_score']:.3f}")
print(f"ADMET pass: {candidate['admet_pass']}")
print()Which Tool Should You Choose?
Choose REINVENT4 when you need maximum control over scoring functions, are working on lead optimization with scaffold constraints, or require a battle-tested tool with pharmaceutical validation. REINVENT4 is the strongest choice for most drug discovery teams.
Choose MolMIM when speed is your priority, you need to generate large libraries quickly for downstream screening, or you are already embedded in the NVIDIA BioNeMo ecosystem. MolMIM is well suited for early-stage exploration where volume matters more than targeted optimization.
Choose DrugEx when you have genuinely competing objectives that cannot be reduced to a single weighted score. If you need to explore the trade-off frontier between potency and selectivity, or between efficacy and safety, DrugEx's Pareto approach is purpose-built for that problem.
For a deeper walkthrough of generative drug design concepts, read our de novo drug design guide. To explore REINVENT4 capabilities and pricing, visit the Molecule Generator tool page.
REINVENT4 is available on SciRouter with a single API key. Sign up for free to get 500 credits and start generating drug candidates today. No GPU setup, no TOML configuration files, and ADMET filtering is built in.