Abstract
Accurate and efficient prediction of polymer properties is of great significance in polymer development and design. Conventionally, expensive and time-consuming experiments or simulations are required to evaluate the function of polymers. Recently, Transformer models, equipped with attention mechanisms, have exhibited superior performance in various natural language processing tasks. However, such methods have not been investigated in polymer sciences. Herein, we report TransPolymer, a Transformer-based language model for polymer property prediction. Owing to our proposed polymer tokenizer with chemical awareness, TransPolymer can learn representations directly from polymer sequences. The model learns expressive representations by pretraining on a large unlabeled dataset, followed by finetuning the model on downstream datasets concerning various polymer properties. TransPolymer achieves superior performance in all eight datasets and surpasses other baselines significantly on most downstream tasks. Moreover, the improvement by the pretrained TransPolymer over supervised TransPolymer and other language models strengthens the significant benefits of pretraining on large unlabeled data in representation learning. Experiment results further demonstrate the important role of the attention mechanism in understanding polymer sequences. We highlight this model as a promising computational tool for promoting rational polymer design and understanding structure-property relationships in a data science view.
Introduction
Predicting polymer properties is a cornerstone of materials science, yet it remains notoriously difficult. Unlike small molecules, polymers are complex, hierarchical structures with varying chain lengths (degree of polymerization), branching, and often exist as multi-component mixtures or copolymers.
Traditional methods like experimental synthesis or molecular dynamics simulations are prohibitively slow and expensive. While previous machine learning approaches like Graph Neural Networks (GNNs) and Recurrent Neural Networks (RNNs) have been used, they face significant hurdles: GNNs require explicit 3D structural data that is hard to obtain, and RNNs struggle to remember long-range dependencies in long polymer sequences. TransPolymer addresses this by treating polymers as a "chemical language," allowing the model to "understand" the complex grammar of polymer sequences without needing explicit structural coordinates.
Methods
The researchers developed TransPolymer, a model based on the RoBERTa architecture. The framework's core innovations include a chemically-aware tokenizer and a hybrid input sequence strategy that incorporates both structural and material descriptors.
Key Components:
- Chemically-Aware Tokenizer: Standard NLP tokenizers often fail on chemical strings (e.g., splitting "Si" into "S" and "i"). TransPolymer’s tokenizer is hard-coded to recognize chemical elements, SMILES symbols, and material descriptors (like temperature or component ratios) as distinct, meaningful tokens.
- Hybrid Input Sequences: The model incorporates structural and material descriptors—such as the glass transition temperature ($T_g$) or molecular weight—directly into the input sequence using special separator tokens alongside the SMILES string.
- Two-Stage Training:
- Pretraining: The model first learns the "grammar of chemistry" by performing Masked Language Modeling (MLM) on 5 million unlabeled polymer sequences from the PI1M database.
- Finetuning: The pretrained model is then equipped with a simple regression head to predict specific properties using smaller, labeled datasets.
Results and Discussion
TransPolymer was evaluated on ten diverse benchmarks, including polymer electrolyte conductivity (PE-I and PE-II), electronic properties (bandgap, electron affinity), and physical properties (dielectric constant, refractive index).
Key Insights:
- The Power of Pretraining: Pretraining on a massive unlabeled dataset proved essential. Without it, the model often fails to generalize, especially on small datasets where it might otherwise overfit. The rich representations learned from 5 million sequences provide a robust foundation for downstream tasks.
- Self-Attention as a Chemical Probe: Visualization of attention heads revealed that the model naturally learns chemical hierarchy. Initial layers focus on local interactions (bonded atoms), while deeper layers capture global structural features.
- Handling Complex Mixtures: TransPolymer excels at modeling copolymers and mixtures by concatenating their sequences with special tokens—a task that is structurally difficult for traditional graph-based models.
Performance Highlights:
TransPolymer achieved State-of-the-Art (SOTA) performance on all ten benchmarks. On the PE-I conductivity task, it reached an $R^2$ of 0.69, vastly outperforming the best baseline (Random Forest with ECFP fingerprints) which managed 0.32. Across all tasks, the model showed an average RMSE reduction of 7.7% compared to existing baseline models.
Conclusion
While TransPolymer represents a major advancement, challenges remain in fully interpreting the "Value" matrices of the Transformer architecture and addressing data scarcity for niche properties. Future work will focus on integrating TransPolymer into active-learning frameworks to virtually screen new polymers and guide laboratory experiments in real-time. As a promising computational tool, TransPolymer promotes rational polymer design and a deeper understanding of structure-property relationships through a data science lens.
Summary updated