提出SmiSelf框架,让大模型生成100%有效的分子结构。
How to Make Large Language Models Generate 100% Valid Molecules?
- 用语法规则将无效SMILES转为SELFIES,再还原为有效分子
- 实验显示生成分子100%有效,且保留关键化学特性
- 适配所有基于SMILES的生成模型,推动医药研发应用
分子生成在药物发现与材料科学中至关重要,可设计具备特定性质的新化合物。大型语言模型(LLMs)虽能从少量示例中学习多种任务,但在少样本场景下用SMILES表示法生成有效分子仍具挑战。本文探索如何实现LLMs生成100%有效分子。实验表明,尽管SELFIES表示法确保每个字符串对应有效分子,但使用SELFIES时LLMs表现反而不如SMILES。进一步发现LLMs纠正无效SMILES的能力有限。为此,本文提出SmiSelf——一种跨化学语言框架,用于无效SMILES纠错:先通过语法规则将无效SMILES转换为SELFIES,利用SELFIES机制修正错误,再还原为有效分子。实验显示,SmiSelf实现100%分子有效性,同时保持分子特性,并在其他指标上维持或提升性能。该方法兼容所有基于SMILES的生成模型,可扩展其在生物医药中的实际应用。代码已开源:https://github.com/wentao228/SmiSelf。
原文摘要 · Abstract (English)
Molecule generation is key to drug discovery and materials science, enabling the design of novel compounds with specific properties. Large language models (LLMs) can learn to perform a wide range of tasks from just a few examples. However, generating valid molecules using representations like SMILES is challenging for LLMs in few-shot settings. In this work, we explore how LLMs can generate 100% valid molecules. We evaluate whether LLMs can use SELFIES, a representation where every string corresponds to a valid molecule, for valid molecule generation but find that LLMs perform worse with SELFIES than with SMILES. We then examine LLMs' ability to correct invalid SMILES and find their capacity limited. Finally, we introduce SmiSelf, a cross-chemical language framework for invalid SMILES correction. SmiSelf converts invalid SMILES to SELFIES using grammatical rules, leveraging SELFIES' mechanisms to correct the invalid SMILES. Experiments show that SmiSelf ensures 100% validity while preserving molecular characteristics and maintaining or even enhancing performance on other metrics. SmiSelf helps expand LLMs' practical applications in biomedicine and is compatible with all SMILES-based generative models. Code is available at https://github.com/wentao228/SmiSelf.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。