Unlike vision and language data which usually has a unique format, molecules can naturally be characterized using different chemical formulations. One can view a molecule as a 2D graph or define it as a collection of atoms located in a 3D space. For molecular representation learning, most previous works designed neural networks only for a particular data format, making the learned models likely to fail for other data formats. We believe a general-purpose neural network model for chemistry should be able to handle molecular tasks across data modalities. To achieve this goal, in this work, we develop a novel Transformer-based Molecular model called Transformer-M, which can take molecular data of 2D or 3D formats as input and generate meaningful semantic representations. Using the standard Transformer as the backbone architecture, Transformer-M develops two separated channels to encode 2D and 3D structural information and incorporate them with the atom features in the network modules. When the input data is in a particular format, the corresponding channel will be activated, and the other will be disabled. By training on 2D and 3D molecular data with properly designed supervised signals, Transformer-M automatically learns to leverage knowledge from different data modalities and correctly capture the representations. We conducted extensive experiments for Transformer-M. All empirical results show that Transformer-M can simultaneously achieve strong performance on 2D and 3D tasks, suggesting its broad applicability. The code and models will be made publicly available at https://github.com/lsj2408/Transformer-M.
翻译:与视觉和语言数据通常具有单一格式不同,分子天然可用多种化学形式表征。人们可将分子视为2D图结构,也可将其定义为3D空间中原子集合。针对分子表征学习,以往研究大多针对特定数据格式设计神经网络,导致所学模型难以适应其他数据格式。我们认为,化学领域通用神经网络模型应能跨数据模态处理分子任务。为此,本研究开发了一种新型基于Transformer的分子模型——Transformer-M,该模型可接收2D或3D格式的分子数据,并生成具有语义意义的表征。采用标准Transformer作为骨干架构,Transformer-M构建两个独立通道分别编码2D与3D结构信息,并在网络模块中将其与原子特征融合。当输入数据为特定格式时,对应通道激活而另一通道禁用。通过在2D与3D分子数据上训练并设计适当的监督信号,Transformer-M自动学习利用不同数据模态的知识并正确捕获表征。我们对Transformer-M进行了广泛实验,所有实证结果表明,该模型能在2D与3D任务上同时取得优异性能,彰显其广泛适用性。代码与模型将在https://github.com/lsj2408/Transformer-M 公开。