Marc North marc.north@durham.ac.uk
PGR Student Doctor of Philosophy
Code Gradients: Towards Automated Traceability of LLM-Generated Code
North, Marc; Atapour-Abarghouei, Amir; Bencomo, Nelly
Authors
Dr Amir Atapour-Abarghouei amir.atapour-abarghouei@durham.ac.uk
Assistant Professor
Dr Nelly Bencomo nelly.bencomo@durham.ac.uk
Associate Professor
Abstract
Large language models (LLMs) have recently seen huge growth in capability and usage. Within software engineering, LLMs are increasingly being used by developers to generate code. Code generated by an LLM can be seen essentially a continuous mapping from requirements to code. This represents a great opportunity within requirements engineering to use this mapping to provide traceability from requirements to LLM-generated code. The challenge is that the black-box nature of LLMs makes it difficult to trace requirements, while traditional approaches require extensive post-hoc testing or expert analysis. In this research preview, we explore the use of LLM explainability techniques to trace LLM-generated code back to requirements. By inspecting the gradients of LLM output, we develop a first attempt at tracing LLM inputs through to its generated code. We use this to estimate which low-level requirements have been met. Furthermore, through an automated iterative process, we re-query the LLM, instructing it to rewrite its code to meet the missing requirements. Our results suggest that the gradients of LLM outputs can be used to trace requirements through LLM code generation and that this traceability could potentially be used to improve generated code to better meet requirements. Future work is required to fully validate this result, but this represents a first step towards automatic traceability and verification of AI generated code.
Citation
North, M., Atapour-Abarghouei, A., & Bencomo, N. (2024, June). Code Gradients: Towards Automated Traceability of LLM-Generated Code. Presented at 2024 IEEE 32nd International Requirements Engineering Conference (RE), Reykjavik, Iceland
Presentation Conference Type | Conference Paper (published) |
---|---|
Conference Name | 2024 IEEE 32nd International Requirements Engineering Conference (RE) |
Start Date | Jun 24, 2024 |
End Date | Jun 28, 2024 |
Acceptance Date | Mar 22, 2024 |
Online Publication Date | Aug 21, 2024 |
Publication Date | Aug 21, 2024 |
Deposit Date | May 7, 2024 |
Publicly Available Date | Aug 21, 2024 |
Publisher | Institute of Electrical and Electronics Engineers |
Peer Reviewed | Peer Reviewed |
Pages | 321-329 |
Series ISSN | 1090-705X |
Book Title | 2024 IEEE 32nd International Requirements Engineering Conference (RE) |
ISBN | 9798350395129 |
DOI | https://doi.org/10.1109/RE59067.2024.00038 |
Keywords | Index Terms-Requirements Engineering; Large Language Models; Traceability |
Public URL | https://durham-repository.worktribe.com/output/2433851 |
Files
Accepted Conference Paper
(301 Kb)
PDF
Licence
http://creativecommons.org/licenses/by/4.0/
Copyright Statement
This accepted manuscript is licensed under the Creative Commons Attribution 4.0 licence. https://creativecommons.org/licenses/by/4.0/
You might also like
Beyond Syntax: How Do LLMs Understand Code?
(2024)
Presentation / Conference Contribution
INCLG: Inpainting for Non-Cleft Lip Generation with a Multi-Task Image Processing Network
(2023)
Journal Article
Downloadable Citations
About Durham Research Online (DRO)
Administrator e-mail: dro.admin@durham.ac.uk
This application uses the following open-source libraries:
SheetJS Community Edition
Apache License Version 2.0 (http://www.apache.org/licenses/)
PDF.js
Apache License Version 2.0 (http://www.apache.org/licenses/)
Font Awesome
SIL OFL 1.1 (http://scripts.sil.org/OFL)
MIT License (http://opensource.org/licenses/mit-license.html)
CC BY 3.0 ( http://creativecommons.org/licenses/by/3.0/)
Powered by Worktribe © 2025
Advanced Search