[Paper Review] TSSR: Two-Stage Swap-Reward-Driven Reinforcement Learning for Character-Level SMILES Generation
The paper introduces TSSR, a two-stage reinforcement learning framework that first repairs syntactic errors via local token swaps and then improves chemical plausibility using RDKit diagnostics for character-level SMILES generation. It demonstrates improved validity and novelty on MOSES under both training-from-scratch and fine-tuning regimes.
The design of reliable, valid, and diverse molecules is fundamental to modern drug discovery, as improved molecular generation supports efficient exploration of the chemical space for potential drug candidates and reduces the cost of early design efforts. Despite these needs, current chemical language models that generate molecules as SMILES strings are vulnerable to compounding token errors: many samples are unparseable or chemically implausible, and hard constraints meant to prevent failure can restrict exploration. To address this gap, we introduce TSSR, a Two-Stage, Swap-Reward-driven reinforcement learning (RL) framework for character-level SMILES generation. Stage one rewards local token swaps that repair syntax, promoting transitions from invalid to parseable strings. Stage two provides chemistry-aware feedback from RDKit diagnostics, rewarding reductions in valence, aromaticity, and connectivity issues. The reward decomposes into interpretable terms (swap efficiency, error reduction, distance to validity), is model agnostic, and requires no task-specific labels or hand-crafted grammars. We evaluated TSSR on the MOSES benchmark using a GRU policy trained with PPO in both pure RL (P-RL) from random initialization and fine-tuning RL (F-RL) starting from a pretrained chemical language model, assessing 10,000 generated SMILES per run. In P-RL, TSSR significantly improves syntactic validity, chemical validity, and novelty. In F-RL, TSSR preserves drug-likeness and synthesizability while increasing validity and novelty. Token-level analysis shows that syntax edits and chemistry fixes act jointly to reduce RDKit detected errors. TSSR converts a sparse terminal objective into a denser and more interpretable reward, improving both syntactic and chemical quality without reducing diversity. TSSR is dataset-agnostic and can be adapted to various reinforcement learning approaches.
Motivation & Objective
- Motivate reliable, valid, and diverse de novo molecular generation via SMILES
- Provide dense, interpretable feedback to guide token-level SMILES generation
- Develop a model- and dataset-agnostic RL framework applicable from scratch or via fine-tuning
- Demonstrate improvements in syntactic/chemical validity and novelty on the MOSES benchmark
- Showcase the approach's compatibility with standard RL methods without hand-crafted grammars
Proposed method
- Propose a two-stage reward: Stage One rewards local token swaps that repair syntax to yield parseable SMILES
- Stage Two rewards reductions in RDKit-detected chemical issues after syntax repair
- Use a model-agnostic reward decomposition including swap efficiency, error reduction, and distance-to-validity
- Employ a GRU-based chemical language model trained with PPO in two regimes: P-RL (random init) and F-RL (pretrained model)
- Operate on MOSES data with token priors derived from global token frequencies and standard SMILES vocabulary
- Provide token-level analysis and publicly report swap counts, fix rates, and chemical error reductions to interpret learning dynamics

Experimental results
Research questions
- RQ1Can a two-stage swap-reward RL framework improve syntactic validity of character-level SMILES generation?
- RQ2Does Stage Two chemistry-aware feedback reduce RDKit-detected errors after Stage One repairs?
- RQ3Are validity and novelty enhanced for models trained from scratch and for pretrained models when optimized with TSSR?
- RQ4What is the impact of TSSR on drug-likeness, synthesizability, diversity, and scaffold diversity in generated molecules?
- RQ5Is the approach dataset- and model-agnostic and compatible with standard RL pipelines like PPO?
Key findings
- TSSR substantially improves syntactic validity in P-RL and increases chemical validity and novelty compared with the untrained baseline
- In P-RL, syntactic validity rose from 6.14% to 35.03% and chemical validity from 4.77% to 9.61% on MOSES, with notable novelty gains
- In F-RL, validity increased modestly (average 0.83%) while maintaining high novelty (~99.6%), and overall chemical validity rose (to 19.20%)
- Stage One swaps and Stage Two fixes work in concert, with syntax repairs enabling chemical corrections that reduce RDKit-detected errors
- TSSR returns a denser, interpretable reward signal that improves both syntactic and chemical quality without sacrificing diversity
- P-RL shows higher peak reward and learning efficiency, while F-RL benefits from pretrained priors with higher throughput but slightly smaller validity gains

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.