DiffractGPT: Atomic Structure Determination from X-ray Diffraction Patterns using Generative Pre-trained Transformer

Kamal Choudhary · 2025

Read DiffractGPT: Atomic Structure Determination from X-ray Diffraction Patterns using Generative Pre-trained Transformer by Kamal Choudhary (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2508-08349.txt.

Introduction

Kamal Choudhary, a solo author, presents an AI model that reads crystal structures from X-ray patterns in a 2025 paper. Working out atomic structure from a powder diffraction pattern is a classic hard problem in materials science, often needing expert effort. The model is a generative transformer, similar in spirit to language models.

It was trained on thousands of known structures and their simulated diffraction patterns. The model was tested with no chemical hints, with a list of elements, and with a full chemical formula. Accuracy rose sharply when chemical information was supplied. Training was fast and simple, the author notes. The tool could speed data driven discovery of new materials.

Catalog record

CREATORKamal Choudhary
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE39 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2508-08349

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

DiffractGPT: Atomic Structure Determination from X-ray Diffraction Patterns using Generative Pre-trained Transformer Kamal Choudhary Abstract Crystal structure determination from powder diffraction patterns is a complex challenge in materials science, often requiring extensive expertise and computational resources. This study introduces DiffractGPT, a generative pre-trained transformer model designed to predict atomic structures directly from X-ray diffraction (XRD) patterns. By capturing the intricate relationships between diffraction patterns and crystal structures, DiffractGPT enables fast and accurate inverse design. Trained on thousands of atomic structures and their simulated XRD patterns from the JARVIS-DFT dataset, we evaluate the model across three scenarios: (1) without chemical information, (2) with a list of elements, and (3) with an explicit chemical formula. The results demonstrate that incorporating chemical information significantly enhances prediction accuracy. Additionally, the training process is straightforward and fast, bridging gaps between computational, data science, and experimental communities. This work represents a significant advancement in automating crystal structure determination, offering a robust tool for data-driven materials discovery and design. keywords American Chemical Society, L a T e X † † email: [email protected] † † affiliation: Material Measurement Laboratory, National Institute of Standards and Technology, Gaithersburg, MD 20899, USA † † affiliation: Department of Materials Science and Engineering, Whiting School of Engineering, The Johns Hopkins University, Baltimore, MD 21218, USA † † affiliation: Department of Electrical and Computer Engineering, Whiting School of Engineering, The Johns Hopkins University, Baltimore, MD 21218, USA † † abbreviations: IR,NMR,UV Since the discovery of X-rays in 1895, they have been widely used in medical imaging, crystallography, and astronomy Als-Nielsen and McMorrow 2011 . Numerous experimental techniques in materials science rely on X-rays, including X-ray diffraction (XRD), X-ray fluorescence (XRF), X-ray photoelectron spectroscopy (XPS), small-angle X-ray scattering (SAXS), X-ray tomography (XRT), X-ray reflectometry (XRR), grazing incidence X-ray diffraction (GIXRD), and resonant inelastic X-ray scattering (RIXS) Giacovazzo 2002 ; Wyon 2010 . Among these, XRD plays a crucial role in determining atomic structures and uncovering the mechanisms underlying mechanical strength, electronic properties, optical behavior, and chemical reactivity Holder and Schaak 2019 ; Brown 2012 . However, crystal structure determination currently involves extensive trial and error as well as expert knowledge. The main challenge lies in the reduction of chemical and three-dimensional structural information into one-dimensional diffraction patterns, which causes the loss of phase information and complicates structure determination. Additionally, the presence of peaks in the diffraction data of newly discovered compounds, complex materials, or multi-phase systems further exacerbates this challenge. Over the past few decades, Rietveld refinement, simulated annealing, and evolutionary algorithms have been developed to address this problem by iteratively fitting data to potential candidate structures Giacovazzo 2002 ; Wyon 2010 . Several widely used software tools, such as FullProf Rodriguez-Carvajal and Roisnel 1998 , the General Structure Analysis System (GSAS) Larson and Von Dreele 1985 , GenX Glavic and Björck 2022 , TOtal Pattern Analysis Solutions (TOPAS) Coelho 2018 , and Materials Analysis Using Diffraction (MAUD) Wenk et al. 2010 , are available for this purpose. While these methods have been successful, they often require significant domain expertise, computational resources, and manual intervention, particularly when dealing with ambiguous or incomplete data. In recent years, machine learning has emerged as a powerful tool in materials science, offering the potential to accelerate materials discovery and characterization Choudhary et al. 2022 ; Vasudevan et al. 2019 ; Schmidt et al. 2019 . In particular, high-throughput materials design and process modeling, which are key driving forces behind the Materials Genome Initiative and the Creating Helpful Incentives to Produce Semiconductors (CHIPS) Act nis , require a bridge between experiments and multi-scale modeling components, where large language models (LLMs) could play a significant role. Moreover, two recent Nobel Prizes in Physics and Chemistry in 2024 for neural networks and AlphaFold clearly demonstrate the wide applicability of AI/ML in scientific research. The AI/ML techniques have been successfully used for both forward (structure to property) and inverse (property to structure) tasks in materials design Choudhary et al. 2022 . Generating crystal structures from XRD can be considered a generative AI-based inverse design task. Recent advancements in machine learning related to X-ray diffraction Surdu and Győrgy 2023 include works by Park et al. Park et al. 2017 , NeuralXRD Zhdanov and Zhdanov 2023 , XRD_is_All_You_Need Lee et al. 2022 , Crystallography Companion Agent (XCA) Banko et al. 2021 , ARiXD-ML Yanxon et al. 2023 , Zaloga et al. Zaloga et al. 2020 , XTEC Venderley et al. 2022 , Li et al. Lee et al. 2020 , Maffettone et al. Maffettone et al. 2021 , Oviedo et al. Oviedo et al. 2019 and several others Chen et al. 2024 ; Xin et al. 2023 ; Xin et al. 2023 . These works demonstrate the application of ML models for a wide range of tasks, including crystal lattice and space group classification, peak detection, and structure generation. In particular, the application of deep generative models such as Variational Autoencoders (VAEs) and Generative Adversarial Networks (GANs) has demonstrated the ability to generate complex atomic structures based on insights. The potential of GPT in natural language processing (NLP), such as ChatGPT, has spurred interest in their applications beyond textual data, particularly in domains such as chemistry and materials science. The success of AtomGPT (Atomistic Generative Pre-trained Transformer) Choudhary 2024 , which demonstrated the capability to generate atomic structures and predict material properties using transformer-based architectures, highlights the power of transformer models in handling materials data. AtomGPT establishes the relationship between atomic configurations as text and material properties, allowing it to tackle both forward and inverse design problems. The GPT is a type of LLM originally developed for natural language processing and has demonstrated remarkable success in generating coherent and contextually relevant text Vaswani et al. 2017 ; Tunstall et al. 2022 ; Rothman 2021 . Models such as ChatGPT Wu et al. 2023 have been used for code generation, debugging, literature reviews, and numerous other tasks. However, if we attempt to perform forward/inverse materials design tasks, the outcomes can be quite poor Pimentel et al. 2023 ; Jablonka et al. 2024 ; Polak and Morgan 2024 . Nevertheless, inspired by its simplicity of use and the massive success of ChatGPT, an alternate model, AtomGPT, was introduced, tailored for forward and inverse materials design. While AtomGPT enables scalar material properties to be generated from atomic structures, its application for generating atomic structures from experimental properties, such as XRD, has not yet been explored. Based on these developments, we introduce DiffractGPT (DGPT) , a specialized generative model designed to directly predict crystal structures from powder X-ray diffraction (PXRD) patterns. DiffractGPT leverages the powerful architecture of AtomGPT, adapting it to the unique challenges of PXRD-based crystal structure determination. By training on large datasets such as JARVIS-DFT (JDFT), which comprises simulated PXRD patterns alongside their corresponding atomic structures, DiffractGPT learns to map complex diffraction data to accurate crystal structures. This approach enables the direct prediction of atomic arrangements from diffraction data, significantly reducing the need for iterative fitting and manual intervention. We further evaluate various application scenarios for DiffractGPT, such as XRD with no known chemical constituents, with guessed elements, and with explicit chemical formulas for structure design tasks. We also provide a web framework and tools to match

Read the complete text