Invariant Tokenization of Crystalline Materials for Language Model Enabled Generation

Keqiang Yan, Xiner Li, Hongyi Ling, Kenna Ashen, Carl Edwards, Raymundo Arróyave, Marinka Zitnik, Heng Ji, Xiaofeng Qian, Xiaoning Qian, Shuiwang Ji · DOI

Introduction

The discovery of novel crystalline materials is a cornerstone of modern technological advancement, impacting fields from energy storage to semiconductor manufacturing. Traditionally, this discovery process relies on Density Functional Theory (DFT), which, while accurate, is computationally expensive and slow. Recently, Large Language Models (LLMs) have emerged as a promising alternative for generative material design. However, a significant hurdle remains: the lack of a unique, invariant 1D representation for 3D crystalline structures.

The Representation Problem

Most current LLM-based approaches utilize the Crystallographic Information Framework (CIF) to represent materials as text. While CIF is a standard in the field, it is fundamentally non-unique. A single physical crystal can be described by numerous valid CIF strings depending on the choice of unit cell, atom ordering, or periodic boundary placement.

Figure 1: The non-uniqueness of CIF files. The same crystal structure can be represented by multiple distinct text strings, creating a "translation" problem for LLMs.

For an LLM, these variations appear as different materials, forcing models to rely on extensive data augmentation. This "brute-force" approach is inefficient and often fails to capture the underlying physical symmetries—specifically $SE(3)$ invariance (rotation and translation) and periodic invariance—required for robust material generation.

The Mat2Seq Framework

To address these limitations, we introduce Mat2Seq, a novel tokenization framework that ensures every 3D crystal has a single, mathematically invariant 1D sequence representation. The Mat2Seq pipeline consists of three critical stages designed to eliminate ambiguity:

  1. Lattice Standardization: The framework employs Niggli cell reduction to derive a unique set of lattice vectors. This ensures that the "bounding box" of the crystal is defined consistently across all representations.
  2. Unique Origin Selection: To resolve shifts in periodic boundaries, Mat2Seq identifies a canonical "starting" atom. This selection is based on a deterministic ranking of atomic numbers and local environment densities.
  3. Invariant Encoding: Rather than listing every atom in a potentially large unit cell, Mat2Seq utilizes irreducible atom sets and space group information. This approach significantly compresses the sequence length while maintaining full reconstructibility of the 3D structure.
Figure 2: The Mat2Seq pipeline transforms 3D crystal structures into unique, canonical 1D sequences through lattice standardization and origin selection.

The resulting Mat2Seq sequence includes essential metadata: chemical formula, space group symbol, six invariant lattice parameters ($a, b, c, \alpha, \beta, \gamma$), and the fractional coordinates of the irreducible atoms.

Experimental Evaluation

Mat2Seq was evaluated against several benchmarks, including Perov-5 (perovskites), Carbon-24, and the Materials Project (MP-20 and MPTS-52).

Uniqueness and Efficiency

A key strength of Mat2Seq is its provable uniqueness. In tests on the MP20 dataset, Mat2Seq achieved a 100% success rate in identifying equivalent crystals. In contrast, standard CIF representations without symmetry labels failed entirely (0% success). Furthermore, by leveraging space group symmetry, Mat2Seq produces shorter sequences, reducing the computational overhead for the LLM's attention mechanism.

Generative Performance

In generative tasks, Mat2Seq consistently outperformed both previous LLM-based models and specialized diffusion models:

  • Match Rate: On the MP20 dataset, Mat2Seq achieved a 61.3% match rate in one-shot generation, surpassing CrystaLLM (58.7%) and the diffusion-based DiffCSP (51.5%).
  • Generation Speed: Mat2Seq is significantly more efficient, generating structures approximately 3.5x faster than DiffCSP and 18x faster than CDVAE.
  • Property-Conditioned Generation: When fine-tuned on the JARVIS-DFT dataset, the model demonstrated high precision in generating materials with specific physical properties, such as targeted band gaps.

Conclusion

Mat2Seq represents a significant advancement in the application of LLMs to material science. By providing a mathematically consistent "language" for crystals, it enables models to learn complex geometric constraints without the need for massive data augmentation. While currently focused on periodic solids, future work aims to extend this invariant tokenization to non-periodic systems and disordered materials, potentially paving the way for a universal foundation model for material discovery.

Summary updated

BibTeX
@inproceedings{yan2024invariant,
  author = {Keqiang Yan and Xiner Li and Hongyi Ling and Kenna Ashen and Carl Edwards and Raymundo Arróyave and Marinka Zitnik and Heng Ji and Xiaofeng Qian and Xiaoning Qian and Shuiwang Ji},
  title = {{Invariant Tokenization of Crystalline Materials for Language Model Enabled Generation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=18FGRNd0wZ},
}
Figure