deCIFer: Crystal Structure Prediction from Powder Diffraction Data using Autoregressive Language Models

Frederik L. Johansen, Ulrik Friis-Jensen, Erik Bjørnager Dam, Kirsten M. Ø. Jensen, Rocío Mercado, Raghavendra Selvan · DOI

Introduction

Discovering and characterizing new materials—essential for advancements in energy storage and electronics—hinges on understanding their atomic structures. Powder X-ray Diffraction (PXRD) is the standard laboratory tool for this, providing a "fingerprint" of peaks based on X-ray scattering. However, the inverse problem—translating these 1D patterns back into 3D atomic coordinates—is notoriously difficult, often requiring manual refinement and expert intuition.

This paper introduces deCIFer, a novel transformer-based language model designed to bridge the gap between computational structure prediction and experimental characterization. By generating standard Crystallographic Information Files (CIFs) conditioned directly on PXRD data, deCIFer automates the translation of experimental "fingerprints" into structurally meaningful models.

Methodology

The authors treat crystal structure prediction as a conditional language modeling task. deCIFer is a 27-million parameter autoregressive transformer (decoder-only) that generates CIFs token by token.

Overview of the deCIFer model architecture and example generations.

Key components of the architecture include:

  • PXRD Conditioning: 1D continuous PXRD profiles are processed through a Multi-Layer Perceptron (MLP) to create learned embeddings. These embeddings are prepended to the CIF token sequence, guiding the generation process toward structures consistent with the diffraction data.
  • Robust Simulation: To handle real-world experimental noise, the model is trained on synthetic PXRD patterns augmented with random peak broadening and Gaussian noise.
  • Efficient Sequence Packing: The model utilizes a context window of 3076 tokens, packing multiple CIFs into a single window with a block-diagonal attention mask to prevent cross-contamination between samples.

Experimental Setup

The model was trained and evaluated using several key datasets:

  • NOMA: A large-scale dataset of ~2.3 million synthetic structures from the Materials Project, OQMD, and NOMAD.
  • CHILI-100K: An out-of-distribution test set of ~8.2K experimentally determined structures from the Crystallography Open Database (COD), used to assess real-world generalization.
  • Benchmarks: Standard benchmarks like Perov-5 and Carbon-24 were used for comparison against state-of-the-art models like CDVAE and DiffCSP.

Results and Discussion

deCIFer demonstrates significant improvements over existing crystal structure prediction (CSP) methods. On the NOMA test set, it achieved a 94.5% match rate when conditioned on PXRD, composition, and space group.

Distribution of weighted profile R-factor ($R_{wp}$) for different conditioning scenarios.

Key Insights

  • Impact of Conditioning: As shown in the performance distributions, adding PXRD conditioning significantly reduces the weighted profile R-factor ($R_{wp}$), indicating a much closer match to the experimental data compared to unconditioned models (U-deCIFer).
  • Physical Latent Space: The learned PXRD embeddings naturally cluster by physical properties such as crystal system and cell volume, even without explicit supervision.
  • Handling Homometric Structures: The model faces challenges with homometric structures—distinct arrangements that produce identical diffraction patterns. The authors found that combining PXRD data with chemical composition helps resolve these ambiguities.
  • Generalization to Real Data: On the experimental CHILI-100K dataset, PXRD conditioning boosted the match rate from 25.9% to 37.3%, showcasing the model's ability to handle complex, real-world data.

Conclusion and Future Work

While deCIFer represents a major step forward, it still faces limitations. It struggles with low-symmetry systems (triclinic/monoclinic) due to data scarcity and cannot fully resolve all homometric ambiguities.

Future research will focus on:

  • Advanced Decoding: Implementing beam search to generate and rank multiple candidate structures.
  • Reinforcement Learning: Using RLHF to reward the generation of chemically valid and structurally sound outputs.
  • Diverse Training: Expanding the training set to include more low-symmetry experimental data to improve broad-spectrum generalization.

Summary updated

BibTeX
@article{johansen2026decifer,
  author = {Frederik L. Johansen and Ulrik Friis-Jensen and Erik Bjørnager Dam and Kirsten M. Ø. Jensen and Rocío Mercado and Raghavendra Selvan},
  title = {{deCIFer: Crystal Structure Prediction from Powder Diffraction Data using Autoregressive Language Models}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2026},
}
Figure