arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.16779cs.SE
收藏

QuanBench:使用大型语言模型对量子代码生成进行基准测试

QuanBench: Benchmarking Quantum Code Generation with Large Language Models

Kyushu University(九州大学)

Xiaoyu Guo, Minggu Wang, Jianjun Zhao

AI总结:

本文构建含44个任务的QuanBench基准,从功能正确性与量子语义等价性评估多类LLM,发现其量子代码生成准确率不足40%。

摘要:

大型语言模型(LLM)已在通用代码生成中展现出良好性能;然而,它们在量子代码生成方面的能力仍未得到充分研究。本文提出 QuanBench,这是一个用于评估 LLM 量子代码生成能力的基准。QuanBench 包含 44 个编程任务,涵盖量子算法、状态制备、门分解和量子机器学习。每个任务都有可执行的标准解决方案,并通过功能正确性(Pass@K)和量子语义等价性(Process Fidelity)进行评估。我们评估了若干近期的 LLM,包括通用模型和代码专用模型。结果表明,当前 LLM 生成正确量子代码的能力有限,总体准确率低于 40%,并频繁出现语义错误。我们还分析了常见失败案例,例如过时的 API 使用、电路构造错误和错误的算法逻辑。QuanBench 为未来改进基于 LLM 的量子代码生成工作提供了基础。

英文摘要:

Large language models (LLMs) have demonstrated good performance in general code generation; however, their capabilities in quantum code generation remain insufficiently studied. This paper presents QuanBench, a benchmark for evaluating LLMs on quantum code generation. QuanBench includes 44 programming tasks that cover quantum algorithms, state preparation, gate decomposition, and quantum machine learning. Each task has an executable canonical solution and is evaluated by functional correctness (Pass@K) and quantum semantic equivalence (Process Fidelity). We evaluate several recent LLMs, including general-purpose and code-specialized models. The results show that current LLMs have limited capability in generating the correct quantum code, with overall accuracy below 40% and frequent semantic errors. We also analyze common failure cases, such as outdated API usage, circuit construction errors, and incorrect algorithm logic. QuanBench provides a basis for future work on improving quantum code generation with LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑