Abstract
Frustrated magnetic systems such as spin ice are key platforms for novel metamaterials. However, identifying their ground states in finite arrays is a formidable challenge, as boundary sensitivity and metastable states trap conventional optimization methods. We introduce a virtuous-cycle AI pipeline where a genetic algorithm explores the latent space of a variational autoencoder (VAE), with the best candidates progressively refining the VAE’s representation. Applied to Kagome spin ice, this method reveals how the boundary magnetism is determined: boundaries break the symmetry of the \(\sqrt{3\,}\times \sqrt{3\,}\) magnetic superstructure while the bulk superstructure order in the interior maintains. Furthermore, it demonstrates that high geometric confinement induces a novel quasi-ferromagnetic phase, which breaks the interior superstructure order. Our work provides a predictive framework for designing frustrated materials and demonstrates a powerful AI approach for boundary-sensitive physical systems.
Similar content being viewed by others
Code availability
The Python code used to implement the method in this study is available on GitHub (https://github.com/NanomagLab/Kagome-AI-Optimizer).
References
Barahona, F. On the computational complexity of ising spin glass models. J. Phys. A Math. Gen. 15, 3241–3253 (1982).
Fan, C. et al. Searching for spin glass ground states through deep reinforcement learning. Nat. Commun. 14, 725 (2023).
De Simone, C. et al. Exact ground states of Ising spin glasses: new experimental results with a branch-and-cut algorithm. J. Stat. Phys. 80, 487–496 (1995).
Monasson, R., Zecchina, R., Kirkpatrick, S., Selman, B. & Troyansky, L. Determining computational complexity from characteristic ‘phase transitions’. Nature 400, 133–137 (1999).
Hogg, T., Huberman, B. A. & Williams, C. P. Phase transitions and the search problem. Artif. Intell. 81, https://doi.org/10.1016/0004-3702(95)00044-5 (1996).
Heyderman, L. J. & Stamps, R. L. Artificial ferroic systems: novel functionality from structure, interactions and dynamics. J. Phys. Condensed Matter. 25, 363201 (2013).
Wang, R. F. et al. Artificial ‘spin ice’ in a geometrically frustrated lattice of nanoscale ferromagnetic islands. Nature 439, 303–306 (2006).
Skjærvø, S. H., Marrows, C. H., Stamps, R. L. & Heyderman, L. J. Advances in artificial spin ice. Nat. Rev. Phys. 2, 117 (2020).
Nisoli, C., Moessner, R. & Schiffer, P. Colloquium: artificial spin ice: designing and imaging magnetic frustration. Rev. Mod. Phys. 85, 1473–1490 (2013).
Rougemaille, N. & Canals, B. Cooperative magnetic phenomena in artificial spin systems: spin liquids, Coulomb phase and fragmentation of magnetism – a colloquium. Eur. Phys. J. B 92, 62 (2019).
Farhan, A. et al. Emergent magnetic monopole dynamics in macroscopically degenerate artificial spin ice. Sci. Adv. 5, eaav6380 (2019).
Mengotti, E. et al. Real-space observation of emergent magnetic monopoles and associated Dirac strings in artificial kagome spin ice. Nat. Phys. 7, 68–74 (2011).
Qi, Y., Brintlinger, T. & Cumings, J. Direct observation of the ice rule in an artificial kagome spin ice. Phys. Rev. B Condens. Matter Mater. Phys. 77, 094418 (2008).
Gilbert, I. et al. Emergent ice rule and magnetic charge screening from vertex frustration in artificial spin ice. Nat. Phys. 10, 670–675 (2014).
Canals, B. et al. Fragmentation of magnetism in artificial kagome dipolar spin ice. Nat. Commun. 7, 11446 (2016).
Chern, G. W., Mellado, P. & Tchernyshyov, O. Two-stage ordering of spins in dipolar spin ice on the kagome lattice. Phys. Rev. Lett. 106, 207202 (2011).
Carrasquilla, J. & Melko, R. G. Machine learning phases of matter. Nat. Phys. 13, 431–434 (2017).
Carleo, G. & Troyer, M. Solving the quantum many-body problem with artificial neural networks. Science (1979). 355, 602–606 (2017).
Wang, H. et al. Scientific discovery in the age of artificial intelligence. Nature 620, 47–60 (2023).
Wetzel, S. J. Unsupervised learning of phase transitions: from principal component analysis to variational autoencoders. Phys. Rev. E 96, 022140 (2017).
Carleo, G., Nomura, Y. & Imada, M. Constructing exact representations of quantum many-body systems with deep neural networks. Nat. Commun. 9, 5322 (2018).
Park, S. M. et al. Optimization of physical quantities in the autoencoder latent space. Sci. Rep. 12, 9003 (2022).
Li, J. et al. An auto-encoder with genetic algorithm for high dimensional data: towards accurate and interpretable outlier detection. Algorithms 15, 429 (2022).
Kwon, H. Y. et al. Searching for the ground state of complex spin-ice systems using deep learning techniques. Sci. Rep. 12, 15026 (2022).
Kwon, H. Y. et al. Magnetic state generation using Hamiltonian guided variational autoencoder with spin structure stabilization. Adv. Sci. 8, e2004795 (2021).
Kingma, D. P. & Welling, M. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, ICLR 2014 - Conference Track Proceedings https://doi.org/10.61603/ceas.v2i1.33 (2014).
Kingma, D. P. & Welling, M. An introduction to variational autoencoders. Found. Trends Mach. Learn. 12, https://doi.org/10.1561/2200000056 (2019).
Doersch, C. Variational autoencoders tutorial. Preprint at https://arxiv.org/abs/1606.05908 (2016).
Bojanowski, P., Joulin, A., Paz, D. L. & Szlam, A. Optimizing the latent space of generative networks. In 35th International Conference on Machine Learning vol. 2 (ICML, 2018).
Bentley, P. J., Lim, S. L., Gaier, A. & Tran, L. COIL: Constrained Optimization in Learned Latent Space: Learning Representations for Valid Solutions. In Proceedings of the Genetic and Evolutionary Computation Conference Companion, 1870–1877 (ACM, 2022).
Bentley, P. J., Lim, S. L., Gaier, A. & Tran, L. Evolving through the looking glass: learning improved search spaces with variational autoencoders. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) Vol. 13398 (LNCS, 2022).
Volz, V. et al. Evolving Mario levels in the latent space of a deep convolutional generative adversarial network. In GECCO 2018 - Proceedings of the 2018 Genetic and Evolutionary Computation Conference, https://doi.org/10.1145/3205455.3205517 (2018).
Rammal, A., Ezukwoke, K., Hoayek, A. & Batton-Hubert, M. Unsupervised approach for an optimal representation of the latent space of a failure analysis dataset. J. Supercomput. 80, 5923–5949 (2024).
Jiang, J., Kim, D., Kim, B. & Shin, Y. G. Enhancing local feature representation in VQ-VAE through genetic algorithm-based token optimization. IEEE Access 13, 34286–34295 (2025).
Wan, J., Chen, Y. & Gao, C. The VAE-FastGA anomaly detection model based on subspace and weakly correlated ultra-high-dimensional data. J. Supercomput. 81, 495 (2025).
Kincaid, R. K. & Ninh, A. Simulated annealing. In Springer Optimization and Its Applications 204, 221–249 (Springer, 2023).
Tripp, A., Daxberger, E. & Hernández-Lobato, J. M. Sample-efficient optimization in the latent space of deep generative models via weighted retraining. In Advances in Neural Information Processing Systems, Vol. 2020 (NIPS, 2020).
Lookman, T., Balachandran, P. V., Xue, D. & Yuan, R. Active learning in materials science with emphasis on adaptive sampling using uncertainties for targeted design. npj Comput. Mater. 5, https://doi.org/10.1038/s41524-019-0153-8 (2019).
Gartside, J. C. et al. Realization of ground state in artificial kagome spin ice via topological defect-driven magnetic writing. Nat. Nanotechnol. 13, 53–58 (2018).
Zhao, K. et al. Realization of the kagome spin ice state in a frustrated intermetallic compound. Science 367, 1218–1223 (2020).
Basak, A. A rank based adaptive mutation in genetic algorithm. Int. J. Comput. Appl. 175, 49–55 (2020).
Bermúdez, M. M., Borzi, R. A., Tennant, D. A. & Grigera, S. A. Low-temperature state of the spin-ice material Dy2Ti2O7: reverse Monte Carlo investigation. Phys. Rev. B 112, 094431 (2025).
Yavors’kii, T., Fennell, T., Gingras, M. J. P. & Bramwell, S. T. Dy2Ti2O7 spin ice: a test case for emergent clusters in a frustrated magnet. Phys. Rev. Lett. 101, 037204 (2008).
Borzi, R. A. et al. Intermediate magnetization state and competing orders in Dy2Ti2O7 and Ho2Ti2O7. Nat. Commun. 7, 12592 (2016).
Samarakoon, A. M. et al. Machine-learning-assisted insight into spin ice Dy2Ti2O7. Nat. Commun. 11, 892 (2020).
Henelius, P. et al. Refrustration and competing orders in the prototypical Dy2Ti2O7 spin ice material. Phys. Rev. B 93, 024402 (2016).
Acknowledgements
This research was supported by the National Research Foundation (NRF) of Korea funded by the Korean Government (NRF-2023R1A2C1006050) and (NRF-2021R1C1C2093113).
Author information
Authors and Affiliations
Contributions
T.J.M. developed the algorithms and performed the experiments. The main results were discussed and interpreted with contributions from S.M.P., H.G.Y., H.Y.K., and C.W. The research was supervised jointly by H.Y.K. and C.W. All authors contributed to the final version of the manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Moon, T.J., Park, S.M., Yoon, H.G. et al. Boundary sensitivity in finite-sized artificial spin ice explored via AI-assisted genetic algorithms. npj Comput Mater (2026). https://doi.org/10.1038/s41524-026-02016-x
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41524-026-02016-x


