UCL Discovery
UCL home » Library Services » Electronic resources » UCL Discovery

Exploring LLM-Driven Explanations for Quantum Algorithms

D'Aloisio, G; Fortz, S; Hanna, C; Fortunato, D; Bensoussan, A; Mendiluze Usandizaga, E; Sarro, F; (2024) Exploring LLM-Driven Explanations for Quantum Algorithms. In: ESEM '24: Proceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement. (pp. pp. 475-481). ACM Green open access

[thumbnail of Sarro_3674805.3690753.pdf]
Preview
Text
Sarro_3674805.3690753.pdf

Download (581kB) | Preview

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.

Type: Proceedings paper
Title: Exploring LLM-Driven Explanations for Quantum Algorithms
Event: ESEM '24: ACM / IEEE International Symposium on Empirical Software Engineering and Measurement
Open access status: An open access version is available from UCL Discovery
DOI: 10.1145/3674805.3690753
Publisher version: https://doi.org/10.1145/3674805.3690753
Language: English
Additional information: Copyright © 2024 Owner/Author. This work is licensed under a Creative Commons Attribution International 4.0 License.
Keywords: Quantum Computing, Large Language Models, Code Explainability
UCL classification: UCL
UCL > Provost and Vice Provost Offices > UCL BEAMS
UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science > Dept of Computer Science
URI: https://discovery.ucl.ac.uk/id/eprint/10205141
Downloads since deposit
Loading...
3Downloads
Download activity - last month
Loading...
Download activity - last 12 months
Loading...
Downloads by country - last 12 months
Loading...

Archive Staff Only

View Item View Item