Implant Global and Local Hierarchy Information to Sequence based Code Representation Models
Not on the map. Why?
Abstract (arXiv)
Source code representation with deep learning techniques is an important research field. There have been many studies that learn sequential or structural information for code representation. But sequence-based models and non-sequence-models both have their limitations. Researchers attempt to incorporate structural information to sequence-based models, but they only mine part of token-level hierarchical structure information. In this paper, we analyze how the complete hierarchical structure influences the tokens in code sequences and abstract this influence as a property of code tokens called hierarchical embedding. The hierarchical embedding is further divided into statement-level global hierarchy and token-level local hierarchy. Furthermore, we propose the Hierarchy Transformer (HiT), a simple but effective sequence model to incorporate the complete hierarchical embeddings of source code into a Transformer model. We demonstrate the effectiveness of hierarchical embedding on learning code structure with an experiment on variable scope detection task. Further evaluation shows that HiT outperforms SOTA baseline models and show stable training efficiency on three source code-related tasks involving classification and generation tasks across 8 different datasets.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 36 of its 49 references that are in the map. First posted on arXiv 14 Mar 2023.
Builds on
36 of 49 references.
References · 36
- 2017Attention Is All You Needcited by 60,361
- 2017Modeling Relational Data with Graph Convolutional Networkscited by 1,694
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2015Pointer Networkscited by 895
- 2015Gated Graph Sequence Neural Networkscited by 796
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020On the Bottleneck of Graph Neural Networks and its Practical Implicationscited by 631
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2020A Metric Learning Reality Checkcited by 321
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 221
24 more
- 2017Learning to Represent Programs with Graphscited by 220
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 179
- 2020A Transformer-based Approach for Source Code Summarizationcited by 133
- 2022Automating Code Review Activities by Large-Scale Pre-trainingcited by 98
- 2016A Convolutional Attention Network for Extreme Summarization of Source Codecited by 91
- 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 77
- 2020Code Prediction by Feeding Trees to Transformerscited by 70
- 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 69
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 2018Neural Code Comprehension: A Learnable Representation of Code Semanticscited by 59
- 2018Structured Neural Summarizationcited by 54
- 2023SkCoder: A Sketch-based Approach for Automatic Code Generationcited by 40
- 2022SPT-Code: Sequence-to-Sequence Pre-Training for Learning Source Code Representationscited by 36
- 2018Learning to Represent Editscited by 34
- 2020Exploring Software Naturalness through Neural Language Modelscited by 32
- 2018Aroma: Code Recommendation via Structural Code Searchcited by 29
- 2020Typilus: Neural Type Hintscited by 29
- 2020Learning Semantic Program Embeddings with Graph Interval Neural Networkcited by 20
- 2020TreeCaps: Tree-Based Capsule Networks for Source Code Processingcited by 16
- 2020Learning to Represent Programs with Heterogeneous Graphscited by 14
- 2020TAG : Type Auxiliary Guiding for Code Comment Generationcited by 8
- 2022Learning to Recommend Method Names with Global Contextcited by 6
- 2022Learning Program Representations with a Tree-Structured Transformercited by 6
Built on by
Citing papers per year: 2023: 1.
1 paper.
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detectioncited by 3
- 2023ZC3: Zero-Shot Cross-Language Code Clone Detection26 Aug 2023