Embedding Traceability in Large Language Model Code Generation: Towards Trustworthy AI-Augmented Software Engineering
The rise of LLMs in software engineering introduces critical challenges in tracing generated code to its governing requirements. Traditional traceability methods, designed for human-authored code, fail to address LLMs' stochastic and opaque nature, which yields divergent outputs from identical prompts. This paper proposes embedding traceability as a first-class objective in LLM code-generation pipelines through three strategies: structured requirement prompting, metadata-aware fine-tuning, and retrieval-augmented validation. Our framework addresses LLM opacity, non-determinism, and scalability, while introducing metrics, dynamic adaptation, and ethical considerations for audit-ready code generation. Contributions include an end-to-end framework, a research agenda, and design principles to support trustworthy AI-augmented software engineering.
Authors
- Xuefeng Xi (ORCID: https://orcid.org/0000-0001-7018-0068)
- X. Wang
- Zhiming Cui
- Fei Wang (ORCID: https://orcid.org/0000-0001-6563-8118)
- Huan Dai (ORCID: https://orcid.org/0000-0003-2708-2790)
Institutions
- Suzhou University of Science and Technology (CN)
Publication Details
- Published
- 2025-06-23
- DOI
- https://doi.org/10.1145/3696630.3730569
- Primary Topic
- Safety Systems Engineering in Autonomy
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China