MolMem: Memory-Augmented Agentic Reinforcement Learning for Sample-Efficient Molecular Optimization

Ziqing Wang, Yibo Wen, Abhishek Pandey, Han Liu, Kaize Ding

TL;DR

MolMem is a new reinforcement learning framework that brings "long-term memory" to molecular optimization, allowing AI agents to learn from their own successes just like human chemists. By distilling successful molecular edits into a reusable "skill bank," MolMem achieves a 90% success rate on optimization tasks using only 500 expensive evaluations—outperforming existing methods by up to 1.5× while using significantly smaller models.

What Problem Does This Paper Address?

In drug discovery, "molecular optimization" is the process of taking a promising "lead" compound and tweaking its structure to improve properties like solubility or binding affinity, all while ensuring the molecule doesn't change so much that it loses its original purpose.

The bottleneck is the oracle budget. Evaluating a molecule's properties requires expensive simulations or slow wet-lab experiments (the "oracle"). Current AI methods fall into two frustrating camps:

  1. Novices: These use trial-and-error (like genetic algorithms). They eventually find good molecules but waste thousands of oracle calls getting there.
  2. Apprentices: These imitate existing datasets or templates. They start fast but get stuck if the solution requires a creative edit not found in their training data.

The authors identify a missing piece: long-term memory. Human experts don't just guess; they remember what worked in past projects and turn those successes into general strategies.

The evolution of molecular optimization paradigms from trial-and-error "Novices" to memory-augmented "Experts."

Methods

MolMem (Molecular optimization with Memory) implements a multi-turn agentic Reinforcement Learning (RL) framework. Instead of proposing a molecule in one shot, the agent interacts with the environment over several steps, receiving feedback at each turn.

The core innovation is a dual-memory system:

  • Static Exemplar Memory: A library of 2.8 million molecules from the ChEMBL database. When the agent gets stuck, it retrieves structurally similar, high-scoring molecules to provide a "cold-start" hint.
  • Evolving Skill Memory: This is the agent's "personal notebook." After a successful optimization run, the system analyzes the trajectory, identifies the specific structural changes that led to a reward jump, and uses an LLM (GPT-4o) to summarize that edit into a natural language strategy (e.g., "Replace methoxy with fluorine on the aromatic ring to improve QED").
Overview of the MolMem framework, showing how Static and Evolving memories feed into the agent's working memory during optimization.

The agent (a compact 1.5B parameter Qwen model) is trained in two stages: first, supervised fine-tuning to learn the "grammar" of molecules (SMILES strings), followed by Proximal Policy Optimization (PPO) with dense step-wise rewards. This ensures the agent learns which specific edit in a sequence was responsible for the improvement.

The mechanism for distilling successful trajectories into natural language skills and retrieving them via fingerprint similarity.

Datasets

  • ChEMBL: Used to construct the Static Exemplar Memory (2.8M molecules).
  • ZINC-250k: 200 lead molecules were sampled from this dataset for the evaluation tasks.
  • Chen et al. (2021) Molecule-Pair Dataset: Used for the initial supervised fine-tuning (SFT) stage.

Key Insights and Ideas

  • Memory over Model Size: MolMem uses a tiny 1.5B parameter backbone but outperforms 7B and 8B parameter models. This suggests that for specialized domains like chemistry, how a model accesses and updates knowledge is more important than the raw number of parameters.
  • Plateau-Triggered Retrieval: The agent doesn't look at its "notes" (memory) every step. It only queries memory when progress stalls. This encourages independent exploration while providing a safety net for difficult tasks.
  • Natural Language as a Bridge: By converting complex chemical transformations into simple English sentences, the system creates a "skill bank" that is human-interpretable and easily injected back into the LLM's context window.
  • Self-Evolution: The Evolving Skill Memory allows the agent to improve across different optimization runs, effectively learning a customized "playbook" for specific chemical objectives.

Key Results

MolMem was tested on five single-property and five multi-property optimization tasks with a strict budget of 500 oracle calls:

  • Single-Property Success: Achieved a 90% success rate on average, a 1.5× improvement over the best baseline. On the plogP task, it reached a perfect 100% success rate.
  • Multi-Property Success: On complex tasks requiring the simultaneous optimization of three properties, MolMem achieved a 52% success rate, whereas most baselines struggled to break 10-20%.
  • Bioactivity Targets: The gains were most pronounced on difficult bioactivity targets (like DRD2 and JNK3), where navigating the relationship between structure and activity is notoriously hard.

Limitations and Future Work

  • Computational Oracles: The study uses software-based property predictors as oracles. While standard in the field, these are proxies for real-world wet-lab results, which may be noisier and more complex.
  • Summarization Cost: The process of turning structural edits into natural language skills currently relies on an external LLM (GPT-4o), which adds API costs. The authors suggest integrating this summarization directly into the RL training loop in the future.
  • End-to-End Learning: Currently, the skill distillation happens after training iterations. A more seamless, real-time memory update mechanism could further improve efficiency.

Summary updated

BibTeX
@inproceedings{wang2026molmem,
  author = {Ziqing Wang and Yibo Wen and Abhishek Pandey and Han Liu and Kaize Ding},
  title = {{MolMem: Memory-Augmented Agentic Reinforcement Learning for Sample-Efficient Molecular Optimization}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.acl-long.2024},
}
Figure