Exploring LLM-Driven Explanations for Quantum Algorithms
Open Access
- 24 October 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 475-481
Abstract
Background: Quantum computing is a rapidly growing new programming paradigm that brings significant changes to the design and implementation of algorithms. Understanding quantum algorithms requires knowledge of physics and mathematics, which can be challenging for software developers. Aims: In this work, we provide a first analysis of how LLMs can support developers’ understanding of quantum code. Method: We empirically analyse and compare the quality of explanations provided by three widely adopted LLMs (Gpt3.5, Llama2, and Tinyllama) using two different human-written prompt styles for seven state-of-the-art quantum algorithms. We also analyse how consistent LLM explanations are over multiple rounds and how LLMs can improve existing descriptions of quantum algorithms. Results: Llama2 provides the highest quality explanations from scratch, while Gpt3.5 emerged as the LLM best suited to improve existing explanations. In addition, we show that adding a small amount of context to the prompt significantly improves the quality of explanations. Finally, we observe how explanations are qualitatively and syntactically consistent over multiple rounds. Conclusions: This work highlights promising results, and opens challenges for future research in the field of LLMs for quantum code explanation. Future work includes refining the methods through prompt optimisation and parsing of quantum code explanations, as well as carrying out a systematic assessment of the quality of explanations.Keywords
All Related Versions
Funding Information
- Strategic Research Fund
- European Union - NextGenerationEU - National Recovery and Resilience Plan (IR0000013)
- Engineering and Physical Sciences Research Council (EP/Y005244/1,EP/W032635/)
- Innovate UK
- Simula?s internal strategic project on quantum software engineering
- FCT (2023.02439.B)
- European Research Council (741278)
This publication has 19 references indexed in Scilit:
- Utilizing ChatGPT to Improve Quantum Algorithms2024
- Stochastic LLMs do not Understand Language: Towards Symbolic, Explainable and Ontologically Based LLMs2023
- Mutation Testing of Quantum Programs: A Case Study With QiskitIEEE Transactions on Quantum Engineering, 2022
- Amplitude estimation without phase estimationQuantum Information Processing, 2020
- The ASA Statement on p -Values: Context, Process, and PurposeThe American Statistician, 2016
- Quantum walks: a comprehensive reviewQuantum Information Processing, 2012
- Experimentation in Software Engineering2012
- Cliff´s Delta Calculator: A non-parametric effect size program for two groups of observationsUniversitas Psychologica, 2010
- Grover algorithm with zero theoretical failure ratePhysical Review A, 2001
- Deutsch-Jozsa algorithm as a test of quantum computationPhysical Review A, 1998