- The paper introduces XRDiff, a PXRD-conditioned diffusion model that predicts full 3D crystal structures and achieves up to 78.6% StructureMatcher accuracy on simulated data under a strict polymorph-only evaluation.
- The paper shows that peak-level PXRD features generalize far better than full-spectrum inputs to experimental RRUFF data, reaching 36.56% accuracy after 10 attempts versus below 1% for full spectra.
- The paper finds that partial composition information, larger unit cells, lower symmetry, and simulation-to-experiment differences remain major challenges, highlighting the need for stronger generative models and broader training data.
Problem and motivation
Determining a crystal structure from a powder X-ray diffraction (PXRD) pattern is an underdetermined inverse problem: the measurement collapses three-dimensional structural information into a one-dimensional spectrum, discards the phase of scattered waves, and produces overlapping peaks that can be nearly indistinguishable across polymorphs. Conventional workflows built around indexing followed by Rietveld refinement are local optimization procedures whose success depends strongly on initialization and on the availability of close structural prototypes, which limits their use to phase identification rather than discovery of novel structures. XRDiff addresses this by training a diffusion model to map PXRD patterns, together with chemical composition information, directly to full 3D crystal structures (2606.14003).
The paper makes three methodological contributions beyond prior generative approaches such as Crystalyze [riesel2024crystal] and DiffractGPT [choudhary2025diffractgpt]. First, it introduces a polymorph-only evaluation protocol: compositions with only one known structure are removed, and all polymorphs of a given composition are held out together in the test split. This prevents the model from exploiting composition-to-structure shortcuts and ensures that reported match rates reflect genuine use of the diffraction signal — a stricter standard than much of the prior literature. Second, it proposes a peak-featurized PXRD representation as an alternative to full-spectrum conditioning, motivated by robustness to experimental artifacts. Third, it evaluates a partial composition setting in which only element types and the total atom count are provided, rather than exact stoichiometry.
Model architecture
XRDiff builds on the DiffCSP framework [jiao2023crystal], a score-based diffusion model over fractional coordinates and lattice parameters with a graph neural network denoiser. The PXRD condition is injected into every message-passing layer via Feature-wise Linear Modulation (FiLM): node and edge features h are transformed as h←(1+γ(s))⊙h+β(s), where γ and β are MLPs applied to the encoded spectrum. FiLM layers are initialized to the identity so training begins effectively unconditional.
Two conditioning representations are compared. The full-spectrum representation discretizes intensity over 2θ∈[5°,90°] into 850 bins using Pseudo-Voigt peak profiles with fixed Caglioti broadening parameters. The peak-based representation extracts up to 20 peaks ranked by prominence, encoding each peak's intensity, normalized position, prominence, and width, with zero-padding for sparse spectra. Composition is conditioned either as full per-atom stoichiometry or, in the relaxed setting, as a multi-hot element vector plus atom count, with per-atom type logits trained via cross-entropy and masked argmax assignment at inference.
Training data come from Alex-MP-20-Poly (~150k samples) and OQMD v1.5-Poly (~510k samples), both filtered to polymorphic compositions and split 80:10:10 at the composition level. Simulated patterns use pymatgen's PXRDCalculator; experimental evaluation uses a curated 148-structure subset of RRUFF, with any overlapping training entries removed.
Results on computational data
With full stoichiometry and one sampling attempt, XRDiff recovers the correct structure (StructureMatcher match) in 59.0% of cases on Alex-MP-20-Poly and 71.1% on OQMD-Poly using the full spectrum, rising to 72.3% and 78.6% with three attempts. Peak-feature conditioning performs comparably, particularly on OQMD-Poly where match rates are nearly identical to the full-spectrum setting. RMSD values are consistently low (0.00–0.02 Å after volume normalization), and PDD-based Earth Mover's Distances confirm comparable geometric fidelity between the two representations. A no-PXRD baseline shows a large drop in match rate and roughly doubles the EMD, confirming that the model genuinely relies on the diffraction signal rather than generating plausible structures from composition alone.
Under partial composition (element set plus atom count), match rates fall to 28.7% and 37.9% (one attempt, full PXRD), reaching 37.5% and 41.8% with three attempts. The authors attribute this gap primarily to difficulty inferring stoichiometric ratios, which are only weakly encoded in diffraction intensities, rather than to degraded lattice prediction: parity plots show scatter distributions similar to the stoichiometry-conditioned case, though with more inflated outliers.
Lattice-parameter MAE analysis reveals an important caveat about metric interpretation. The peak representation yields lower MAE than the full spectrum, but this difference is driven almost entirely by a small number of large-error outliers in the full-PXRD setting — notably occasional unrealistically large c lattice parameters (MAE of 7.25 ± 18.8 Å on Alex-MP-20-Poly) — rather than by a systematic distributional shift. Crystalyze achieves comparable or better lattice MAE, which the authors attribute to its dedicated regression heads on a VAE latent space.
Performance degrades monotonically with increasing atoms per unit cell, is non-monotonic in unit-cell volume (peaking at intermediate volumes), and improves with crystal-system symmetry. Critically, the PXRD-free diffusion backbone (DiffCSP, evaluated with METRe) exhibits the same trends, indicating that these limitations stem largely from the generative process and training-data coverage rather than from the PXRD-to-structure mapping itself. Qualitative examples of LiFeO₂ and Li₂MnNiO₆ polymorph pairs show that XRDiff discriminates between structurally distinct phases whose diffraction signatures are highly similar, recovering correct motifs with only minor local coordinate deviations.
Generalization to experimental data
Zero-shot evaluation on RRUFF, after training exclusively on simulated patterns, exposes a sharp simulation-to-experiment gap. Full-spectrum conditioning yields match rates below 1% at one attempt, with marginal gains even at ten attempts. In contrast, the peak-based representation achieves 12.84%, 25.67%, and 36.56% match rates at 1, 3, and 10 attempts when trained on Alex-MP-20-Poly, and 15.54%, 25.00%, and 30.40% when trained on OQMD-Poly. This is the paper's central empirical claim: a representation choice alone, without any experiment-specific fitting, substantially outperforms full-spectrum conditioning on real data.
The authors also compare against augmentation-based training following Riesel et al., including Caglioti re-broadening, Gamma-distributed peak-intensity perturbations fitted to observed-to-simulated intensity ratios, and dynamic background noise sampled from a bivariate log-normal calibration over Gamma parameters derived from RRUFF background profiles. Augmentations affecting only peak appearance provide limited improvement, while background-noise augmentation yields substantial gains — under OQMD-Poly training, the full augmentation pipeline becomes roughly comparable to the peak representation (differing by only one to two matched structures). Under Alex-MP-20-Poly training, however, the peak representation attains higher overall match rates as attempts increase. Since augmentation requires calibration against experimental patterns and multiplies training cost, the peak representation offers a materially cheaper path to zero-shot generalization.
Limitations and open questions
The paper is explicit about several constraints. The model assumes composition is at least partially known, and the partial setting still requires the number of atoms in the unit cell — a quantity not generally accessible experimentally; the realistic scenario of element types with flexible ratios remains unaddressed, though inference-time scanning over candidate N values could approximate a posterior over structures. Generated candidates are produced without likelihood ranking or uncertainty estimates, leaving candidate selection unresolved. The model assumes a single pristine crystalline phase; multi-phase mixtures, common in laboratory samples, require pattern decomposition that is out of scope. Finally, the claimed robustness of the peak representation holds "at least for the class of artifacts present in the RRUFF benchmark" — artifacts that corrupt peak-level properties themselves, such as severe preferred orientation or extensive peak overlap, remain a potential failure mode and are not evaluated here.
Conclusion
XRDiff demonstrates that a PXRD-conditioned diffusion model learns a spectrum-to-structure mapping precise enough to discriminate polymorphs under a strict composition-held-out protocol, achieving up to 78.6% match rates on simulated benchmarks with full stoichiometry. Its most consequential finding concerns representation design: encoding diffraction patterns as peak-level descriptors rather than raw intensity vectors enables zero-shot generalization to experimental data (36.56% at ten attempts versus below 1% for full spectra), outperforming augmentation pipelines calibrated to the target noise distribution at a fraction of the overhead. The remaining performance ceiling appears tied to generative-modeling capacity and data coverage for low-symmetry, large-unit-cell structures, suggesting that improvements on those axes — rather than further conditioning refinements — are the most direct route to higher match rates.