arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.08570cs.LGcs.AIcs.PLcs.SEquant-ph
收藏

QuanBench+: 一种统一的多框架基准用于基于LLM的量子代码生成

QuanBench+: A Unified Multi-Framework Benchmark for LLM-Based Quantum Code Generation

American University of Beirut(贝鲁特美国大学);King Abdullah University of Science and Technology(卡迪夫国王大学科学与技术学院)

Ali Slim, Haydar Hamieh, Jawad Kotaich, Yehya Ghosn, Mahdi Chehimi, Ammar Mohanna, Hasan Abed Al Kader Hammoud, Bernard Ghanem

AI总结:

本文提出QuanBench+基准,用于评估LLM在量子代码生成中的多框架性能,通过执行测试和反馈修复机制,展示了不同框架下的代码生成效果及改进。

摘要:

大型语言模型(LLMs)越来越多地用于代码生成,但量子代码生成的评估仍主要局限于单一框架,这使得难以区分量子推理与框架熟悉度。我们引入了QuanBench+,一个覆盖Qiskit、PennyLane和Cirq的统一基准,包含42个对齐的任务,涵盖量子算法、门分解和状态准备。我们通过可执行的功能测试评估模型,报告Pass@1和Pass@5,并使用基于KL散度的接受度来接受概率输出。此外,我们还研究了基于反馈修复的Pass@1,其中模型可在运行时错误或错误答案后修订代码。在不同框架下,最强的一次性得分在Qiskit中为59.5%,在Cirq中为54.8%,在PennyLane中为42.9%;在基于反馈修复的情况下,最佳得分分别提升至83.3%、76.2%和66.7%。这些结果表明有明显进步,但也显示可靠的多框架量子代码生成仍待解决,仍强烈依赖于框架特定的知识。

英文摘要:

Large Language Models (LLMs) are increasingly used for code generation, yet quantum code generation is still evaluated mostly within single frameworks, making it difficult to separate quantum reasoning from framework familiarity. We introduce QuanBench+, a unified benchmark spanning Qiskit, PennyLane, and Cirq, with 42 aligned tasks covering quantum algorithms, gate decomposition, and state preparation. We evaluate models with executable functional tests, report Pass@1 and Pass@5, and use KL-divergence-based acceptance for probabilistic outputs. We additionally study Pass@1 after feedback-based repair, where a model may revise code after a runtime error or wrong answer. Across frameworks, the strongest one-shot scores reach 59.5% in Qiskit, 54.8% in Cirq, and 42.9% in PennyLane; with feedback-based repair, the best scores rise to 83.3%, 76.2%, and 66.7%, respectively. These results show clear progress, but also that reliable multi-framework quantum code generation remains unsolved and still depends strongly on framework-specific knowledge.

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

↑