Lune

NeurIPS2021顶会

Integrating Tree Path in Transformer for Code Representation

Han Peng, Ge Li, Wenhan Wang, Yunfei Zhao, Zhi Jin

摘要

Learning distributed representation of source code requires modelling its syntax and semantics. Recent state-of-the-art models leverage highly structured source code representations, such as the syntax trees and paths therein. In this paper, we investigate two representative path encoding methods shown in previous research work and integrate them into the attention module of Transformer. We draw inspiration from the ideas of positional encoding and modify them to incorporate these path encoding. Specifically, we encode both the pairwise path between tokens of source code and the path from the leaf node to the tree root for each token in the syntax tree. We explore the interaction between these two kinds of paths by integrating them into the unified Transformer framework. The detailed empirical study for path encoding methods also leads to our novel state-of-theart representation model TPTrans, which finally outperforms strong baselines. Extensive experiments and ablation studies on code summarization across four different languages demonstrate the effectiveness of our approaches. We release our code at https://github.com/AwdHanPeng/TPTrans .

问 Lune

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

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

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

可以从这些问题问起

Lune 可以查阅

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

获取答案

免费开始,无需绑卡

脉络

  • Syntax and Domain Aware Model for Unsupervised Program Translation 引用了 Language-Agnostic Representation Learning of Source Code from Structure and Context
  • Code Prediction by Feeding Trees to Transformers 引用了 Structural Language Models of Code
  • Code Prediction by Feeding Trees to Transformers 引用了 Global Relational Models of Source Code
  • Language-Agnostic Representation Learning of Source Code from Structure and Context 引用了 Global Relational Models of Source Code
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper15

  1. Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering TasksHongyuan Tao, Ying Zhang, Zhenhao Tang, Hongen Peng 等NeurIPS 2025 · 41 次引用
  2. Learning to Recommend Method Names with Global ContextFang Liu, Ge Li, Zhiyi Fu, Shuai Lu 等ICSE 2022 · 32 次引用
  3. Syntax and Domain Aware Model for Unsupervised Program TranslationFang Liu, Jia Li, Li ZhangICSE 2023 · 25 次引用
  4. TreeMoCo: Contrastive Neuron Morphology Representation LearningHanbo Chen, Jiawei Yang, Daniel Maxim Iascone, Lijuan Liu 等NeurIPS 2022 · 23 次引用
  5. VGX: Large-Scale Sample Generation for Boosting Learning-Based Software Vulnerability AnalysesYu Nong, Richard Fang, Guangbei Yi, Kunsong Zhao 等ICSE 2024 · 23 次引用

它引用的 Paper4

  1. Global Relational Models of Source CodeVincent J. Hellendoorn, Charles Sutton, Rishabh Singh, Petros Maniatis 等ICLR 2020 · 252 次引用
  2. Code Prediction by Feeding Trees to TransformersSeohyun Kim, Jinman Zhao, Yuchi Tian, Satish ChandraICSE 2021 · 179 次引用
  3. Language-Agnostic Representation Learning of Source Code from Structure and ContextDaniel Zügner, Tobias Kirschstein, Michele Catasta, Jure Leskovec 等ICLR 2021 · 131 次引用
  4. Structural Language Models of CodeUri Alon, Roy Sadaka, Omer Levy, Eran YahavICML 2020 · 115 次引用

相关 Paper

  1. Rethinking Positional Encoding in Tree Transformer for Code RepresentationHan Peng, Ge Li, Yunfei Zhao, Zhi JinEMNLP 2022 · 10 次引用
  2. AST-Trans: Code Summarization with Efficient Tree-Structured AttentionZe Tang, Xiaoyu Shen, Chuanyi Li, Jidong Ge 等ICSE 2022 · 57 次引用
  3. Learning Sequential and Structural Information for Source Code SummarizationYunSeok Choi, JinYeong Bak, CheolWon Na, Jee-Hyong LeeACL Findings 2021 · 34 次引用
  4. Code Summarization with Structure-induced TransformerHongqiu Wu, Hai Zhao, Min ZhangACL Findings 2021 · 70 次引用
  5. What Do They Capture? - A Structural Analysis of Pre-Trained Language Models for Source CodeYao Wan, Wei Zhao, Hongyu Zhang, Yulei Sui 等ICSE 2022 · 66 次引用
黄昏的海面,两侧是细线勾勒的悬崖