Human–AI Co-Discovery of a State-of-the-Art Crystal Structure Prediction Algorithm

How HACO, a Human–AI Co-discovery system, produced MaskGXT, a competitive generative model for crystal structure prediction.

Materials Science ai-scientist generative-models crystal-structure-prediction materials masked-generative-models

On this page
Conceptual illustration linking masked image patches with partially filled crystal lattice sites.
Conceptual illustration: MaskGIT transferred into CSP. HACO moved masked generation from vision to crystal structure prediction: fill in the sites of a crystal lattice through iterative unmasking.

In our recent work, a human–AI co-scientist loop produced MaskGXT, a competitive algorithm for inorganic crystal structure prediction (CSP).1 We call the loop HACO, short for Human–AI Co-discovery system.

HACO searched across complete CSP methods with sparse human steering. MaskGXT emerged from its masked-generation branch, which adapted MaskGIT-style decoding to crystal representations and survived repeated validation. The evidence below concerns this search and its evaluated benchmarks, not a general claim that agents can independently solve scientific discovery.

The preprint is now on arXiv. We also release code for both the HACO search loop and MaskGXT.

The result: benchmark evidence

In the paper’s benchmark comparison below, MaskGXT leads the evaluated standard match-rate columns, and its largest advantage appears in polymorph-aware evaluation, where the model must recover multiple structures that can arise from the same chemical composition (Martirossyan et al., 2025).2

MP-20 crystal match rates across six models, with MaskGXT highest at 67.1 percent.
MP-20 geometric RMSE across six models, with MaskGXT at 0.0325.
MPTS-52 crystal match rates across six models, with MaskGXT highest at 33.3 percent.
MPTS-52 geometric RMSE, where Crystalite is lower than MaskGXT.
MP-20 METRe coverage, with MaskGXT highest at 74.8 percent.
MP-20 coverage-adjusted RMSE, with MaskGXT lowest at 0.152.
Polymorph-split METRe coverage, with MaskGXT at 79.1 percent versus 70.9 percent for Crystalite.
Polymorph-split coverage-adjusted RMSE, with MaskGXT lowest at 0.132.
MaskGXT benchmark results. Panels reproduce the paper’s filtered standard-CSP and held-out METRe comparisons. Higher MR and METRe are better; lower RMSE and cRMSE are better. Purple marks MaskGXT. It leads the evaluated match-rate and METRe columns, but Crystalite has lower MPTS-52 RMSE. Values are rounded for display. Combined chart.

On the MP-20 polymorph split, MaskGXT raises METRe from 70.87% to 79.06%.

CSP is already a crowded and technically mature benchmark. Learned crystal generation has moved from early diffusion-based models such as CDVAE (Xie et al., 2022) and DiffCSP (Jiao et al., 2023), to flow-based and stochastic-interpolant approaches such as FlowMM (Miller et al., 2024), OMatG (Hoellmer et al., 2025), and MCFlow (Seong et al., 2026).

In parallel, symmetry-aware methods have explicitly incorporated space groups, Wyckoff positions, and crystallographic constraints, as in DiffCSP++ (Jiao et al., 2024), Wyckoff Transformer (Kazeev et al., 2025), SymmCD (Levy et al., 2025), and CrystalFormer (Cao et al., 2025). This is only a selective snapshot; many relevant works remain outside this short list. MaskGXT was competing against several years of domain-specific architecture design and generative-model development.

How HACO worked

Recent AI-for-science systems already show that language-model agents can help with scientific search. FunSearch (Romera-Paredes et al., 2024) and AlphaEvolve (Novikov et al., 2025) demonstrated program search for mathematical and algorithmic discovery. The AI Scientist (Lu et al., 2024; Yamada et al., 2025), AIDE (Jiang et al., 2025), and Google’s AI co-scientist (Gottweis et al., 2025) pushed toward hypothesis generation, code-level experimentation, and automated research workflows.

The HACO loop. A tree-structured search organizes candidate CSP methods; each node is a complete generative model. The tree grows as idea, draft, debug, and improve operators are applied, while human input enters only sparsely as high-level mechanisms or objectives.

HACO used familiar agent machinery: a tree of candidate methods, operators for idea generation, drafting, debugging, and improvement, executable experiments, and score-based selection. We did not ask it to tune a known CSP architecture. We asked it to search for a generative modeling principle that could transfer into CSP. Each node represented a complete CSP method, trained under a fixed budget and scored by validation METRe.

Most branches did not survive validation. Autoregressive formulations were easy to instantiate but did not give the polymorph coverage we needed. Several continuous-interpolant ideas looked plausible on paper but were too expensive or unstable under the search budget. The MaskGIT branch was not obvious at the start; under the budget it combined parallel generation, discrete symmetry-aware representations, and a clean validation signal.

The exploration covered fourteen cross-domain frameworks, including autoregressive transformers from language modeling, masked generative transformers from vision, and state-space interpolants from sequence modeling. The MaskGIT branch survived repeated validation, absorbed the crystallographic mechanisms suggested during the search, and eventually became MaskGXT.

Explore the full HACO search tree below.

Validation METRe rises along a roughly five-hundred-trial search, with agent changes and human interventions annotated.
The research trajectory toward MaskGXT. Validation METRe against the number of trials; the black step line is the running best. The three shaded bands are the search stages, with the per-candidate budget escalating from 2h to 12h training and then 30m of sampling tuning.

The search ran as an empirical process: propose a mechanism, write runnable code, train it, inspect the result, preserve what worked, and try again. Across roughly five hundred trials, candidate methods were compared through executable experiments.

The resulting algorithm: MaskGXT

Crystal tokenization, masked-token training, and space-group-stratified decoding in MaskGXT.
How MaskGXT works. (a) Tokenizing a crystal: one space group token, six lattice tokens, and five tokens per atom site. (b) Training reconstructs randomly masked tokens. (c) Sampling branches over space groups to cover polymorphs, then greedily unmasks the rest.

Explore crystal structures sampled by MaskGXT from the MP-20 polymorph split test set.

The key transfer came from MaskGIT (Chang et al., 2022), a masked generative model originally developed for image generation. HACO turned this idea into MaskGXT by representing a crystal as a sequence of discrete tokens: space group, lattice parameters, fractional coordinates, Wyckoff positions, and atom types.3 During training, the model randomly masks part of this sequence and learns to reconstruct the missing tokens. At sampling time, a transformer fills in the missing tokens through masked parallel decoding.

That description makes the transfer sound cleaner than it was. Crystals are periodic, symmetry-redundant, and polymorphic: the same composition can form multiple valid structures, and the same structure can be written in many equivalent coordinate systems. MaskGXT had to make masked generation work under those constraints.

The main algorithmic move came from the agent: recast CSP as masked discrete token generation. Once that branch survived validation, HACO refined it with periodic ordinal smoothing, confidence-ranked greedy decoding, and the Transformer scaling choices that made the branch competitive.

Human steering entered more sparsely. We pointed the search toward crystallographic structure where the agent lacked domain priors: explicit space-group and Wyckoff tokens, symmetry-preserving orbit permutation, polymorph coverage through space-group-stratified sampling, and an objective to recover sub-bin coordinate precision. The agent then implemented these ideas, tested them, and kept the versions that improved validation METRe.

MaskGXT should be read as a co-discovered method. The agent found the masked generation lineage and did most of the implementation-level development; humans supplied a few crystallographic mechanisms and objectives at the points where domain knowledge mattered.

Conclusion

MaskGXT does not settle whether current systems can do science autonomously. It shows a narrower result: if the design space is searchable, the evaluation loop is cheap enough, and the metric points in the right direction, an AI co-scientist can help find a real algorithm rather than only write code around one.

CSP had the right ingredients for this kind of loop: fixed data, executable models, training runs measured in hours, and validation METRe, a metric close enough to final performance to discard weak branches and keep improving the MaskGIT lineage. For less mature domains, the first hard problem may be the evaluation protocol: cheap surrogates, small-scale experiments, predictive scaling laws, or proxy tasks that are faithful enough to guide repeated search. Without that pressure signal, an agent can generate many plausible ideas without learning which ones matter.

As implementation and search get cheaper, the human role shifts toward designing the loop: choosing the problem, constructing the metric, supplying missing domain mechanisms, catching misleading evidence, and deciding when the objective should change. The next bottleneck is attention. A single run can produce hundreds of hypotheses, code variants, logs, plots, and failures, so useful systems will need a compact research state that tracks what was tried, why it failed, and which decisions still require human judgment.

References

  • Cao, Z., Luo, X., Lv, J. & Wang, L. (2025). Space Group Informed Transformer for Crystalline Materials Generation. Science Bulletin.
  • Chang, H., Zhang, H., Jiang, L., Liu, C. & Freeman, W. T. (2022). MaskGIT: Masked Generative Image Transformer. CVPR 2022.
  • Gottweis, J., et al. (2025). Towards an AI Co-Scientist. arXiv:2502.18864.
  • Hoellmer, P., et al. (2025). Open Materials Generation with Stochastic Interpolants. ICML 2025.
  • Jiang, Z., et al. (2025). AIDE: AI-Driven Exploration in the Space of Code. arXiv:2502.13138.
  • Jiao, R., et al. (2023). Crystal Structure Prediction by Joint Equivariant Diffusion (DiffCSP). NeurIPS 2023.
  • Jiao, R., Huang, W., Liu, Y., Zhao, D. & Liu, Y. (2024). Space Group Constrained Crystal Generation (DiffCSP++). ICLR 2024.
  • Kazeev, N., et al. (2025). Wyckoff Transformer: Generation of Symmetric Crystals (WyFormer). ICML 2025.
  • Kelvinius, F. E., et al. (2025). WyckoffDiff: A Generative Diffusion Model for Crystal Symmetry. ICML 2025.
  • Levy, D., et al. (2025). SymmCD: Symmetry-Preserving Crystal Generation with Diffusion Models. ICLR 2025.
  • Lu, C., Lu, C., Lange, R. T., Foerster, J., Clune, J. & Ha, D. (2024). The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery. arXiv:2408.06292.
  • Luo, X., Wang, Z., Lv, J., Wang, L., Wang, Y. & Ma, Y. (2025). CrystalFlow: A Flow-Based Generative Model for Crystalline Materials. Nature Communications.
  • Martirossyan, M. M., et al. (2025). All That Structure Matches Does Not Glitter (METRe). NeurIPS 2025.
  • Miller, B. K., Chen, R. T. Q., Sriram, A. & Wood, B. M. (2024). FlowMM: Generating Materials with Riemannian Flow Matching. ICML 2024.
  • Novikov, A., et al. (2025). AlphaEvolve: A Coding Agent for Scientific and Algorithmic Discovery. arXiv:2506.13131.
  • Romera-Paredes, B., et al. (2024). Mathematical Discoveries from Program Search with Large Language Models. Nature.
  • Seong, K., Ahn, S., Han, S. & Park, C. (2026). Multimodal Crystal Flow: Any-to-Any Modality Generation for Unified Crystal Modeling (MCFlow). arXiv:2602.20210.
  • Veljković, T. H., Rosenthal, J., Lončarić, I. & van de Meent, J.-W. (2026). Crystalite: A Lightweight Transformer for Efficient Crystal Modeling. arXiv:2604.02270.
  • Xie, T., Fu, X., Ganea, O.-E., Barzilay, R. & Jaakkola, T. (2022). Crystal Diffusion Variational Autoencoder for Periodic Material Generation (CDVAE). ICLR 2022.
  • Yamada, Y., Lange, R. T., Lu, C., Hu, S., Lu, C., Foerster, J., Clune, J. & Ha, D. (2025). The AI Scientist-v2: Workshop-Level Automated Scientific Discovery via Agentic Tree Search. arXiv:2504.08066.
  • Zeni, C., et al. (2025). MatterGen: A Generative Model for Inorganic Materials Design. Nature.
  • Zhu, R., Nong, W., Yamazaki, S. & Hippalgaonkar, K. (2024). WyCryst: Wyckoff Inorganic Crystal Generator Framework. Matter.

  1. Here, CSP means generating plausible inorganic crystal structures from chemical compositions. It is narrower than exhaustive first-principles search over all possible structures. 

  2. A composition can crystallize into several stable structures, or polymorphs. Match rate asks for one correct structure; METRe (match-everyone-to-reference) is stricter, rewarding recovery of all of a composition’s polymorphs. The polymorph split is designed to stress this setting, and it is where MaskGXT’s margin is widest. cRMSE combines coverage and geometric error by assigning unmatched references the matching tolerance. 

  3. A space group describes the symmetry operations of a crystal. Wyckoff positions describe symmetry-equivalent sites inside that space group, so they provide a compact way to represent crystallographic constraints.