paperbot · PL 论文追踪

全部论文 待读 收藏

P2 DeepSim: deep learning code functional similarity

DeepSim:基于深度学习的代码功能相似性度量
FSE Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2018匹配度 3/10 · 论文用控制流/数据流语义矩阵和深度模型做代码功能相似性检测,属于机器学习与程序语言的交叉,但并非用户关注的核心方向:不是面向 ML/Agentic 程序的静态分析,也不是用 LLM/Agent 改进静态分析/形式化验证,更不涉及浮点程序分析或贝叶斯程序分析。其方法基于传统深度模型而非当前 LLM/Agent,匹配度较低。引用 268 inbox
Gang Zhao, Jeff Huang
crossref: 2026-09-12

AI 速览

一句话:提出 DeepSim,用控制流/数据流语义矩阵和深度模型将代码功能相似性检测转化为二分类问题。

代码相似性度量对代码搜索、重构和复用等软件工程任务至关重要,但已有技术多关注语法相似性,功能相似性度量仍是挑战。本文提出 DeepSim,将代码的控制流和数据流编码为一个语义矩阵,其中每个元素是高维稀疏二值特征向量,并基于该表示设计新的深度学习模型来度量代码功能相似性。该模型学习代码对的隐藏表示,通过拼接隐藏表示将功能相似代码检测转化为二分类问题,从而有效学习语法差异很大但功能相似的代码之间的模式。摘要未给出具体实验数据或量化结果。

问题
现有代码相似性技术主要衡量语法相似性,难以识别语法结构差异较大但功能等价的代码。
方法
将代码控制流与数据流编码为语义矩阵,矩阵元素为高维稀疏二值特征向量,再用深度学习模型学习代码对的隐藏表示并拼接,以二分类方式判断功能相似性。
评估
摘要未详述评估数据集与指标;核心评估形式是将代码对判定为功能相似与否的二分类检测,以验证模型学习语法迥异但功能相似代码模式的能力。
原文摘要(Abstract)

Measuring code similarity is fundamental for many software engineering tasks, e.g., code search, refactoring and reuse. However, most existing techniques focus on code syntactical similarity only, while measuring code functional similarity remains a challenging problem. In this paper, we propose a novel approach that encodes code control flow and data flow into a semantic matrix in which each element is a high dimensional sparse binary feature vector, and we design a new deep learning model that measures code functional similarity based on this representation. By concatenating hidden representations learned from a code pair, this new model transforms the problem of detecting functionally similar code to binary classification, which can effectively learn patterns between functionally similar code with very different syntactics.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot4579,
  title = {DeepSim: deep learning code functional similarity},
  author = {Gang Zhao and Jeff Huang},
  booktitle = {FSE},
  year = {2018},
  doi = {10.1145/3236024.3236068}
}