# Teaching AI to Catch Quantum Errors

By Christian Perez, published 2026-10-30

Canonical: https://quantumdev.io/blog/teaching-ai-to-catch-quantum-errors/

How AWS trained NVIDIA's AI pre-decoder for quantum error correction on EC2 GPUs, cutting decoding latency 2.4 to 2.9 times, and what it means for builders.

## The Short Version

The AWS Quantum Technologies team trained NVIDIA's open-source AI pre-decoder for quantum error correction on five different EC2 GPU instance types then validated it on a P6 instance. At large code sizes the trained model cut decoding latency per round by roughly 2.4 to 2.9 times while also lowering the logical error rate.

I understand that there's a lot of dense vocabulary in that sentence. This article unpacks it so that builders who are new to quantum can actually understand it. Additionally, we'll explain why a GPU benchmark is actually a quantum milestone and we'll lay out where I think this work should go next.

If you've been following the quantum technology series, including the articles on superposition and entanglement, we'll be adding on top of that. Previous articles covered how qubits work. This article, however, will cover how we keep them from falling apart.

## What is quantum error correction?

Qubits are fragile. Heat, stray signals, and imperfect control pulses knock them out of their quantum state, a process called decoherence. On today's hardware that happens faster than most useful algorithms can finish.

Quantum error correction (QEC) is the fix. Instead of trusting one physical qubit, you spread one logical qubit across many physical ones. You cannot simply copy a qubit to make backups so QEC uses a clever trick. It runs a repeating loop:

1. Measure the stabilizers. These are parity checks across groups of qubits. They answer, "Do these neighbors still agree?" without reading the actual quantum data so the logical state survives.
2. Collect the syndrome. Each stabilizer measurement returns a single bit: 0 if its group of qubits still agrees, 1 if something flipped. The full string of those bits is the syndrome. Think of it as smoke detectors going off in certain rooms. You know roughly where the fire is without opening every door.
3. Decode. The classical computer reads the syndrome, infers the most likely errors, and reports or applies a correction.
4. Repeat: on superconducting hardware, each round takes about 1 μs.

## How did the team train the decoder?

Newer GPUs trained the pre-decoder up to about 39% faster, but the cheapest path to a good model was not always the newest instance. The setup was quite rigorous. Every run used the same container image on AWS Parallel Computing Service, so hardware was the only variable. This combined CUDA and PyTorch for training, Stim to simulate noisy quantum circuits and generate synthetic syndromes, and the Ising decoding repo for the model itself.

Additionally, each training sample was one shot of a distance-9 surface code memory experiment: a logical qubit encoded in a 9-by-9 grid of data qubits, measured over 9 rounds, with a physical error rate of 0.006 per operation. Each epoch held about 67 million shots spread across 8 GPUs.

The practical Playbook is the following:

- Exploration hyperparameter suites: G6e. You get near-H100 speed at a large discount, which matters when you are running dozens of experiments.
- Final training runs or larger decode distances: P5en or P6, when time between models or GPU memory is the constraint.

![Table comparing five EC2 instance types with eight GPUs each for training the decoder: P4d (NVIDIA A100), the baseline, slowest and oldest generation; G6e (NVIDIA L40S), within about 6% of P5 and about 45% cheaper per hour; P5 (NVIDIA H100), mid-pack and the reference for G6e; P5en (NVIDIA H200), within 1 to 2% of P6 and about 44% cheaper per hour; P6 (NVIDIA B200), fastest, up to about 39% faster than P4d, at a premium.](https://quantumdev.io/blog/media/image-aa7e5997d11e37c5361a20fc37da826fde372718-1262x366-webp-960.webp)

## How did the team validate it?

At distance 31, the pre-decoder plus MWPM was 2.4x (Fast Variant) to 2.9x (Accurate Variant) faster per round than MWPM alone, and it was more accurate too.

The team ran validation sweeps on a single B200 GPU, scaling surface code from distance 5 up to distance 31 at the same 0.006 physical error rate. Two findings stand out:

- Small codes favor MWPM alone. Low distances, the fixed overhead of running a neural network costs more than it saves.
- Large codes favor the pre-decoder. As the syndrome volume grows, MWPM slows down, and clearing the easy errors first pays off in both speed and logical error rate.

What we can deduce from this is that the useful fault-tolerant machines will need large code distances, and that is exactly where the AI approach starts to win. The results line up with what NVIDIA reported independently.

One important nuance from the original post, production decoding has to run on classical hardware physically next to the quantum processor, because of the microsecond deadline. The cloud is not where real-time decoding happens. It is where decoders get built, trained, and improved, and none of that requires a quantum computer.

## Why does this matter for builders?

The biggest bottleneck in quantum computing right now is partly a classical software problem, and you already have the skills to work on it.

1. You do not need a quantum computer to contribute. Every step in this workflow, from data generation to training to validation, is run on GPUs. Stim simulates the noisy circuits. PyTorch trains the model. If you have trained a model before, you have done 80% of this job.
2. Quantum progress now depends on machine learning engineers. For years, quantum felt like a physics PhD club. Error correction changes that. The decoder is a pattern recognition problem with a latency budget, which is the kind of problem that the machine learning engineer and systems community solves every day.
3. This is a real cloud architectural lesson. "We need a container image, so hardware is the only variable" is how you run a fair benchmark on anything. Matching instance type to the stage of the work, cheap for exploration and premium for final runs, is a FinOps habit worth building early.
4. It shows where quantum and AI actually meet. In this study, AI is actually making quantum computers usable by keeping up with their error rate. That is a story you can explain in an interview, a meetup, or a design review.

![Table of six follow-on projects with difficulty and main tools: cost per trained model, a weekend project (EC2 Spot, Trainium, AWS PCS); realistic noise models, intermediate (Stim, Amazon Braket calibration data); generalization sweeps, intermediate (Ising Decoding, AWS PCS); an open decoder benchmark, intermediate and a community effort (GitHub, AWS PCS, containers); an FPGA latency prototype, advanced (EC2 F2, quantization toolchains); new codes and logical operations, research (Stim, custom decoders).](https://quantumdev.io/blog/media/image-145da80e8c1c85283172a74b3fc60b29c6325e54-1256x414-webp-960.webp)

## What doors does this open?

The cloud becomes the decoder factory, and that creates new roles, new products, and new research paths.

- Decoder development as a cloud workload. Training, sweeping, and characterizing decoders at large scale is compute-hungry and hardware-independent. This is a natural fit for elastic GPU capacity, the same way drug discovery and weather modeling became cloud workloads.
- Hardware-agnostic iteration. Because the training data is simulated, teams can design decoders for qubit architectures that do not exist yet, then retarget them as the hardware emerges.
- A new specialization: the QEC machine learning engineer. Someone who understands surface codes, neural network design, and latency budgets at the same time. Very few people sit at that intersection today.
- Benchmarking as a service. The reproducible PCS workflow is a template. Hardware vendors, labs, startups all need a fair way to compare decoders across accelerators and code sizes.
- A bridge to fault tolerance. Every percentage point of decoder speed buys headroom for larger codes, and larger codes are the path from noisy experiments to machines that are useful algorithms.

_To learn more, read the blog posted on the AWS Quantum Technologies page:_

\_\_[_https://aws.amazon.com/blogs/quantum-computing/decoding-quantum-errors-with-nvidia-ising-decoding-on-aws/_](https://aws.amazon.com/blogs/quantum-computing/decoding-quantum-errors-with-nvidia-ising-decoding-on-aws/)

This article was first published on [AWS Builder Center](https://builder.aws.com/content/3LQQdF7UmyogqTtwfmjWTjHrPTb/teaching-ai-to-catch-quantum-errors) on 30 October 2026.
