arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.21097cs.SEcs.AI
收藏

基于大语言模型和检索增强生成的模型驱动量子代码生成

Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generation

Department of Computer Science University of Colorado Colorado Springs (UCCS)(计算机科学系 佛罗里达大学科罗拉多州春分校)

Nazanin Siavash, Armin Moin

AI总结:

本文提出利用大语言模型和检索增强生成技术,通过UML模型生成量子代码,提升量子计算代码的准确性和一致性。

摘要:

本文介绍了一种利用大语言模型(LLMs)和检索增强生成(RAG)管道进行模型到文本/代码转换的新研究方向。重点是量子和混合量子-经典软件系统,其中模型驱动方法可以帮助降低异构平台生态系统带来的成本和风险。我们验证了其中一个提出的观点,即通过软件系统的UML模型实例生成代码。该Python代码使用名为Qiskit的成熟库在基于门或电路的量子计算机上执行。我们部署的RAG管道结合了来自公共GitHub仓库的示例Qiskit代码。实验结果表明,经过精心设计的提示可以将CodeBLEU分数提高多达四倍,从而生成更准确且一致的量子代码。然而,通过进一步研究,该研究方向可以超越当前成果,通过进行实验来解决我们提出的问题和想法,例如将软件系统模型实例作为RAG管道的信息来源,或利用LLMs进行代码到代码的转换,例如在编译用例中。

英文摘要:

This paper introduces a novel research direction for model-to-text/code transformations by leveraging Large Language Models (LLMs) that can be enhanced with Retrieval-Augmented Generation (RAG) pipelines. The focus is on quantum and hybrid quantum-classical software systems, where model-driven approaches can help reduce the costs and mitigate the risks associated with the heterogeneous platform landscape and lack of developers' skills. We validate one of the proposed ideas regarding generating code out of UML model instances of software systems. This Python code uses a well-established library, called Qiskit, to execute on gate-based or circuit-based quantum computers. The RAG pipeline that we deploy incorporates sample Qiskit code from public GitHub repositories. Experimental results show that well-engineered prompts can improve CodeBLEU scores by up to a factor of four, yielding more accurate and consistent quantum code. However, the proposed research direction can go beyond this through further investigation in the future by conducting experiments to address our other research questions and ideas proposed here, such as deploying software system model instances as the source of information in the RAG pipelines, or deploying LLMs for code-to-code transformations, for instance, for transpilation use cases.

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

↑