Neural Network Decoders for Large-Distance 2D Toric Codes

Xiaotong Ni

QuTech, Delft University of Technology, P.O.Box 5046, 2600 GA Delft, The Netherlands.

Find this paper interesting or want to discuss? Scite or leave a comment on SciRate.

Abstract

We still do not have perfect decoders for topological codes that can satisfy all needs of different experimental setups. Recently, a few neural network based decoders have been studied, with the motivation that they can adapt to a wide range of noise models, and can easily run on dedicated chips without a full-fledged computer. The later feature might lead to fast speed and the ability to operate at low temperatures. However, a question which has not been addressed in previous works is whether neural network decoders can handle 2D topological codes with large distances. In this work, we provide a positive answer for the toric code [1]. The structure of our neural network decoder is inspired by the renormalization group decoder [2,3]. With a fairly strict policy on training time, when the bit-flip error rate is lower than $9\%$ and syndrome extraction is perfect, the neural network decoder performs better when code distance increases. With a less strict policy, we find it is not hard for the neural decoder to achieve a performance close to the minimum-weight perfect matching algorithm. The numerical simulation is done up to code distance $d=64$. Last but not least, we describe and analyze a few failed approaches. They guide us to the final design of our neural decoder, but also serve as a caution when we gauge the versatility of stock deep neural networks. The source code of our neural decoder can be found at [4].

► BibTeX data

► References

[1] A.Yu. Kitaev. Fault-tolerant quantum computation by anyons. Annals of Physics, 303 (1): 2–30, jan 2003. 10.1016/​s0003-4916(02)00018-0.
https:/​/​doi.org/​10.1016/​s0003-4916(02)00018-0

[2] Guillaume Duclos-Cianci and David Poulin. Fast decoders for topological quantum codes. Physical review letters, 104 (5): 050504, 2010. 10.1103/​PhysRevLett.104.050504.
https:/​/​doi.org/​10.1103/​PhysRevLett.104.050504

[3] Guillaume Duclos-Cianci and David Poulin. Fault-tolerant renormalization group decoder for abelian topological codes. Quantum Information & Computation, 14 (9-10): 721–740, 2014.

[4] https:/​/​github.com/​XiaotongNi/​toric-code-neural-decoder.
https:/​/​github.com/​XiaotongNi/​toric-code-neural-decoder

[5] Paul Baireuther, Thomas E. O'Brien, Brian Tarasinski, and Carlo W. J. Beenakker. Machine-learning-assisted correction of correlated qubit errors in a topological code. Quantum, 2: 48, jan 2018. 10.22331/​q-2018-01-29-48.
https:/​/​doi.org/​10.22331/​q-2018-01-29-48

[6] Savvas Varsamopoulos, Ben Criger, and Koen Bertels. Decoding small surface codes with feedforward neural networks. Quantum Science and Technology, 3 (1): 015004, nov 2017. 10.1088/​2058-9565/​aa955a.
https:/​/​doi.org/​10.1088/​2058-9565/​aa955a

[7] Giacomo Torlai and Roger G Melko. A neural decoder for topological codes. Physical Review Letters, 119 (3): 030501, 2017. 10.1103/​PhysRevLett.119.030501.
https:/​/​doi.org/​10.1103/​PhysRevLett.119.030501

[8] Nikolas P. Breuckmann and Xiaotong Ni. Scalable neural network decoders for higher dimensional quantum codes. Quantum, 2: 68, may 2018. 10.22331/​q-2018-05-24-68.
https:/​/​doi.org/​10.22331/​q-2018-05-24-68

[9] Paul Baireuther, MD Caio, B Criger, Carlo WJ Beenakker, and Thomas E O’Brien. Neural network decoder for topological color codes with circuit level noise. New Journal of Physics, 21 (1): 013003, 2019. 10.1088/​1367-2630/​aaf29e.
https:/​/​doi.org/​10.1088/​1367-2630/​aaf29e

[10] Stefan Krastanov and Liang Jiang. Deep neural network probabilistic decoder for stabilizer codes. Scientific Reports, 7 (1), sep 2017. 10.1038/​s41598-017-11266-1.
https:/​/​doi.org/​10.1038/​s41598-017-11266-1

[11] Nishad Maskara, Aleksander Kubica, and Tomas Jochym-O'Connor. Advantages of versatile neural-network decoding for topological codes. Physical Review A, 99 (5): 052351, 2019. 10.1103/​PhysRevA.99.052351.
https:/​/​doi.org/​10.1103/​PhysRevA.99.052351

[12] Christopher Chamberland and Pooya Ronagh. Deep neural decoders for near term fault-tolerant experiments. Quantum Science and Technology, 3 (4): 044002, jul 2018. 10.1088/​2058-9565/​aad1f7.
https:/​/​doi.org/​10.1088/​2058-9565/​aad1f7

[13] Yann LeCun et al. Generalization and network design strategies. Connectionism in perspective, pages 143–155, 1989.

[14] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 1097–1105. Curran Associates, Inc., 2012.

[15] Alexandre Attia and Sharone Dayan. Global overview of imitation learning. 2018. URL https:/​/​arxiv.org/​abs/​1801.06503.
arXiv:1801.06503

[16] Eliya Nachmani, Yair Be'ery, and David Burshtein. Learning to decode linear codes using deep learning. In 2016 54th Annual Allerton Conference on Communication, Control, and Computing (Allerton). IEEE, sep 2016. 10.1109/​allerton.2016.7852251.
https:/​/​doi.org/​10.1109/​allerton.2016.7852251

[17] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. 2015. URL https:/​/​arxiv.org/​abs/​1502.03167.
arXiv:1502.03167

[18] Norman P. Jouppi, Al Borchers, Rick Boyle, Pierre luc Cantin, Clifford Chao, Chris Clark, Jeremy Coriell, Mike Daley, Matt Dau, Jeffrey Dean, Ben Gelb, Cliff Young, Tara Vazir Ghaemmaghami, Rajendra Gottipati, William Gulland, Robert Hagmann, C. Richard Ho, Doug Hogberg, John Hu, Robert Hundt, Dan Hurt, Julian Ibarz, Nishant Patil, Aaron Jaffey, Alek Jaworski, Alexander Kaplan, Harshit Khaitan, Daniel Killebrew, Andy Koch, Naveen Kumar, Steve Lacy, James Laudon, James Law, David Patterson, Diemthu Le, Chris Leary, Zhuyuan Liu, Kyle Lucke, Alan Lundin, Gordon MacKean, Adriana Maggiore, Maire Mahony, Kieran Miller, Rahul Nagarajan, Gaurav Agrawal, Ravi Narayanaswami, Ray Ni, Kathy Nix, Thomas Norrie, Mark Omernick, Narayana Penukonda, Andy Phelps, Jonathan Ross, Matt Ross, Amir Salek, Raminder Bajwa, Emad Samadiani, Chris Severn, Gregory Sizikov, Matthew Snelham, Jed Souter, Dan Steinberg, Andy Swing, Mercedes Tan, Gregory Thorson, Bo Tian, Sarah Bates, Horia Toma, Erick Tuttle, Vijay Vasudevan, Richard Walter, Walter Wang, Eric Wilcox, Doe Hyun Yoon, Suresh Bhatia, and Nan Boden. In-datacenter performance analysis of a tensor processing unit. In Proceedings of the 44th Annual International Symposium on Computer Architecture - ISCA '17. ACM Press, 2017. 10.1145/​3079856.3080246.
https:/​/​doi.org/​10.1145/​3079856.3080246

[19] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dandelion Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL https:/​/​www.tensorflow.org/​. Software available from tensorflow.org.
https:/​/​www.tensorflow.org/​

[20] I. D. Conway Lamb, J. I. Colless, J. M. Hornibrook, S. J. Pauka, S. J. Waddy, M. K. Frechtling, and D. J. Reilly. An FPGA-based instrumentation platform for use at deep cryogenic temperatures. Review of Scientific Instruments, 87 (1): 014701, jan 2016. 10.1063/​1.4939094.
https:/​/​doi.org/​10.1063/​1.4939094

[21] Yu Cheng, Duo Wang, Pan Zhou, and Tao Zhang. Model compression and acceleration for deep neural networks: The principles, progress, and challenges. IEEE Signal Processing Magazine, 35 (1): 126–136, jan 2018. 10.1109/​msp.2017.2765695.
https:/​/​doi.org/​10.1109/​msp.2017.2765695

[22] Vladimir Kolmogorov. Blossom v: a new implementation of a minimum cost perfect matching algorithm. Mathematical Programming Computation, 1 (1): 43–67, apr 2009. 10.1007/​s12532-009-0002-8.
https:/​/​doi.org/​10.1007/​s12532-009-0002-8

[23] Aric Hagberg, Dan Schult, Pieter Swart, et al. Networkx, 2004–. URL https:/​/​networkx.github.io/​.
https:/​/​networkx.github.io/​

[24] Gabriel Goh. Why momentum really works. Distill, 2017. 10.23915/​distill.00006.
https:/​/​doi.org/​10.23915/​distill.00006

[25] Yoshua Bengio and Yann LeCun. Scaling learning algorithms towards ai. Large-scale kernel machines, 34 (5): 1–41, 2007.

[26] Dumitru Erhan, Yoshua Bengio, Aaron Courville, Pierre-Antoine Manzagol, Pascal Vincent, and Samy Bengio. Why does unsupervised pre-training help deep learning? Journal of Machine Learning Research, 11 (Feb): 625–660, 2010.

[27] Andrew L Maas, Awni Y Hannun, and Andrew Y Ng. Rectifier nonlinearities improve neural network acoustic models. In Proceedings of the 30th International Conference on Machine Learning, volume 28 of JMLR Workshop and Conference Proceedings, Atlanta, Georgia, USA, 2013.

[28] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 3rd International Conference for Learning Representations, San Diego, 2015. URL https:/​/​arxiv.org/​abs/​1412.6980.
arXiv:1412.6980

Cited by

[1] Andrew S. Darmawan, "Optimal adaptation of surface-code decoders to local noise", Physical Review A 112 4, 042431 (2025).

[2] Robert Joo, "Decoding the surface code with a spatio-temporal transformer", EPJ Quantum Technology 13 1, 52 (2026).

[3] Volodymyr Sivak, Michael Newman, and Paul Klimov, "Optimization of Decoder Priors for Accurate Quantum Error Correction", Physical Review Letters 133 15, 150603 (2024).

[4] Johannes Bausch, Andrew W. Senior, Francisco J. H. Heras, Thomas Edlich, Alex Davies, Michael Newman, Cody Jones, Kevin Satzinger, Murphy Yuezhen Niu, Sam Blackwell, George Holland, Dvir Kafri, Juan Atalaya, Craig Gidney, Demis Hassabis, Sergio Boixo, Hartmut Neven, and Pushmeet Kohli, "Learning high-accuracy error decoding for quantum processors", Nature 635 8040, 834 (2024).

[5] Naihua Ji, Zhao Chen, Yingjie Qu, Rongyi Bao, Xin Yang, and Shumei Wang, "Fault-tolerant quaternary belief propagation decoding based on a neural network", Frontiers in Physics 11, 1164567 (2023).

[6] S. Varona and M. A. Martin-Delgado, "Determination of the semion code threshold using neural decoders", Physical Review A 102 3, 032411 (2020).

[7] Nai-Hua 乃华 Ji 纪, Ping-Li 平俐 Song 宋, Wei 伟 Wang 王, Hui-Qian 汇倩 Sun 孙, and Hong-Yang 鸿洋 Ma 马, "Quantum toric code decoding method based on syndrome-preliminary error fusion module and ResNet architecture", Chinese Physics B 35 6, 060303 (2026).

[8] Thomas Wagner, Hermann Kampermann, and Dagmar Bruß, "Symmetries for a high-level neural decoder on the toric code", Physical Review A 102 4, 042411 (2020).

[9] Juan Carrasquilla and Giacomo Torlai, "How To Use Neural Networks To Investigate Quantum Many-Body Physics", PRX Quantum 2 4, 040201 (2021).

[10] Antonio deMarti iOlius, Patricio Fuentes, Román Orús, Pedro M. Crespo, and Josu Etxezarreta Martinez, "Decoding algorithms for surface codes", Quantum 8, 1498 (2024).

[11] Boris M. Varbanov, Marc Serra-Peralta, David Byfield, and Barbara M. Terhal, "Neural network decoder for near-term surface-code experiments", Physical Review Research 7 1, 013029 (2025).

[12] John Blue, Harshil Avlani, Zhiyang He, Liu Ziyin, and Isaac L. Chuang, "Machine Learning Decoding of Circuit-Level Noise for Bivariate Bicycle Codes", Quantum 10, 2149 (2026).

[13] Brhyeton Hall, Spiro Gicev, and Muhammad Usman, "Artificial neural network syndrome decoding on IBM quantum processors", Physical Review Research 6 3, L032004 (2024).

[14] Arshpreet Singh Maan and Alexandru Paler, "Machine learning message-passing for the scalable decoding of QLDPC codes", npj Quantum Information 11 1, 78 (2025).

[15] F Battistel, C Chamberland, K Johar, R W J Overwater, F Sebastiano, L Skoric, Y Ueno, and M Usman, "Real-time decoding for fault-tolerant quantum computing: progress, challenges and outlook", Nano Futures 7 3, 032003 (2023).

[16] Ritajit Majumdar, Amit Saha, Amlan Chakrabarti, and Susmita Sur-Kolay, "Intermediate qutrit-assisted Toffoli gate decomposition with quantum error correction", Quantum Information Processing 23 2, 42 (2024).

[17] Julien du Crest, Francisco Garcia-Herrero, Mehdi Mhalla, Valentin Savin, and Javier Valls, "Check-Agnosia based Post-Processor for Message-Passing Decoding of Quantum LDPC Codes", Quantum 8, 1334 (2024).

[18] Kai Meinerz, Chae-Yeun Park, and Simon Trebst, "Scalable Neural Decoder for Topological Surface Codes", Physical Review Letters 128 8, 080505 (2022).

[19] Ramon W. J. Overwater, Masoud Babaie, and Fabio Sebastiano, "Neural-Network Decoders for Quantum Error Correction Using Surface Codes: A Space Exploration of the Hardware Cost-Performance Tradeoffs", IEEE Transactions on Quantum Engineering 3, 1 (2022).

[20] Simone Bordoni and Stefano Giagu, "Convolutional neural network based decoders for surface codes", Quantum Information Processing 22 3, 151 (2023).

[21] Christopher Chamberland, Luis Goncalves, Prasahnt Sivarajah, Eric Peterson, and Sebastian Grimberg, "Techniques for combining fast local decoders with global decoders under circuit-level noise", Quantum Science and Technology 8 4, 045011 (2023).

[22] Ziyao Zhao, 2025 7th International Conference on Next Generation Data-driven Networks (NGDN) 410 (2025) ISBN:979-8-3315-5374-6.

[23] Ying-Jie 英杰 Qu 曲, Zhao 钊 Chen 陈, Wei-Jie 伟杰 Wang 王, and Hong-Yang 鸿洋 Ma 马, "Approximate error correction scheme for three-dimensional surface codes based reinforcement learning", Chinese Physics B 32 10, 100307 (2023).

[24] Jiahan Chen, Zhengzhong Yi, Zhipeng Liang, and Xuan Wang, "Improved Belief Propagation Decoding Algorithms for Surface Codes", IEEE Transactions on Quantum Engineering 6, 1 (2025).

[25] Spiro Gicev, Lloyd C L Hollenberg, and Muhammad Usman, "Fully convolutional 3D neural network decoders for surface codes with syndrome circuit noise", Quantum Science and Technology 11 2, 025048 (2026).

[26] Spiro Gicev, Lloyd C. L. Hollenberg, and Muhammad Usman, "A scalable and fast artificial neural network syndrome decoder for surface codes", Quantum 7, 1058 (2023).

[27] Karl Hammar, Alexei Orekhov, Patrik Wallin Hybelius, Anna Katariina Wisakanto, Basudha Srivastava, Anton Frisk Kockum, and Mats Granath, "Error-rate-agnostic decoding of topological stabilizer codes", Physical Review A 105 4, 042616 (2022).

[28] Zaixu Fan, Cewen Tian, Bo Xiao, and Hongyang Ma, "A Hybrid Architecture Decoder Integrating Kolmogorov-Arnold Network and Transformer for Decoding Rotating Surface Codes", International Journal of Theoretical Physics 64 11, 313 (2025).

[29] Hugo Théveniaut and Everard van Nieuwenburg, "A NEAT quantum error decoder", SciPost Physics 11 1, 005 (2021).

[30] Moritz Lange, Pontus Havström, Basudha Srivastava, Isak Bengtsson, Valdemar Bergentall, Karl Hammar, Olivia Heuts, Evert van Nieuwenburg, and Mats Granath, "Data-driven decoding of quantum error correcting codes using graph neural networks", Physical Review Research 7 2, 023181 (2025).

[31] J. Pablo Bonilla Ataides, Andi Gu, Susanne F. Yelin, and Mikhail D. Lukin, "Neural Decoders for Universal Quantum Algorithms", PRX Intelligence 1 1, 013008 (2026).

[32] Hendrik Poulsen Nautrup, Nicolas Delfosse, Vedran Dunjko, Hans J. Briegel, and Nicolai Friis, "Optimizing Quantum Error Correction Codes with Reinforcement Learning", Quantum 3, 215 (2019).

[33] Christopher T. Chubb, "General tensor network decoding of 2D Pauli codes", arXiv:2101.04125, (2021).

[34] Philip Andreasson, Joel Johansson, Simon Liljestrand, and Mats Granath, "Quantum error correction for the toric code using deep reinforcement learning", Quantum 3, 183 (2019).

[35] Agnes Valenti, Evert van Nieuwenburg, Sebastian Huber, and Eliska Greplova, "Hamiltonian learning for quantum error correction", Physical Review Research 1 3, 033092 (2019).

[36] Ye-Hua Liu and David Poulin, "Neural Belief-Propagation Decoders for Quantum Error-Correcting Codes", Physical Review Letters 122 20, 200501 (2019).

[37] Poulami Das, Christopher A. Pattison, Srilatha Manne, Douglas Carmean, Krysta Svore, Moinuddin Qureshi, and Nicolas Delfosse, "A Scalable Decoder Micro-architecture for Fault-Tolerant Quantum Computing", arXiv:2001.06598, (2020).

[38] Ryan Sweke, Markus S. Kesselring, Evert P. L. van Nieuwenburg, and Jens Eisert, "Reinforcement Learning Decoders for Fault-Tolerant Quantum Computation", arXiv:1810.07207, (2018).

[39] Nicolas Delfosse, "Hierarchical decoding to reduce hardware requirements for quantum computing", arXiv:2001.11427, (2020).

[40] David Fitzek, Mattias Eliasson, Anton Frisk Kockum, and Mats Granath, "Deep Q-learning decoder for depolarizing noise on the toric code", Physical Review Research 2 2, 023230 (2020).

[41] Nishad Maskara, Aleksander Kubica, and Tomas Jochym-O'Connor, "Advantages of versatile neural-network decoding for topological codes", Physical Review A 99 5, 052351 (2019).

[42] Lingling Lao and Carmen G. Almudever, "Fault-tolerant quantum error correction on near-term quantum processors using flag and bridge qubits", Physical Review A 101 3, 032333 (2020).

[43] Savvas Varsamopoulos, Koen Bertels, and Carmen Garcia Almudever, "Comparing Neural Network Based Decoders for the Surface Code", IEEE Transactions on Computers 69 2, 300 (2020).

[44] Evgenii Egorov, Roberto Bondesan, and Max Welling, "The END: An Equivariant Neural Decoder for Quantum Error Correction", arXiv:2304.07362, (2023).

[45] Savvas Varsamopoulos, Koen Bertels, and Carmen G. Almudever, "Decoding surface code with a distributed neural network based decoder", arXiv:1901.10847, (2019).

[46] Savvas Varsamopoulos, Koen Bertels, and Carmen G. Almudever, "Comparing neural network based decoders for the surface code", arXiv:1811.12456, (2018).

[47] Milap Sheth, Sara Zafar Jafarzadeh, and Vlad Gheorghiu, "Neural ensemble decoding for topological quantum error-correcting codes", Physical Review A 101 3, 032338 (2020).

[48] Narges Alavisamani, Suhas Vittal, Ramin Ayanzadeh, Poulami Das, and Moinuddin Qureshi, "Promatch: Extending the Reach of Real-Time Quantum Error Correction with Adaptive Predecoding", arXiv:2404.03136, (2024).

[49] Chaitanya Chinni, Abhishek Kulkarni, Dheeraj M. Pai, Kaushik Mitra, and Pradeep Kiran Sarvepalli, "Neural Decoder for Topological Codes using Pseudo-Inverse of Parity Check Matrix", arXiv:1901.07535, (2019).

[50] Evan Peters, "Importance sampling for data-driven decoding of quantum error-correcting codes", arXiv:2505.22741, (2025).

The above citations are from Crossref's cited-by service (last updated successfully 2026-08-09 03:22:31) and SAO/NASA ADS (last updated successfully 2026-08-09 03:22:32). The list may be incomplete as not all publishers provide suitable and complete citation data.