arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2503.02497cs.SEcs.AIquant-ph
收藏

面向增强基于LLM的量子代码生成的PennyLane数据集

A PennyLane-Centric Dataset to Enhance LLM-based Quantum Code Generation using RAG

Center for Quantum and Topological Systems (CQTS)(量子与拓扑系统中心(CQTS));NYUAD Research Institute(纽约大学阿布扎克研究院);New York University Abu Dhabi(纽约大学阿布扎克分校)

Abdul Basit, Nouhaila Innan, Muhammad Haider Asif, Minghao Shao, Muhammad Kashif, Alberto Marchisio, Muhammad Shafique

AI总结:

本文提出PennyLang数据集,通过系统化方法提升LLM生成量子代码的性能,验证了RAG框架在增强量子代码生成中的有效性。

摘要:

大型语言模型(LLMs)在代码生成、自然语言理解和领域推理方面具有强大能力,但其在量子软件开发中的应用受限于高质量数据集的缺乏。为弥合这一差距,我们引入PennyLang,一个包含3,347个PennyLane特定量子代码样本的高质量数据集,源自教科书、官方文档和开源仓库。我们的贡献包括:(1)创建并开源PennyLang,专为PennyLane量子编程设计的数据集;(2)一个自动化量子代码数据集构建框架,系统化地进行整理、注释和格式化,以最大化下游LLM的实用性;(3)在多个开源和商业模型上对数据集进行基准评估,包括消融研究,均在检索增强生成(RAG)管道中完成。使用PennyLang与RAG显著提升性能:例如,Qwen 7B的成功率从无检索时的8.7%提升到有完整上下文增强时的41.7%,而LLaMa 4则从78.8%提升到84.8%,同时减少幻觉并提高量子代码的正确性。超越Qiskit研究,我们为PennyLane引入LLM工具和可重复的方法,推动AI辅助量子开发的发展。

英文摘要:

Large Language Models (LLMs) offer powerful capabilities in code generation, natural language understanding, and domain-specific reasoning. Their application to quantum software development remains limited, in part because of the lack of high-quality datasets both for LLM training and as dependable knowledge sources. To bridge this gap, we introduce \textit{PennyLang}, an off-the-shelf, high-quality dataset of 3,347 PennyLane-specific quantum code samples with contextual descriptions, curated from textbooks, official documentation, and open-source repositories. Our contributions are threefold: (1) the creation and open-source release of PennyLang, a purpose-built dataset for quantum programming with PennyLane; (2) a framework for automated quantum code dataset construction that systematizes curation, annotation, and formatting to maximize downstream LLM usability; and (3) a baseline evaluation of the dataset across multiple open-source and commercial models, including ablation studies, all conducted within a retrieval-augmented generation (RAG) pipeline. Using PennyLang with RAG substantially improves performance: for example, Qwen 7B's success rate rises from 8.7% without retrieval to 41.7% with full-context augmentation, and LLaMa 4 improves from 78.8% to 84.8%, while also reducing hallucinations and enhancing quantum code correctness. Moving beyond Qiskit-focused studies, we bring LLM-based tools and reproducible methods to PennyLane for advancing AI-assisted quantum development.

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

↑