Lune

ICSE2021顶会

InferCode: Self-Supervised Learning of Code Representations by Predicting Subtrees

Nghi D. Q. Bui, Yijun Yu, Lingxiao Jiang

摘要

Learning code representations has found many uses in software engineering, such as code classification, code search, code comment generation, and bug prediction. Although representations of code in tokens, syntax trees, dependency graphs, paths in trees, or the combinations of their variants have been proposed, existing learning techniques have a major limitation that these models are often trained on datasets labeled for specific downstream tasks, and the code representations may not be suitable for other tasks. Even though some techniques generate representations from unlabeled code, they are far from satisfactory when applied to downstream tasks. To overcome the limitation, this paper proposes InferCode, which adapts the selfsupervised learning idea from natural language processing to the abstract syntax trees (ASTs) of code. The key novelty lies in the training of code representations by predicting subtrees automatically identified from the context of ASTs. With Infer-Code, subtrees in ASTs are treated as the labels for training the code representations without any human labeling effort or the overhead of expensive graph construction, and the trained representations are no longer tied to any specific downstream tasks or code units. We have trained an instance of InferCode model using Tree-Based Convolutional Neural Network (TBCNN) as the encoder of a large set of Java code. This pre-trained model can then be applied to downstream unsupervised tasks such as code clustering, code clone detection, cross-language code search, or be reused under a transfer learning scheme to continue training the model weights for supervised tasks such as code classification and method name prediction. Comparing to prior techniques applied to the same downstream tasks, such as code2vec, code2seq, ASTNN, using our pre-trained InferCode model higher performance results are achieved with a significant margin for most of the tasks, including those involving different programming languages. The implementation of InferCode and the trained embeddings are made available at the anonymous link: https://github.com/ICSE21/infercode .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 21 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations 引用了 Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
  • An Empirical Comparison of Pre-Trained Models of Source Code 引用了 How could Neural Networks understand Programs?
  • An Empirical Comparison of Pre-Trained Models of Source Code 引用了 An extensive study on pre-trained models for program understanding and generation
  • How could Neural Networks understand Programs? 引用了 A Simple Framework for Contrastive Learning of Visual Representations
  • SelfAPR: Self-supervised Program Repair with Test Execution Diagnostics 引用了 Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformations
  • SelfAPR: Self-supervised Program Repair with Test Execution Diagnostics 引用了 Graph-based, Self-Supervised Program Repair from Diagnostic Feedback
  • An extensive study on pre-trained models for program understanding and generation 引用了 Functional code clone detection with syntax and semantics fusion learning
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper21

  1. An extensive study on pre-trained models for program understanding and generationZhengran Zeng, Hanzhuo Tan, Haotian Zhang, Jing Li 等ISSTA 2022 · 142 次引用
  2. Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving TransformationsNghi D. Q. Bui, Yijun Yu, Lingxiao JiangSIGIR 2021 · 98 次引用
  3. How could Neural Networks understand Programs?Dinglan Peng, Shuxin Zheng, Yatao Li, Guolin Ke 等ICML 2021 · 75 次引用
  4. SelfAPR: Self-supervised Program Repair with Test Execution DiagnosticsHe Ye, Matias Martinez, Xiapu Luo, Tao Zhang 等ASE 2022 · 75 次引用
  5. An Empirical Comparison of Pre-Trained Models of Source CodeChangan Niu, Chuanyi Li, Vincent Ng, Dongxiao Chen 等ICSE 2023 · 71 次引用

它引用的 Paper4

  1. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 次引用
  2. Graph-based, Self-Supervised Program Repair from Diagnostic FeedbackMichihiro Yasunaga, Percy LiangICML 2020 · 198 次引用
  3. Functional code clone detection with syntax and semantics fusion learningChunrong Fang, Zixi Liu, Yangyang Shi, Jeff Huang 等ISSTA 2020 · 125 次引用
  4. LambdaNet: Probabilistic Type Inference using Graph Neural NetworksJiayi Wei, Maruth Goyal, Greg Durrett, Isil DilligICLR 2020 · 119 次引用

相关 Paper

  1. CONCORD: Clone-Aware Contrastive Learning for Source CodeYangruibo Ding, Saikat Chakraborty, Luca Buratti, Saurabh Pujar 等ISSTA 2023 · 6 次引用
  2. Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related TasksAntonio Mastropaolo, Simone Scalabrino, Nathan Cooper, David Nader-Palacio 等ICSE 2021 · 9 次引用
  3. Disentangled Code Representation Learning for Multiple Programming LanguagesJingfeng Zhang, Haiwen Hong, Yin Zhang, Yao Wan 等ACL Findings 2021 · 16 次引用
  4. SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code RepresentationsChangan Niu, Chuanyi Li, Vincent Ng, Jidong Ge 等ICSE 2022 · 99 次引用
  5. TreeCen: Building Tree Graph for Scalable Semantic Code Clone DetectionYutao Hu, Deqing Zou, Junru Peng, Yueming Wu 等ASE 2022 · 30 次引用
黄昏的海面,两侧是细线勾勒的悬崖