Does Pretraining Teach Chemical Language Models Chemistry?
Organizations: Harvard University, Cambridge, MA, USA
Abstract
Chemical language models (CLMs) are pretrained on large corpora of molecules with the aim of learning representations that transfer to diverse downstream tasks. Here, we systematically study the effects of pretraining using a series of such CLMs across 64 molecular property prediction datasets. We find that the downstream gains of pretraining in CLMs do not scale and performance saturates below gradient-boosting baselines. Across the regimes evaluated, only supervised pretraining on traditional physico-chemical descriptors consistently improves downstream performance for the CLMs tested whereas some forms of pretraining result in models worse than a randomly initialized encoder. While models can resolve molecular structure well, they do so no better than a randomly initialized model, suggesting that, at best, CLMs learn descriptor-like properties in addition to low-level token statistics during pretraining, but surprisingly little chemistry beyond what classical molecular features already capture.
Figures & tables
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Setting |
|---|---|
| Backbone | ModernBERT (RoPE, pre-norm, GeGLU, global/local attention) |
| Layers / hidden size / heads | 12 / 512 / 8 |
| Feed-forward width (GeGLU) | 1,536 |
| Global attention | every 3 layers; local window 128 |
| Position encoding | rotary; max position 256 |
| Dropout (attn / mlp / embed) | 0 / 0 / 0 |
| Source | Objective | Labels | Molecules | Label distribution |
| Unsupervised corpora | ||||
| PubChem, filtered | MLM, MTR | — | 12,000,000 | — |
| PubChem, full | MLM, MTR | — | 123,400,000 | — |
| Computed targets | ||||
| RDKit descriptors | MTR | 217 | all of the above | continuous, -scored, clipped |
| Assay label families | ||||
| Dataset | Task type | Metric | Molecules | Actives |
|---|---|---|---|---|
| MoleculeACE | potency regression, 30 targets | macro RMSE | 48,714 | — |
| HIV | rare-active screen | NEF1% | 41,120 | 1,443 (3.51%) |
| BACE | binary classification | ROC-AUC | 1,513 | 691 (45.7%) |
| Tox21 | binary classification, 12 assays | mean ROC-AUC | 7,823 | 5,858 (7.52%) |
| QM7 | quantum regression | RMSE (kcal/mol) | 6,838 | — |
| Ames | binary classification | ROC-AUC | 7,278 | 53.3% a |
| topology and shape | substructure and electronic | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Representation | Chi | Kappa | BCUT | Ipc/SPS | EState | VSA | fr_* | Bulk | ALL |
| ECFP4 (2,048-bit) | 0.73 | 0.69 | 0.66 | 0.69 | 0.65 | 0.69 | 0.61 | 0.72 | 0.69 |
| CLIMB unsup | 0.86 | 0.79 | 0.73 | 0.75 | 0.56 | 0.62 | 0.33 | 0.70 | 0.59 |
| CLIMB sup, desc | 0.97 | 0.95 | 0.86 | 0.89 | 0.87 | 0.77 | 0.74 | 0.91 | 0.82 |
| CLIMB random | 0.42 | 0.34 | 0.53 | 0.42 | 0.31 | 0.34 | 0.16 | 0.41 | 0.34 |
| measured lift | weight conditioning | attributable to | |||||
|---|---|---|---|---|---|---|---|
| Panel | real | wiki | real | wiki | generic | chemistry | Chemistry share |
| QM7 | 2.74 | 3.12 | — | ||||
| MoleculeACE | 0.83 | 1.44 | 19% | ||||
| HIV | 5.42 | 2.75 | 25% | ||||
| BACE | 0.78 | 0.97 | 83% | ||||
| Tox21 | 0.26 | 81% | |||||