paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Intention is All you Need: Refining your Code from your Intention

意图即一切:从你的意图出发精化代码
ICSE 2025 IEEE/ACM 47th International Conference on Software Engineering (ICSE)2025匹配度 3/10 · 该论文属于 LLM 辅助代码评审与代码精化(comment-to-code),与用户关注的“静态分析/形式化验证与 LLM 的交叉”以及“Agentic 程序的静态分析”均无直接关系,也未涉及浮点或贝叶斯程序分析;仅在最宽泛的“ML 与程序语言交叉”标签上有所重叠,且核心是提示工程与分类模板,偏代码修复任务而非分析方法创新。引用 8 inbox
Qi Guo, Xiaofei Xie, Shangqing Liu, Ming Hu, Xiaohong Li, Lei Bu
crossref: 2026-09-12

AI 速览

一句话:提出两阶段意图驱动代码精化方法:先从评审评论中抽取意图,再引导 LLM 生成修订代码。

代码精化旨在通过修改问题、重构与优化来提升既有代码质量,但随着软件规模增大,评审者与开发者之间的迭代沟通成本日益沉重;已有深度学习方法因难以准确理解评审者意图而效果受限。本文提出基于意图的代码精化技术,将传统的“评论到代码”过程显式拆分为两个阶段:意图抽取与意图引导的修订生成。前者用预定义模板将评论归入 3 大类 8 个子类,并采用规则与 LLM 结合的混合分类器;后者让大语言模型依据抽取出的意图生成修订代码。作者在 5 个 LLM(GPT-4o、GPT-3.5、DeepSeekV2、DeepSeek7B、CodeQwen7B)与多种提示设置下开展实验,意图抽取准确率达 79%,代码精化生成最高达 66%,表明该方法能提升数据质量与代码精化效率。

问题
传统评审者与开发者之间的迭代式代码精化成本高昂,而现有深度学习方案因难以准确理解评审者意图,性能仍然有限。
方法
将评论到代码的过程拆为两阶段:意图抽取阶段用预定义模板将评论归为 3 类 8 子类,并用规则与 LLM 结合的混合分类器识别意图;意图引导的修订生成阶段则让 LLM 依据这些意图生成修订代码。
评估
在 5 个 LLM(GPT-4o、GPT-3.5、DeepSeekV2、DeepSeek7B、CodeQwen7B)与不同提示设置下进行实验,意图抽取准确率达 79%,代码精化生成最高达 66%。
原文摘要(Abstract)

Code refinement aims to enhance existing code by addressing issues, refactoring, and optimizing to improve quality and meet specific requirements. As software projects scale in size and complexity, the traditional iterative exchange between re-viewers and developers becomes increasingly burdensome. While recent deep learning techniques have been explored to accelerate this process, their performance remains limited, primarily due to challenges in accurately understanding reviewers' intents. This paper proposes an intention-based code refinement technique that enhances the conventional comment-to-code process by explicitly extracting reviewer intentions from the comments. Our approach consists of two key phases: Intention Extraction and Intention Guided Revision Generation. Intention Extraction categorizes comments using predefined templates, while Intention Guided Revision Generation employs large language models (LLMs) to generate revised code based on these defined intentions. Three categories with eight subcategories are designed for comment transformation, which is followed by a hybrid approach that combines rule-based and LLM-based classifiers for accurate classification. Extensive experiments with five LLMs (G PT 40, GPT3.5, DeepSeekV2, DeepSeek7B, CodeQwen7B) under different prompting settings demonstrate that our approach achieves 79 % accuracy in intention extraction and up to 66 % in code refinement generation. Our results highlight the potential of our approach in enhancing data quality and improving the efficiency of code refinement.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot8799,
  title = {Intention is All you Need: Refining your Code from your Intention},
  author = {Qi Guo and Xiaofei Xie and Shangqing Liu and Ming Hu and Xiaohong Li and Lei Bu},
  booktitle = {ICSE},
  year = {2025},
  doi = {10.1109/icse55347.2025.00191}
}