论文精选

MolGram:为分子语言模型注入局部n-gram记忆,提升化学任务性能

Augmenting Molecular Language Models with Local $n$-gram Memory

精选理由

做分子生成或逆合成预测的团队,MolGram用更少参数就能超越3倍大模型,值得在自家任务上试试。

AI 摘要

针对SMILES字符串的Transformer模型存在局部性缺陷:标准字符级分词会破坏化学上有意义的基团,迫使模型重复学习局部语法而忽略长程依赖。MolGram通过条件n-gram记忆模块,将局部字符串模式映射为可学习的嵌入向量,并动态注入隐藏状态,在不破坏标准分词器的情况下解决该问题。在无条件分子生成、正向反应预测和单步逆合成三个任务上,MolGram一致提升性能,且仅用1/3参数即可超越基线模型。该工作表明,显式局部模式记忆是一种高效的归纳偏置,尤其适合化学信息学场景。

原文 · arXiv cs.AI

Augmenting Molecular Language Models with Local $n$-gram Memory

Transformer-based language models for SMILES strings suffer from a locality gap: standard character-level tokenization fragments chemically meaningful motifs, forcing models to repeatedly learn local syntax at the expense of long-range dependencies. To address this without disrupting standard tokenizers, we propose MolGram, which integrates a conditional $n$-gram memory module into molecular language models. MolGram maps local string patterns to learned embeddings via scalable hash lookups and dynamically injects this regional context into hidden states. Evaluations across three tasks, including unconditional molecule generation, forward reaction prediction, and single-step retrosynthesis, show that MolGram consistently improves performance. Crucially, our analyses demonstrate that MolGram outperforms baselines with 3$\times$ more parameters, establishing explicit local pattern memory as a highly efficient inductive bias.