paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A neural framework for retrieval and summarization of source code

一种用于源代码检索与摘要的神经框架
ASE Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering2018匹配度 2/10 · 该论文用两个联合训练的 VAE 做代码检索与摘要,属于基于神经网络的代码理解/生成任务,既不涉及静态分析(PL→AI)、也不涉及用 LLM/Agent 改进分析或验证(AI→PL),更与浮点程序分析无关。虽然 VAE 含变分贝叶斯成分,但其目标是代码-自然语言双向映射,而非贝叶斯程序分析,且方法基于早期非 LLM 模型,与画像中'建立在当前较强模型之上'的偏好不符。引用 104 inbox
Qingying Chen, Minghui Zhou
crossref: 2026-09-12

AI 速览

一句话:提出 BVAE,用两个联合训练的 VAE 在代码与自然语言间建立双向映射,以改进代码检索和摘要。

代码检索与摘要可帮助开发者复用散布于在线仓库中的代码,但源代码与自然语言描述之间存在语义鸿沟。本文提出神经框架 BVAE,通过两个变分自编码器 C-VAE 和 L-VAE 分别建模代码与自然语言,并联合训练以在尽可能重构输入的同时施加正则,使代码与描述的隐变量相互靠近,从而学习双向映射和语义向量表示,甚至为任意代码片段生成全新描述。作者针对检索和摘要分别设计 BVAE 的实例模型,在同时包含 C# 和 SQL 的基准上评估。实验表明 BVAE 在这两项任务上具有潜力。

问题
开发者复用在线仓库中的代码时依赖代码检索与摘要,但源代码与自然语言描述之间的语义鸿沟使这两项任务仍具挑战。
方法
提出 BVAE,包含分别建模源代码与自然语言的 C-VAE 和 L-VAE,通过联合重构与隐变量邻近正则建立双向映射,学习语义向量表示并生成新的代码描述。
评估
在包含 C# 和 SQL 两种语言的基准上,分别针对检索和摘要设计 BVAE 的实例模型,并通过实验展示其在这两项任务上的潜力。
原文摘要(Abstract)

Code retrieval and summarization are two tasks often employed by software developers to reuse code that spreads over online repositories. In this paper, we present a neural framework that allows bidirectional mapping between source code and natural language to improve these two tasks. Our framework, BVAE, is designed to have two Variational AutoEncoders (VAEs) to model bimodal data: C-VAE for source code and L-VAE for natural language. Both VAEs are trained jointly to reconstruct their input as much as possible with regularization that captures the closeness between the latent variables of code and description. BVAE could learn semantic vector representations for both code and description and generate completely new descriptions for arbitrary code snippets. We design two instance models of BVAE for retrieval and summarization tasks respectively and evaluate their performance on a benchmark which involves two programming languages: C# and SQL. Experiments demonstrate BVAE’s potential on the two tasks.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4714,
  title = {A neural framework for retrieval and summarization of source code},
  author = {Qingying Chen and Minghui Zhou},
  booktitle = {ASE},
  year = {2018},
  doi = {10.1145/3238147.3240471}
}