A new detection framework uses a fine-tuned language model to catch quantum programs designed to damage or sabotage quantum hardware, before they ever run.
Researchers built BadQubits, a static analysis tool that scans OpenQASM 2.0 circuits submitted to quantum computers for structurally harmful patterns, the kind that exploit physical-execution-layer weaknesses rather than software bugs. The team tested four code-understanding language models against a dataset of 1,500 circuits: 1,000 legitimate programs pulled from the MQTBench benchmark and 500 synthetic attack circuits built from three documented physical-layer threat primitives. A fine-tuned Qwen Coder 2.5 7B model came out on top, hitting 92.67% overall accuracy and 96.1% recall on the harmful circuits. Two of the four base models never generalized well under the constrained fine-tuning setup, which the researchers say means picking the right model architecture matters more than tuning it harder.
The bigger finding is about durability. When the researchers threw adversarial syntactic tweaks at a simpler bag-of-gates CNN baseline, its recall collapsed from 100% to 17%. The LLM barely flinched, dropping from 96.1% to 91.2%, because it reads circuits sequentially rather than as a flattened histogram of gate counts. That matters because quantum cloud providers cannot inspect a running circuit the way a server inspects running code: measurement collapses quantum state irreversibly, and simulating it classically scales exponentially.
Quantum computing is still mostly a research curiosity for most people, but cloud-hosted quantum access is already real, and this is what security tooling looks like before an attack makes headlines rather than after.