๐Ÿงฌ ChemMiniQ3-SAbRL (Synthetic Accessibility with Bioaware RL)

ChemMiniQ3-SARL is a lightweight experimental generative model for chemistry, built on mini Qwen2-like backbone with multi-horizon predictive loss for SELFIES molecular representations.
It introduces a new reinforcement learning approach as next iteration of ChemMiniQ3-HoriFIE that combines:

  • ๐Ÿงฉ Synthetic Accessibility (SA) Rewards โ€” guiding generation with a classifier (gbyuvd/synthaccess-chemselfies) to favor molecules that are easier to synthesize.
  • ๐Ÿ”„ Cyclical Gradual Generation โ€” a curriculum learning strategy that gradually increases molecule length up to 30 tokens, then resets and repeats, ensuring exploration of short and long structures in balance.

Disclaimer: For Academic Purposes Only

The information and model provided is for academic purposes only. It is intended for educational and research use, and should not be used for any commercial or legal purposes. The author do not guarantee the accuracy, completeness, or reliability of the information. Prototype research code โ€” not production-ready. Learning by building.


โš™๏ธ Core Features

  • โœ… Qwen2-like Mini Backbone โ€“ Efficient causal LM architecture
  • โœ… Multi-Token Prediction (MTP Head) โ€“ Parallel prediction of 1โ€“3 future tokens
  • โœ… Horizon Loss โ€“ Weighted multi-horizon objectives for long-term coherence
  • โœ… SELFIES-native Tokenizer โ€“ Robust encoding with FastChemTokenizer
  • โœ… Ranger21 Optimizer โ€“ Warmup/warmdown scheduling for stable training
  • โœ… Gradient Checkpointing & Streaming Dataset Loader โ€“ Lightweight hardware-friendly

๐Ÿงช Reinforcement Learning Enhancements

1๏ธโƒฃ SA-Guided PPO-KL Fine-Tuning

  • Uses gbyuvd/synthaccess-chemselfies as a reward model
  • Rewards โ€œEasyโ€ synthetic accessibility predictions
  • Penalizes โ€œHardโ€ molecules
  • Can operate in SA-only mode or be mixed with ChemQ3 multi-property rewards

2๏ธโƒฃ Cyclical Gradual Curriculum

  • Gradually increases max generation length: 10 โ†’ 15 โ†’ 20 โ†’ 25 โ†’ 30 tokens
  • After reaching 30, it resets back to 10 and repeats the cycle
  • Ensures diversity of molecule sizes while still converging toward more complex structures
  • Why 30s? because FastChemTokenizerSelfies' core average tokens/sentence is 33.41 ยฑ 1.80 tokens on ~3M dataset

๐Ÿš€ Why ChemMiniQ3-SARL?

  • Prior approaches optimized only validity or physicochemical rules (Lipinski, etc.)
  • Our method explicitly biases generation toward molecules that are not just valid, but also easier to synthesize
  • The cyclical gradual generation keeps training dynamic, avoiding overfitting to a single molecule size or complexity

๐Ÿ’ก Target domain: molecular generation (SELFIES).
๐Ÿ”ฌ Goal: molecules that are valid, bioaware, and synthetically accessible.
๐Ÿš€ New approach: combining SA-guided rewards + cyclical gradual curriculum for reinforcement learning.


๐Ÿ”ฎ Planned Experiments & Next Steps

We are actively working on scaling up ChemMiniQ3-SARL with more ambitious experiments:

  • ๐Ÿ“š Pretraining on a larger dataset โ€“ up to 2.9M SELFIES molecules
  • โฑ Finetuning with extended training steps โ€“ to push stability and reward alignment further
  • ๐Ÿ”ฌ Comparative evaluation โ€“ SA-only vs ChemQ3 vs Mix reward modes
  • ๐Ÿงช Benchmarking โ€“ evaluating validity, novelty, drug-likeness, and synthetic accessibility metrics

โค๏ธ Support the Project

Training and scaling require significant computational resources.
If youโ€™d like to support this research (e.g., helping us rent compute servers for pretraining and finetuning), you can contribute here:

ko-fi

Every bit of support helps us push ChemMiniQ3-SARL further! ๐Ÿš€๐Ÿงฌ


To-Do

  • [ongoing] Review, clean, and test train with existing codes
  • Warm up training on 14K dataset for MTP
  • Warm up PPO-RL with only Bioaware set on for 7000 steps
  • [ongoing] Warm up PPO-RL with only SA set on for 7000 steps
  • [ongoing] Test and observe the stability of Mixed Rewards for 7000 steps
  • Upload both warm-up MTP and PPO-RL models to HF repo
  • Write demo blocks and demo JupyterNotebook on training from scratch and how to generate using pretrained model(s)
  • Ablation studies
  • Implement HF Automodel compatible modules if performance benefit(s) confirmed
  • Complete pretraining on all ~3M dataset (when possible)
    • Chunk I
    • Chunk II
    • Chunk III
    • Chunk IV
  • Publish complete pretraining on GitHub and HF (if compatible)
  • Complete RL fine-tuning on verified rewards system.

๐Ÿ“ Notes & Observations

  • During cyclical gradual training, the model seems to stop generating separated salt molecules + ions on seq_len < 30 at around step ~4000.
    • This corresponds to ~57 steps for each sequence length in the gradual schedule.
    • Suggests that the curriculum is helping the model bias toward more coherent, non-fragmented molecular outputs.
  • Current state before SA-finetuning, using 100 samples generation

image

  • After 1000-steps of SA-only RL fine-tuning on the bioaware fine-tuned model using ChemFIE-SA

image


References

BibTeX

Qwen2

@misc{yang2024qwen2technicalreport,
      title={Qwen2 Technical Report}, 
      author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jianxin Yang and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Xuejing Liu and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhifang Guo and Zhihao Fan},
      year={2024},
      eprint={2407.10671},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2407.10671}, 
}

COCONUTDB

@article{sorokina2021coconut,
  title={COCONUT online: Collection of Open Natural Products database},
  author={Sorokina, Maria and Merseburger, Peter and Rajan, Kohulan and Yirik, Mehmet Aziz and Steinbeck, Christoph},
  journal={Journal of Cheminformatics},
  volume={13},
  number={1},
  pages={2},
  year={2021},
  doi={10.1186/s13321-020-00478-9}
}

ChemBL34

@article{zdrazil2023chembl,
  title={The ChEMBL Database in 2023: a drug discovery platform spanning multiple bioactivity data types and time periods},
  author={Zdrazil, Barbara and Felix, Eloy and Hunter, Fiona and Manners, Emma J and Blackshaw, James and Corbett, Sybilla and de Veij, Marleen and Ioannidis, Harris and Lopez, David Mendez and Mosquera, Juan F and Magarinos, Maria Paula and Bosc, Nicolas and Arcila, Ricardo and Kizil{\"o}ren, Tevfik and Gaulton, Anna and Bento, A Patr{\'i}cia and Adasme, Melissa F and Monecke, Peter and Landrum, Gregory A and Leach, Andrew R},
  journal={Nucleic Acids Research},
  year={2023},
  volume={gkad1004},
  doi={10.1093/nar/gkad1004}
}

@misc{chembl34,
  title={ChemBL34},
  year={2023},
  doi={10.6019/CHEMBL.database.34}
}

SuperNatural3

@article{Gallo2023,
  author = {Gallo, K and Kemmler, E and Goede, A and Becker, F and Dunkel, M and Preissner, R and Banerjee, P},
  title = {{SuperNatural 3.0-a database of natural products and natural product-based derivatives}},
  journal = {Nucleic Acids Research},
  year = {2023},
  month = jan,
  day = {6},
  volume = {51},
  number = {D1},
  pages = {D654-D659},
  doi = {10.1093/nar/gkac1008}
}

Ranger21 Optimizer

@article{wright2021ranger21,
      title={Ranger21: a synergistic deep learning optimizer}, 
      author={Wright, Less and Demeure, Nestor},
      year={2021},
      journal={arXiv preprint arXiv:2106.13731},
}
Downloads last month
10
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Collection including gbyuvd/ChemMiniQ3-SAbRL