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.

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 state-of-the-art algorithm for inorganic crystal structure prediction (CSP).1 We call the loop HACO, short for Human–AI Co-discovery system.

Among reported human–AI co-discovery results, MaskGXT is the first we know of to produce a competitive generative deep-learning algorithm for a mature scientific ML benchmark. HACO, our Human–AI Co-discovery system, searched across complete CSP methods with sparse human steering rather than tuning a fixed architecture. MaskGXT is the masked-generation branch that survived validation and turned MaskGIT-style parallel decoding into a crystal-generation algorithm.

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

The result: benchmark evidence

The benchmark comparison is below. MaskGXT wins the 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

MaskGXT benchmark results. Bars summarize the main paper's filtered standard-CSP scores and held-out METRe scores; higher is better for MR and METRe, lower is better for RMSE and cRMSE. MaskGXT wins the match-rate and METRe columns, with its largest margin on the MP-20 polymorph split.

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.

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 did not end at one impressive chat response. It 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, research ideas became measurable bets rather than prose suggestions.

The resulting algorithm: 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.