一句话:提出将可追溯性作为LLM代码生成的一等目标,通过结构化需求提示、元数据微调和检索增强验证实现可信生成。
大型语言模型在软件工程中的兴起带来了关键挑战:如何将生成代码追溯到其需求来源。传统追溯方法面向人类编写代码,无法应对LLM的随机性与不透明性——相同提示也可能产生不同输出。本文提出将可追溯性作为LLM代码生成流水线的一等目标,并采用三种策略:结构化需求提示、元数据感知微调与检索增强验证。该框架针对LLM不透明性、非确定性和可扩展性问题,引入度量、动态适配和伦理考量,以支持可审计的代码生成。论文贡献包括一个端到端框架、一项研究议程以及若干设计原则,旨在支撑可信的AI增强软件工程。
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.
@inproceedings{paperbot9119,
title = {Embedding Traceability in Large Language Model Code Generation: Towards Trustworthy AI-Augmented Software Engineering},
author = {Fei Wang and XueFeng Xi and ZhiMing Cui and Huan Dai and XinYu Wang},
booktitle = {FSE},
year = {2025},
doi = {10.1145/3696630.3730569}
}