跳到主要导航 跳到搜索 跳到主要内容

QuAInth: A Code Comment Approach for Application-Oriented Quantum Programs via N-Version LLMs

  • Beihang University

科研成果: 书/报告/会议事项章节 › 会议稿件 › 同行评审

摘要

Quantum computing has recently experienced rapid advancements and promised transformative applications across many fields. To promote the real-world applications of quantum computing, application-oriented quantum programs (AQPs) are designed to explore quantum hardware in performing substantial computational tasks and promote practical use cases for quantum computing. The complexity and scalability of AQPs, along with their dependence on advanced quantum algorithms, make them particularly challenging to understand and maintain. Clear comments offer an effective means of elucidating core logic and filling the knowledge gap for developers unfamiliar with quantum mechanics. Research on code comment for QPs remains scarce, highlighting the need for further investigation into effective comment methods for these complex programs. Given the potential advantages of large language models (LLMs), including their contextual understanding and language generation capabilities, LLMs can significantly reduce the cost of manual comment. Thus, this paper proposes a framework called QuAInth, which utilizes LLMs to annotate AQPs. This framework begins by preprocessing AQPs and segmenting them based on functional signatures. It then employs prompts (i.e., textual instructions carefully structured and given to LLMs) of varying granularity to guide comment generation. Aside from two existing text-based metrics, QuAInth newly adopts a quantum-specific metric that considers 8 indicators to evaluate the domainrelated correctness and clarity of the generated comments. Finally, with the understanding that an individual LLM may produce wrong outputs, QuAInth proposes a vote-enhanced fusion scheme inspired by N-version programming, in which distinct comments output from multiple LLMs are fused into a more reliable and comprehensive comment. Empirical studies are conducted with 4 AQPs written by Qiskit and 3 prevailing open-source LLMs (i.e., Qwen, DeepSeek-Coder, and Llama). The empirical results demonstrate the effectiveness of QuAInth, showing that the fused comments outperform those generated by individual models in the vast majority of cases.

源语言英语
主期刊名Proceedings - 2025 25th International Conference on Software Quality, Reliability and Security, QRS 2025
出版商Institute of Electrical and Electronics Engineers
页13-24
页数12
ISBN(电子版)9781665477710
DOI
出版状态已出版 - 2025
活动25th International Conference on Software Quality, Reliability and Security, QRS 2025 - Hangzhou, 中国
期限: 16 7月 2025 → 20 7月 2025

丛书

姓名IEEE International Conference on Software Quality, Reliability and Security, QRS
ISSN(印刷版)2693-9177

会议

会议25th International Conference on Software Quality, Reliability and Security, QRS 2025
国家/地区中国
市Hangzhou
时期16/07/25 → 20/07/25

学术指纹

探究 'QuAInth: A Code Comment Approach for Application-Oriented Quantum Programs via N-Version LLMs' 的科研主题。它们共同构成独一无二的学术指纹。

引用此