Coding assistants · Research feature

Benchmarking the Quantum Leap: Auditing LLM Evaluation for Quantum Code Generation

A new audit of large language models in quantum code generation reveals evaluator design and benchmark structure significantly affect reported performance.

Adapted from research by Ethan Seefried, Romit Ghosh, Sharmin Afrose and colleagues.

arXiv preprint revision · 2026-10-19 · Attribution & reuse
In this article
Editorial illustration of stacks of coins.

Editor’s introduction

The study evaluates 15 advanced language models across five quantum code-generation benchmarks, including 530 tasks from established suites and 96 new tasks in QuantumBenchEval. Researchers measure pass rates and assess evaluator behavior, finding that performance scores vary dramatically based on how correctness is defined. For instance, removing checks for unspecified quantities in one evaluator increased pass rates for GPT-6 Astra from 0% to 94.1% without altering model outputs. The analysis also identifies shared failures in 17 QuanBench-117 tasks tied to benchmark-specific imports, and reveals unexecuted unit tests and leaked canonical functions that can produce false passes or failures. These findings suggest that historical leaderboard results from public benchmarks may not reflect true model capability. The study concludes that model performance in quantum code generation is as much a function of evaluation methodology as of model architecture, and recommends isolating candidate code and reporting uncertainty and output validity.

Introduction

A programmer asked to prepare a four-qubit W state, or to decompose a CNOT into iSWAP gates, must reason about circuit semantics, measurement statistics, and backend constraints in addition to ordinary concerns of API usage and correctness. Large language models (LLMs) have become capable code generators, and several systems now target this setting directly, including Qiskit Code Assistant, QSpark, PennyCoder, and Agent-Q. A parallel line of work has produced benchmarks for measuring them, from Qiskit HumanEval and QCircuitNet to QHackBench, QCoder, and QuanBench.

These benchmarks do not agree on what to measure or how. They differ in task composition, execution environment, and output format. Some grade by executable unit tests; others require a model-based judge or a custom scoring function. Three consequences follow for anyone comparing models across them. First, a suite may lose discriminative power as models improve, so that a leaderboard position no longer distinguishes capability. Second, a difference between two models may be smaller than the sampling noise of a few hundred tasks, so that leaderboard order and statistical evidence for separation come apart. Third, a benchmark score depends on the reference solutions, test harness, dependencies, and evaluator assumptions as much as on the generated program, so that a defect in any of these components is misread as a failure, or a success, of the model. Systematic analysis of evaluation validity of this kind exists for classical code generation but not, to our knowledge, for quantum code generation.

Quantum Code Generation with Large Language Models

Qiskit Code Assistant was among the first specialized models, trained on the Granite architecture to generate Qiskit code; subsequently introduced quantum verifiable rewards for post-training using circuit-simulation feedback. QSpark fine-tuned Qwen2.5-Coder with group relative policy optimization, PennyCoder showed that PennyLane-centric training improves generation quality, and Agent-Q explored multi-agent iterative circuit refinement. Dataset work includes QCircuitNet, KetGPT, and C4Q.

Benchmarks for Quantum Code Generation

Qiskit HumanEval adapts HumanEval to 151 tasks on Qiskit API usage and basic algorithms. QCoder introduces 67 hardware-aware tasks with constraints such as qubit connectivity and restricted gate sets. QHackBench collects PennyLane hackathon challenges, PennyLang offers 264 test cases across PennyLane features, and QuanBench targets core algorithm implementations such as Grover’s algorithm, the quantum Fourier transform, and VQE.

Judge-scored evaluation

QCoder provides no executable tests, so each candidate receives a binary PASS/FAIL verdict from an LLM judge (per-run judge identities in Appendix A.2). Claude Opus 4.6 is excluded from the QCoder roster to avoid self-evaluation; Claude Fable 5.1 shares a provider with the QCoder and T3 judges and was retained, so its judge-scored results are flagged given documented self-preference effects.

QBE T3: open-ended energy estimation

T3 contains 15 tasks requiring Qiskit implementations of variational ground-state energy estimation for molecular and lattice systems. Because multiple implementations can be valid, T3 has no binary outcome. Each judged sample is scored on a fixed 10-point rubric: energy accuracy (3), chemical accuracy (1), required outputs (2), qubit and circuit specification (2), and scientific reasoning (2). Candidate code runs in an isolated subprocess; energy accuracy is recomputed deterministically from the executed energy against a task-specific reference, and the remaining criteria are scored by Claude Sonnet 4.6 from the candidate code and execution result.

Diagnostics

We report valid-output rates (nonempty and syntactically valid, with total-sample denominators), rule-based classifications of saved evaluation errors, and observed task coverage (empirical pass@5) with pairwise complementarity. Union coverage is an oracle quantity that uses additional generation budget, not a deployable selector. We also compute CodeBLEU and its per-sample point-biserial correlation with pass/fail. None of these diagnostics establishes functional or quantum-semantic correctness. Error-label definitions, CodeBLEU scoring details, T1 resource closeness, token usage, and incomplete-run bounds are given in Appendix A.3.

Overall Performance

QuanBench exhibits a different ordering. Claude Fable 5.1 records the highest pass@1 on QuanBench-44 at 60.0% [45.9–73.6], while several systems cluster near 84–85% on QuanBench-117. These QuanBench values should not be interpreted as validated capability estimates, however, because our evaluator audit identifies defects affecting both apparent passes and apparent failures (Section 4.5).

Benchmark Saturation and Statistical Separability

The Standard and Hard QiskitHumanEval suites provide a useful contrast in remaining benchmark headroom. Across five attempts per model, only one of the 151 Standard tasks is unsolved by every evaluated model, compared with 31 of 151 Hard tasks. The highest observed pass@1 correspondingly falls from 98.7% on Standard to 63.8% on Hard. All 15 models record lower pass@1 on the Hard split, although we treat this as a benchmark-level contrast rather than a causal estimate of difficulty because task-ID correspondence alone does not establish a controlled paired intervention.

Observed coverage reinforces the difference between the suites without implying that any task is intrinsically unsolvable. Across the available roster, the number of tasks unsolved in all five recorded attempts is 1/151 for Standard, 31/151 for Hard, 9/44 for QuanBench-44, 17/117 for QuanBench-117, and 12/67 for QCoder. These are empirical coverage statistics, equivalent to observed pass@5 coverage across the roster, rather than estimates of a fundamental capability ceiling.

Category-Level Performance

Hard reveals substantially greater category-level variation. For Astra, pass@1 ranges from 20.0% on Quantum Information and 44.8% on Backend and Runtime to 75.0% on Quantum Circuit Generation and 85.7% on State Preparation and Analysis; similar heterogeneity appears across other strong models. Because category sizes range from 5 to 28 tasks, these results are interpreted descriptively rather than as a secondary model ranking.

QuantumBenchEval: Challenging Tasks and Evaluation Sensitivity

QuantumBenchEval (QBE) complements the established suites with 96 new tasks spanning six quantum-computing topics. Instead of short API-completion problems, its tasks are multi-step scientific workflows that require reasoning about algorithm design, resource use, optimization, simulation, and scientific outputs. Each task is scored by its own evaluator, and because the tasks are newly constructed, they are less likely than long-standing public suites to appear in model training data.

We applied the same audit to our own evaluators, checking whether each scoring rule matches the information given to the model. It flagged three topics. T1’s evaluator checked exact resource quantities the prompts never specified, and T6’s required a scalar reproducibility value whose form the prompts never stated. Removing only these checks, while keeping every correctness check and rescoring the saved outputs, raises GPT-6 Astra from 0% to 94.1% on T1 and from 1.2% to 92.9% on T6; on T6 this moves it from last to first among the frontier models. All 32 reference solutions pass under both evaluators, and no replayed sample changes from pass to fail (Appendix C.4). T2 also checks undisclosed evaluation counts, but removing them changes little (at most 13.3% pass@1 on the 12 internally consistent tasks), and three T2 tasks contain data that contradict their required answers, so we report T2 as recorded. T3 is scored differently again, as a rubric mean over judged samples rather than pass@1.

QuanBench Evaluator Audit

The 17 QuanBench-117 tasks unsolved across the observed roster initially appear to form a shared performance ceiling. Inspection instead identifies a common benchmark-side obstruction: for each of the 17 tasks, the dominant recorded failure corresponds to an import in benchmark-owned reference or test code, including dependencies from qiskit_algorithms, qiskit_optimization, qiskit.primitives, and qiskit_machine_learning.This does not imply that every candidate on these tasks is correct (some outputs fail before reaching the shared obstruction), but it prevents some outputs fail before reaching the shared obstruction, but it prevents the observed ceiling from being interpreted as a pure model-capability limit.

More importantly, source inspection and controlled synthetic probes identify three defects in the current QuanBench evaluator. First, the evaluator executes test scripts without explicitly loading and running their unittest test cases; all 117 current QuanBench-117 scripts contain test classes and no top-level expression calls. A deliberately incorrect candidate therefore passes when the failing assertion is confined to such a test class. Second, canonical code is executed in the candidate namespace before generated code, allowing an empty candidate to satisfy an explicit assertion by inheriting the canonical function. Third, a valid synthetic candidate can fail before execution when the canonical solution imports a missing dependency. The false-pass mechanism is not only hypothetical: a recorded QuanBench-117 pass (Task 110, Claude Opus 4.6) returns a circuit that is not equivalent to CNOT up to global phase (Appendix E).

Judge-Scored QCoder

QCoder evaluates open-ended programs with a model-based judge rather than executable unit tests. Among complete evaluations, Claude Fable 5.1§ records 43.0% pass@1 [33.7–52.2] and 67.2% observed pass@5 [55.2–77.6], while GPT-6 Astra records 32.8% pass@1 [25.4–40.6] and the same 67.2% observed pass@5. Equal coverage does not mean identical behavior: each model solves 45/67 tasks within five attempts, with 40 shared successes and five unique successes each, so their oracle union covers 50/67 tasks (74.6%). This shows complementary observed coverage, not a demonstrated ensemble, since combining the systems doubles the generation budget and relies on oracle knowledge of which candidate succeeds.

These results are also conditioned on the generation configuration. GPT-6 Astra, Claude Fable 5.1, and Muse-Glimmer-30B produced no usable code under a 2,048-token output limit, so their runs used 32,768 tokens. Earlier runs, including GPT-5, used 2,048, and GPT-5’s 63% empty-output rate on QCoder shows that the cap was binding for it as well (Appendix D.4). The judge also changed between the two groups (claude-sonnet-4 before April 2026, claude-sonnet-4-6 after), and neither group was re-judged with the other judge. Gaps between the earlier and later runs therefore reflect model capability together with output budget and judge version, and the within-group comparison of Fable and Astra is the most controlled one QCoder provides.

Discussion and Conclusion

Our results show that measured quantum code-generation performance depends as much on how correctness is operationalized as on the model evaluated. Correcting one QBE evaluator changes two models’ pass@1 by 94.1 pp on unchanged outputs; the current QuanBench evaluator admits both false passes and false failures; and no primary suite separates its top two models after multiplicity correction. Meanwhile QiskitHumanEval-Standard is near saturation, so headroom now lies in harder or less-exposed tasks such as the Hard split and QBE.

Implications for model comparison

These effects compound. A leaderboard entry for QuanBench-117 reflects the model, its output budget, whether the evaluator runs its tests, and whether reference code leaks into the candidate namespace; a QCoder entry additionally reflects the judge version. Comparisons are most trustworthy within a single configuration and evaluator revision, as with Claude Fable 5.1 and GPT-6 Astra on QCoder. Across configurations, differences smaller than the evaluator effects documented here should not be interpreted as capability differences.

Limitations

QuanBench outcomes await replay under an isolated evaluator. QBE T2 contracts are corrected only in the release, and T1/T6 rescoring used replay on a different platform (5 of 1,600 samples differ). QCoder uses a non-i.i.d. protocol, its judge changed between runs, and all judges share a provider with one evaluated model. Decoding settings and output budgets differ across models, and our roster reflects one point in time.

AI use statement

In this work, we used generative AI tools to assist with implementing portions of the initial analysis and evaluation code and with developing and refining the statistical analysis framework, including bootstrap confidence intervals, paired comparisons, and multiple-comparison correction. We did not use generative AI tools to generate synthetic datasets, formulate or prove mathematical claims, clean or reformat datasets, perform qualitative or thematic data analysis, or translate research materials; the remaining required-disclosure tasks were not applicable to this work.

Additionally, we used generative AI tools to draft and edit portions of the manuscript for clarity, organization, and readability, and to assist with creating and editing research software. All AI-assisted code and statistical analyses were reviewed and tested by the authors, and reported results were verified against the underlying experimental outputs and evaluation artifacts. All AI-assisted manuscript text was reviewed and revised by the authors. We take responsibility for the final content of this work, including text, claims, code, and artifacts produced with the aid of generative AI.

Reproducibility statement

All code, evaluation scripts, model configurations, prompts, and experimental results will be made publicly available upon acceptance. The datasets and models evaluated in this work are publicly available, and the paper and supplementary materials describe the benchmark construction, evaluation protocol, and experimental settings required to reproduce our results. We will additionally maintain a public version of the Quantum Arena containing links to the datasets, models, benchmark tasks, and detailed evaluation results. The arena is intended to support continued evaluation beyond this work, and we welcome additional model submissions to maintain the benchmark as a long-term, continuously updated quantum-computing leaderboard.

CodeBLEU

For suites with canonical solutions, we compute CodeBLEU with equal weights on its four components. Main-table values are corpus-level scores over sample index zero for each task, with empty generations kept as empty predictions. We score only caches matched to the selected model, benchmark split, and ordered evaluation outcomes; unmatched runs are marked unavailable. Per-sample point-biserial correlations with pass/fail use task-cluster bootstrap intervals.

QuanBench-117: three-qubit state preparation

For both QuanBench examples, the current evaluator audit found that executing these test-class definitions does not run their test methods. Reference-code leakage and reference-import failures provide additional failure mechanisms; the KL-divergence helpers also return a constant zero in the audited source. Accordingly, the checks above document intended test behavior, and should not be read as evidence that historical pass labels validate the requested quantum behavior. Historical outcomes require corrected, isolated replay.

Construction and Provenance

All 96 QBE tasks were written by the authors for this work and were not published or shared before evaluation. Problem settings use standard scientific instances (e.g., textbook Hamiltonians and small graph problems) rather than items from existing benchmarks. Each task specifies a problem statement, a required function signature, the return fields the candidate must produce, a reference solution, an assertion suite (T3 excepted), and a common_failure_modes field written by the task author.

Known limitations

Our audit found scoring contracts that check quantities the prompts do not specify (T1 and T6, corrected and rescored; T2, reported as recorded), three T2 tasks (t2_3, t2_10, t2_14) whose disclosed data contradict their required answers, and assertions that are too permissive (Appendix C.5). Task difficulty was not calibrated against human solvers, and topics are small (15–17 tasks), so per-topic intervals are wide.

Limitations of T3 scoring

T3 scores should be read as indicative rather than calibrated. (i) Seven of the ten rubric points are assigned by a single LLM judge (claude-sonnet-4-6) in one pass; we did not measure inter-run agreement, agreement with a second judge, or agreement with human raters. (ii) The judge shares a provider with Claude Fable 5.1, the highest-scoring model on T3 (§), so self-preference cannot be ruled out. (iii) Means are conditional on judged samples, and denominators differ across models: Gemini 3.6 Flash is scored on 43 of 75 samples and Granite-Qiskit on none, so its means are not comparable to models judged on all 75. (iv) Only the 3-point energy-accuracy term is computed deterministically; the other criteria (required outputs, circuit specification, scientific reasoning) depend on the judge’s reading of code and execution output. (v) The rubric weights were set by the authors and not validated against expert rankings. A human-rated subset and a cross-provider judge would address (i)–(ii); we leave both to the released benchmark.

T2 and T6 Rescoring

Before changing any evaluator, we audited every T2 and T6 assertion against its candidate-facing prompt, then applied a pre-declared minimal change. For T6, only the reproducibility assertion was removed, because no prompt defines its form; all partition-quality assertions are unchanged. For T2, only exact evaluation-count assertions were removed, and tasks t2_3, t2_10, and t2_14 were excluded as internally inconsistent (their disclosed data contradict their required answers). No selection encoding was normalized. Saved outputs were replayed without regeneration. All 32 reference solutions pass under both evaluators, and no paired sample changes from pass to fail. All 99 T6 flips come from samples whose first recorded failure was the reproducibility type check. The replay ran on x86_64, whereas the original runs used aarch64; 5 of 1,600 samples differ between historical and replayed original outcomes because of simulator stochasticity. One of these (Gemini 3.1 Pro, t6_8.3) fails an unchanged quality assertion under both evaluators.