Abstract
Accelerating computational materials science relies not only on hardware advances but also on software that increases the ease of working with the relevant abstractions. Creation and manipulation of crystal structures is a part of many routine materials science workflows. In this work, we demonstrate how fine tuning large language models can be used to generate crystal structures from textual descriptions. By fine-tuning a CodeGen model with low-rank adaptation, we developed an interface that reduces errors and enables more flexible and powerful input, particularly for larger or more complex structures. Our model, which we call Text2Struc, is used to compare structure generation from the Materials Project database against LLM-generated and API-executed outputs. We show that API calls have higher accuracy, especially for supercells or defected crystals, as evidenced by an increase in the number of matches with original structures. Furthermore, removing Crystallographic Information File (CIF) outputs during training enhances generation fidelity, as the model trained without CIFs has a higher success rate than the model that prints CIFs in addition to the generating code. We hypothesize this may be owed to the base model being oriented towards generating code. Our findings highlight the effectiveness of fine-tuning and API integration for automating crystal structure generation in materials science.
Supplementary materials
Title
Supplementary Information for Text2Struc: Programmatic Crystal Structure Generation with Fine-Tuned Large Language Models
Description
Supplementary Information contains examples of dataset and additional details of the method.
Actions