Unveiling Scaling Behaviors in Molecular Language Models: Effects of Model Size, Data, and Representation
Dong Xu, Qihua Pan, Sisi Yuan, Jianqiang Li, Zexuan Zhu, Junkai Ji
TL;DR
This work systematically characterizes scaling in molecular language models under compute budgets by exhaustively varying model size, data, and molecular representations across 300 models and 10,000 experiments. It establishes a bivariate power-law for validation loss, derives a compute-optimal frontier with closed-form expressions for the optimal size $P_{ ext{opt}}(C)$ and tokens $D_{ ext{opt}}(C)$, and shows that representation choice shifts the frontier and irreducible loss $L_{ inf}$. Downstream evaluation on MoleculeNet demonstrates task- and representation-dependent scaling behavior, with fragment-based representations (FragSeq/FragLink) often yielding stronger or more robust gains, particularly for biophysics and certain classification tasks. The study provides practical guidance for allocating compute between model capacity and data, highlights the importance of representation design, and publicly releases the largest library of molecular language models to date to accelerate future research.
Abstract
Molecular generative models, often employing GPT-style language modeling on molecular string representations, have shown promising capabilities when scaled to large datasets and model sizes. However, it remains unclear and subject to debate whether these models adhere to predictable scaling laws under fixed computational budgets, which is a crucial understanding for optimally allocating resources between model size, data volume, and molecular representation. In this study, we systematically investigate the scaling behavior of molecular language models across both pretraining and downstream tasks. We train 300 models and conduct over 10,000 experiments, rigorously controlling compute budgets while independently varying model size, number of training tokens, and molecular representation. Our results demonstrate clear scaling laws in molecular models for both pretraining and downstream transfer, reveal the substantial impact of molecular representation on performance, and explain previously observed inconsistencies in scaling behavior for molecular generation. Additionally, we publicly release the largest library of molecular language models to date to facilitate future research and development. Code and models are available at https://github.com/SZU-ADDG/MLM-Scaling.
