Multi-scale Graph Autoregressive Modeling: Molecular Property Prediction via Next Token Prediction
Zhuoyang Jiang, Yaosen Min, Peiran Jin, Lei Chen
TL;DR
This work tackles molecular property prediction with decoder-only Transformers by bridging topology-exposure gaps in SMILES-based approaches and the corruption risks of graph masking. It introduces CamS, a three-stage graph-to-sequence interface that mines data-driven motifs, serializes them with scaffold-rooted BFS, and stacks multi-scale subsequences from fine to coarse to enable standard next-token prediction without architectural changes. The CamS-LLaMA pipeline pre-trains a vanilla decoder on CamS sequences and applies a lightweight fingerprint prior only during fine-tuning, achieving state-of-the-art results on MoleculeNet and MoleculeACE while offering mechanistic interpretability: multi-scale causal serialization directs attention to cliff-driving structural differences. Overall, CamS demonstrates that with an appropriate graph-to-sequence representation, vanilla autoregressive foundation models can effectively learn topology-rich molecular representations at scale, enabling both high predictive performance and transparent reasoning about activity cliffs.
Abstract
We present Connection-Aware Motif Sequencing (CamS), a graph-to-sequence representation that enables decoder-only Transformers to learn molecular graphs via standard next-token prediction (NTP). For molecular property prediction, SMILES-based NTP scales well but lacks explicit topology, whereas graph-native masked modeling captures connectivity but risks disrupting the pivotal chemical details (e.g., activity cliffs). CamS bridges this gap by serializing molecular graphs into structure-rich causal sequences. CamS first mines data-driven connection-aware motifs. It then serializes motifs via scaffold-rooted breadth-first search (BFS) to establish a stable core-to-periphery order. Crucially, CamS enables hierarchical modeling by concatenating sequences from fine to coarse motif scales, allowing the model to condition global scaffolds on dense, uncorrupted local structural evidence. We instantiate CamS-LLaMA by pre-training a vanilla LLaMA backbone on CamS sequences. It achieves state-of-the-art performance on MoleculeNet and the activity-cliff benchmark MoleculeACE, outperforming both SMILES-based language models and strong graph baselines. Interpretability analysis confirms that our multi-scale causal serialization effectively drives attention toward cliff-determining differences.
