In recent years, Automated Program Repair (APR) techniques specifically designed for quantum programs have been proposed. However, existing approaches often suffer from low repair success rates or poor understandability of the generated patches. In this study, we construct a framework in which a large language model (LLM) generates code repairs along with a natural language explanation of the applied repairs. To investigate how the contextual information included in prompts influences APR performance for quantum programs, we design four prompt configurations with different combinations of static information, dynamic information, and mutation analysis results. Mutation analysis evaluates how small changes to specific parts of a program affect its execution results and provides more detailed dynamic information than simple execution outputs such as stack traces. Our experimental results show that mutation analysis can provide valuable contextual information for LLM-based APR of quantum programs, improving repair success rates (achieving 94.4% in our experiment) and in some cases also improving the quality of generated explanations. Our findings point toward new directions for developing APR techniques for quantum programs that enhance both reliability and explainability.


翻译:近年来,专门针对量子程序的自动程序修复(APR)技术已被提出。然而,现有方法往往存在修复成功率低或生成补丁可理解性差的问题。在本研究中,我们构建了一个框架,其中大型语言模型(LLM)生成代码修复的同时,还提供所应用修复的自然语言解释。为探究提示中包含的上下文信息如何影响量子程序APR性能,我们设计了四种提示配置,这些配置以不同方式组合了静态信息、动态信息及变异分析结果。变异分析通过评估对程序特定部分进行微小更改如何影响其执行结果,提供了比堆栈跟踪等简单执行输出更详细的动态信息。实验结果表明,变异分析能为基于LLM的量子程序APR提供有价值的上下文信息,不仅提高了修复成功率(在我们的实验中达到94.4%),在某些情况下还提升了生成解释的质量。我们的研究结果为开发同时增强可靠性和可解释性的量子程序APR技术指明了新方向。

0
下载
关闭预览

相关内容

大型语言模型自动程序修复的系统文献综述
专知会员服务
42+阅读 · 2024年5月5日
【ICLR2024】能检测到LLM产生的错误信息吗?
专知会员服务
25+阅读 · 2024年1月23日
图像修复研究进展综述
专知
20+阅读 · 2021年3月9日
用深度学习揭示数据的因果关系
专知
28+阅读 · 2019年5月18日
NLG ≠ 机器写作 | 专家专栏
量子位
13+阅读 · 2018年9月10日
放弃 RNN/LSTM 吧,因为真的不好用!望周知~
人工智能头条
19+阅读 · 2018年4月24日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
相关VIP内容
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
4+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员