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

Institutions

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

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Embedding Traceability in Large Language Model Code Generation: Towards Trustworthy AI-Augmented Software Engineering

Xuefeng Xi, X. Wang, Zhiming Cui, Fei Wang et al.
Safety Systems Engineering in Autonomy
article

Embedding Traceability in Large Language Model Code Generation: Towards Trustworthy AI-Augmented Software Engineering

Xuefeng Xi, X. Wang, Zhiming Cui, Fei Wang, Huan Dai
article en

Abstract

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.

Suzhou University of Science and Technology (CN)
National Natural Science Foundation of China
Industry, innovation and infrastructure
Openalex Percentile: Top 78%
Safety Systems Engineering in Autonomy
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.