Skip to content
AI.info

Research

A self-learning scientific agent for X-ray diffraction

Overview Research area: Computational materials science, crystallography, and autonomous scientific agents, specifically powder X-ray diffraction (PXRD) analysis. Technical level: Advanced. The paper

A self-learning scientific agent for X-ray diffraction
arXiv
2610.07862
Published
2026-10-06
Authors
Bin Cao, Huichi Zhou, Runyu Yang, Jingsong Li, Shuchen Sun, Yan Song, Hanyu Gao, Zhongwei Yu, Tong-Yi Zhang, Jun Wang

AI summary

Overview

  • Research area: Computational materials science, crystallography, and autonomous scientific agents, specifically powder X-ray diffraction (PXRD) analysis.
  • Technical level: Advanced. The paper assumes familiarity with crystallographic refinement concepts (R-factors, Bragg reflections, whole-pattern modelling) and with machine-learning agent architectures.
  • Scope: The paper introduces Gan Jiang, a self-learning agent that couples a suite of diffraction-analysis engines with a persistent, executable skill library, and demonstrates that experience from one analysis can improve the procedure used on unseen samples.

What This Paper Is About

Interpreting a powder diffraction pattern is an ill-posed inverse problem: reflections overlap, phases coexist, and disorder or incomplete measurements make competing structural models hard to separate. The authors build Gan Jiang, an agent that not only proposes and refines structures for the sample in front of it but also converts the lessons of each analysis into revised, reusable procedures without retraining the underlying language model. The goal is an agent that both extracts structural knowledge from measurements and accumulates validated analytical expertise that transfers to new samples.

Key Contributions

  1. An integrated diffraction-analysis ecosystem. Gan Jiang is built on four engines developed by the authors — XMatcher (interpretable search-and-match), XQueryer Lightweight (XQueryer-LW, learned structure retrieval when elemental information is available), XDecomposer (phase-resolved descriptions of mixtures), and PyWPEM (physics-constrained whole-pattern modelling) — plus XMatcher-AutoMix for mixture fallback and established refinement branches FullProf and GSAS-II, all connected through an inspection layer (XRDinspector).
  2. A self-improvement mechanism based on executable skills. Following a read–write reflective learning mechanism, the agent stores procedures as external memory (instructions, prompts and supporting code), attributes failures, proposes revisions, validates them on paired development evaluations, freezes the selected version, and then tests transfer on held-out samples. The underlying language-model parameters remain fixed.
  3. DeltaXRDbench, a model-agnostic benchmark of 62,044 patterns: 40,000 derived from simulated MP500 data, 11,164 from experimental RRUFF data and 10,880 from experimental opXRD data, comprising 12,044 single-phase patterns and 50,000 deterministic two- or three-phase mixtures on a common 10°–80° 2θ grid at 0.01° intervals.
  4. A broad structural reference library. The Gan Jiang candidate library combines MP500 (100,315 periodic structures across 84 elements, cells of 1–360 atoms, median 20) with 2,007 experimentally derived structures (1,159 from RRUFF and 848 from a combined opXRD and private-data branch), spanning 80 elements and 141 space groups, with cells of 2–496 atoms (median 54).

Main Findings

  • Improvement of refinement workflows transfers to held-out samples. Starting from expert-optimized baselines, mean held-out refinement scores rose from 46.90 to 72.38 for FullProf, from 39.01 to 60.02 for GSAS-II (joint skill and refinement-setting optimization) and from 31.74 to 38.33 for PyWPEM (skill optimization). The scores summarize profile agreement, count failed or timed-out evaluations as zero, and are explicitly not percentages of correctly identified structures. The authors note the smaller PyWPEM gain indicates the benefit depends on the initial workflow, engine and permitted revisions.
  • Concrete learned rules. FullProf revisions replaced a generic release sequence with a bounded, task-specific search over profile width and angular offset; GSAS-II revisions added explicit parameter-passing and saved-output checks; PyWPEM revisions separated refinement of a known structure from structure solving and added targeted responses to divergence or timeouts. One GSAS-II training episode showed that changing several parameter groups together worsened the fit, so the revised skill emphasizes starting from defaults and adjusting one group at a time.
  • Single-phase identification leads the evaluated methods. Under XRD-only inference, Gan Jiang reached top-1 accuracies of 96.30%, 81.78% and 40.83% on MP500 (N = 10,000), RRUFF (N = 1164) and opXRD (N = 880), versus 58.00%, 58.47% and 26.45% for AutoXRD, the strongest comparator — margins of 38.30, 23.31 and 14.38 percentage points. MRR@5 reached 96.94%, 86.01% and 42.22% against 60.17%, 60.89% and 27.48%. Supplied composition raised top-1 accuracies to 99.90%, 92.16% and 48.93%.
  • Multiphase identification also leads. Without supplied composition, exact-set recovery was 22.80%, 15.90% and 3.10% on MP500, RRUFF and opXRD versus 15.80%, 13.80% and 1.30% for AutoXRD; macro-F1 was 66.98%, 56.23% and 27.04% against best alternatives of 51.12%, 53.78% and 20.14% (AutoAnalyzer). With composition assistance, exact-set recovery reached 69.70%, 38.20% and 8.20% and macro-F1 91.61%, 78.56% and 38.21%. Each multiphase evaluation sampled 1,000 mixtures per source, and metrics are means across three fixed-seed runs.
  • Coverage versus correctness. Gan Jiang returned a nonempty prediction for every evaluated mixture (100.00% coverage in both conditions), which the authors state does not by itself establish correctness.
  • Strongly overlapping reflections resolved. For orthorhombic PbSO4 (Pnma), the pattern contains 383 pairs of overlapping Bragg reflections under Cu Kα radiation (λα1 = 1.540560 Å, λα2 = 1.544330 Å); whole-pattern modelling reached Rp = 2.753% and Rwp = 5.926% with a = 8.4851(0) Å, b = 5.4016(1) Å and c = 6.9643(3) Å.
  • A five-phase archaeological mixture quantified. An ancient Egyptian cosmetic powder containing gypsum, phosgenite, cerussite, galena and laurionite was resolved with mass fractions of 12.53%, 18.53%, 32.02%, 9.69% and 27.23% (Rp = 6.600%, Rwp = 13.079%). The authors connect the substantial lead-chloride component to earlier evidence for deliberate chemical processing.
  • Operando tracking of a battery cathode. For an O3-type Li(Ni0.8Co0.1Mn0.1)O2 cathode cycled between 3.0 and 4.6 V, each accepted structural state initialized the next refinement, producing a c-axis trajectory showing expansion and high-voltage contraction consistent with peak motion in the measured profiles.
  • Disordered catalyst configuration discriminated. For a Ru–Mn oxide electrocatalyst obtained by cation exchange from orthorhombic Mn2O3, candidate Ru-site occupations were screened within a 3 × 3 supercell; the selected model reached Rp = 1.447% and Rwp = 3.129% and was deposited as CCDC 2530452.

Methodology in Plain English

The agent organizes analysis into five stages: receive the pattern and context; find candidate structures; check their evidence; refine supported models; and report the result. The observed pattern is kept in three separate representations — the full-range measurement at its original intensity scale, a model input resampled to 3,500 points over 10°–90° for XQueryer-LW (with unmeasured regions treated as padding), and a full-range inspector input — so that a retrieval-specific transformation never replaces the experimental evidence used to judge a candidate.

Candidates arrive as crystallographic information files. XMatcher retrieves single-phase candidates from observed peaks, and supplied elemental constraints enable the complementary XQueryer-LW channel; candidates are merged by material identity while preserving source scores and provenance. An inspector compares each candidate or proposed phase set with the measurement. Acceptance requires a favourable inspector verdict plus all applicable composition and peak-verification checks; agreement between retrieval channels helps prioritize inspection but cannot override a failed evidence check. Bounded angular-offset trials may assist matching, and the authors state these trials do not constitute instrument calibration. If all single-phase hypotheses are rejected, mixture analysis is triggered through XMatcher-AutoMix or XDecomposer, and the paper explicitly distinguishes a failed tool call from evidence that a sample is multiphase. Accepted models proceed to PyWPEM (exposed through the PyXplore service), FullProf or GSAS-II, where an inspector compares observed and calculated profiles on aligned angular coordinates and compatible intensity and background definitions; passing runs are ranked by inspection score and then peak coverage, with at most one eligible budget-related retry.

Separately, the learning loop records execution traces, diffraction agreement, structural plausibility and expert feedback, attributes failures, proposes revisions to skill instructions, code or refinement settings, and compares candidate versions against the current one through paired development evaluation. Held-out samples are never used to propose or select revisions; the selected version is frozen before held-out comparison. The paper reports that training compute, wall-clock times and monetary cost are not reported.

Why This Matters

The work reframes the analytical procedure itself — not just the structure of one sample — as something that can be learned, validated and reused. It shows that an agent can improve beyond expert-designed baselines while leaving the language model and the underlying physical models unchanged, and it provides a benchmark that scores submitted CIFs against reference structures rather than requiring database identifiers. The authors state the consistent ranking across conditions supports the breadth of the identification capability, while the absolute scores on opXRD delimit it: many opXRD measurements cover incomplete angular ranges, and exact recovery of all mixture constituents remains difficult even with composition information.

Real-world applications illustrated or implied in the paper:

  • Cultural heritage and archaeological materials science: quantifying the mineral assemblage of an ancient Egyptian cosmetic powder, including a five-phase mixture with lead-chloride components.
  • Battery research and development: tracking lattice evolution of an operating O3-type Li(Ni0.8Co0.1Mn0.1)O2 cathode across successive scans between 3.0 and 4.6 V.
  • Catalysis and disordered materials: distinguishing chemically plausible Ru-site occupations in a Ru–Mn oxide electrocatalyst and depositing a diffraction-supported model (CCDC 2530452).
  • High-throughput and autonomous laboratories: the paper situates the work against the increased demand for structural decisions created by high-throughput measurements and autonomous laboratories.

Industry relevance: the paper notes that automated refinement programs and emerging agents connect predictions to numerical verification, and that closing the analysis loop for one sample does not by itself improve the next procedure. Gan Jiang targets that gap by producing versioned, provenance-preserving procedures that can be compared before adoption — a pattern relevant to any laboratory pipeline where refinement failures and expert corrections currently accumulate without being converted into reusable practice. The paper also describes a deployment-time architecture in which verified user episodes generate candidate updates that undergo regression checks before versioned release, with monitoring and rollback.

Future Directions

  • Closing the loop between analysis and experiment. Because incomplete opXRD patterns show that structural ambiguity may persist simply because distinguishing information was never measured, the authors propose that the agent identify missing or uncertain diffraction features and direct a diffractometer to acquire the necessary data, then reassess its interpretation.
  • Prospective experimental testing. The paper states that prospective experiments will test whether this analysis-to-acquisition feedback improves experimental efficiency and structural inference.
  • Demonstrating open-ended improvement during routine use. The present experiments establish transfer after controlled revision and freezing; the authors characterize these as a basis for, rather than a longitudinal demonstration of, open-ended improvement during everyday deployment.
  • Extending the transfer evidence. The reported comparisons assess transfer of the final workflow rather than isolating the contribution of any individual edit, and the three workflows have different adaptation scopes, so their score changes should be interpreted within each branch. The authors also state the benefit depends on the initial workflow, engine and permitted revisions.

Target Audience

Researchers and practitioners in computational materials science, crystallography and automated diffraction analysis who need to identify and refine phases from powder patterns, including those working with multiphase or incompletely measured data. It is also relevant to developers of scientific agents and self-improving AI systems interested in architectures that store learning outside model parameters as versioned, testable skills, and to scientists evaluating whether agentic tools can meet the evidentiary standards of physical measurement. The paper is written at an advanced level and is best appreciated by readers comfortable with Rietveld-style refinement metrics (Rp, Rwp) and with the operations of engines such as FullProf, GSAS-II and the authors' own PyWPEM, XMatcher, XQueryer-LW and XDecomposer tools.

Authors’ abstract

A central challenge for scientific agents is to turn analytical experience into reusable expertise grounded in physical evidence. Here we introduce Gan Jiang, a self-learning agent for powder X-ray diffraction built on a diffraction-analysis ecosystem we developed: XMatcher, XQueryer, XDecomposer and WPEM. Together, these engines span phase identification, multiphase decomposition and physics-constrained whole-pattern modelling. Gan Jiang converts analytical experience into executable skills by diagnosing failures, revising skill instructions and code, and validating revisions before reuse, without retraining the language model or changing the underlying physical models. Skills selected using development data and frozen before held-out evaluation achieve higher refinement scores than the original expert-designed skills across FullProf, GSAS-II and PyWPEM. The agent resolves strongly overlapping reflections, quantifies a five-phase ancient Egyptian cosmetic, tracks lattice evolution in an operating battery and compares atomic configurations in a disordered oxide catalyst. On DeltaXRDbench, it leads the evaluated methods in single- and multiphase identification across simulated and experimental data. Without supplied composition, single-phase top-1 accuracies reach 96.30\%, 81.78\% and 40.83\% on MP500, RRUFF and opXRD, respectively, compared with 58.00\%, 58.47\% and 26.45\% for the strongest comparator. These results demonstrate how an integrated scientific tool ecosystem can support agents that extract structural knowledge from measurements while accumulating validated analytical expertise that transfers to new samples.

Read the original paper