paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Test-Driven Multi-Task Learning with Functionally Equivalent Code Transformation for Neural Code Generation

面向神经代码生成的测试驱动多任务学习与功能等价代码变换
ASE Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering2022匹配度 2/10 · 论文属于用程序分析辅助神经代码生成(AI for code generation),与用户关注的静态分析/Agentic 程序分析、LLM 改进静态分析与形式化验证、浮点/贝叶斯程序分析等方向均无直接交集;且仅基于 CodeGPT/CodeT5 等旧模型验证,不属于当前较强 LLM/Agent 之上的研究。引用 6 inbox
Xin Wang, Xiao Liu, Pingyi Zhou, Qixia Liu, Jin Liu, Hao Wu, Xiaohui Cui
crossref: 2026-09-12

AI 速览

一句话:提出结合功能等价代码变换与测试执行反馈的多任务学习,提升神经代码生成功能正确性。

现有神经代码生成多将代码视为普通文本,未充分利用程序特有信息,如功能等价的代码片段和测试执行反馈,因而生成代码的功能正确性仍受限。本文提出将程序分析与深度学习结合的方法:在训练阶段,设计若干代码变换启发式,为同一功能生成不同代码变体;同时利用测试执行反馈构造测试驱动的判别任务,训练判别器判断生成代码是否正确,并与生成任务进行多任务学习。在新发布数据集上的初步实验表明该框架有效,[email protected] 相比 CodeGPT 和 CodeT5 分别提升 8.81 和 11.53。

问题
现有神经代码生成模型通常按文本生成建模,忽视功能等价代码片段与测试执行反馈等程序特有信息,导致功能正确性不足。
方法
设计代码变换启发式生成功能等价变体,并利用测试执行反馈构建测试驱动判别任务,训练判别器与生成模型进行多任务学习。
评估
在新发布的数据集上进行初步评测,以 [email protected] 等指标比较 CodeGPT 和 CodeT5,验证所提框架的有效性。
原文摘要(Abstract)

Automated code generation is a longstanding challenge in both communities of software engineering and artificial intelligence. Currently, some works have started to investigate the functional correctness of code generation, where a code snippet is considered correct if it passes a set of test cases. However, most existing works still model code generation as text generation without considering program-specific information, such as functionally equivalent code snippets and test execution feedback. To address the above limitations, this paper proposes a method combining program analysis with deep learning for neural code generation, where functionally equivalent code snippets and test execution feedback will be considered at the training stage. Concretely, we firstly design several code transformation heuristics to produce different variants of the code snippet satisfying the same functionality. In addition, we employ the test execution feedback and design a test-driven discriminative task to train a novel discriminator, aiming to let the model distinguish whether the generated code is correct or not. The preliminary results on a newly published dataset demonstrate the effectiveness of our proposed framework for code generation. Particularly, in terms of the [email protected] metric, we achieve 8.81 and 11.53 gains compared with CodeGPT and CodeT5, respectively.

链接与引用

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

BibTeX
@inproceedings{paperbot7167,
  title = {Test-Driven Multi-Task Learning with Functionally Equivalent Code Transformation for Neural Code Generation},
  author = {Xin Wang and Xiao Liu and Pingyi Zhou and Qixia Liu and Jin Liu and Hao Wu and Xiaohui Cui},
  booktitle = {ASE},
  year = {2022},
  doi = {10.1145/3551349.3559549}
}