用模拟器反馈评估大模型写量子代码,发现人类水平仍难企及。
QCoder Benchmark: Bridging Language Generation and Quantum Hardware through Simulator-Based Feedback
- 通过量子模拟器提供电路深度等硬件反馈,引导代码优化
- GPT-4o仅18.97%准确率,推理模型最高达78%
- 含真实竞赛代码,适合研究量子编程与AI生成的对比
大型语言模型(LLMs)在自动生成程序代码方面应用日益广泛,可视为连接自然语言、人类知识与编程逻辑的语言生成任务。然而,在需与硬件交互的领域(如量子编程)中仍缺乏深入探索。为此,我们提出QCoder Benchmark,一个基于模拟器反馈的量子编程评估框架。该框架支持在量子模拟环境中评估,提供电路深度、执行时间、错误分类等专用指标,用于指导代码改进;同时整合真实编程竞赛中的人类代码提交,实现量化对比与质性分析。实验表明,即使先进模型GPT-4o的准确率也仅约18.97%,而基于推理的模型o3可达78%准确率,超过人类代码平均成功率(39.98%)。我们公开了数据集和评估API,以促进后续研究(代码与数据见https://qcoder-bench.github.io/)。
原文摘要 · Abstract (English)
Large language models (LLMs) have increasingly been applied to automatic programming code generation. This task can be viewed as a language generation task that bridges natural language, human knowledge, and programming logic. However, it remains underexplored in domains that require interaction with hardware devices, such as quantum programming, where human coders write Python code that is executed on a quantum computer. To address this gap, we introduce QCoder Benchmark, an evaluation framework that assesses LLMs on quantum programming with feedback from simulated hardware devices. Our benchmark offers two key features. First, it supports evaluation using a quantum simulator environment beyond conventional Python execution, allowing feedback of domain-specific metrics such as circuit depth, execution time, and error classification, which can be used to guide better generation. Second, it incorporates human-written code submissions collected from real programming contests, enabling both quantitative comparisons and qualitative analyses of LLM outputs against human-written codes. Our experiments reveal that even advanced models like GPT-4o achieve only around 18.97% accuracy, highlighting the difficulty of the benchmark. In contrast, reasoning-based models such as o3 reach up to 78% accuracy, outperforming averaged success rates of human-written codes (39.98%). We release the QCoder Benchmark dataset and public evaluation API to support further research. (Codes and datasets are available at https://qcoder-bench.github.io/ )
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。