• Home
  • Search
  • Source Code Summarization with Structural Relative Position Guided Transformer
  • Open Access IconOpen Access
  • Cite Icon37
  • https://doi.org/10.1109/saner53432.2022.00013Copy DOI Icon

Source Code Summarization with Structural Relative Position Guided Transformer

  • Mar 1, 2022
  • Zi Gong +5 more
Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

Source code summarization aims at generating concise and clear natural language descriptions for programming languages. Well-written code summaries are beneficial for programmers to participate in the software development and maintenance process. To learn the semantic representations of source code, recent efforts focus on incorporating the syntax structure of code into neural networks such as Transformer. Such Transformer-based approaches can better capture the long-range dependencies than other neural networks including Recurrent Neural Networks (RNNs), however, most of them do not consider the structural relative correlations between tokens, e.g., relative positions in Abstract Syntax Trees (ASTs), which is beneficial for code semantics learning. To model the structural dependency, we propose a StruCtural RelatIve Position guided Transformer, named SCRIPT. SCRIPT first obtains the structural relative positions between tokens via parsing the ASTs of source code, and then passes them into two types of Transformer encoders. One Transformer directly adjusts the input according to the structural relative distance; and the other Transformer encodes the structural relative positions during computing the self-attention scores. Finally, we stack these two types of Transformer encoders to learn representations of source code. Experimental results show that the proposed SCRIPT outperforms the state-of-the-art methods by at least 1.6%, 1.4% and 2.8% with respect to BLEU, ROUGE-L and METEOR on benchmark datasets, respectively. We further show that how the proposed SCRIPT captures the structural relative dependencies.

Similar Papers
  • Conference Article
  • Citations166

Deep learning similarities from different representations of source code

  • May 28, 2018
  • Michele Tufano +5
  • Research Article
  • Citations18

Survey of source code vulnerability analysis based on deep learning

  • Sep 03, 2024
  • Computers & Security
  • Chen Liang +4
  • Single Book
  • Citations18

The Sixth International Symposium on Neural Networks (ISNN 2009)

  • Jan 01, 2009
  • Hongwei Wang +4
  • Conference Article
  • Citations1

VADER-SC: A Model Agnostic Tool for Large Scale, AI Driven Automated Source Code Summarization

  • Jul 24, 2023
  • Dwight Horne +6
  • Research Article
  • Citations63

PathPair2Vec: An AST path pair-based code representation method for defect prediction

  • May 28, 2020
  • Journal of Computer Languages
  • Ke Shi +3
  • Book Chapter
  • Citations5

A Recurrent Neural Fuzzy Network

  • Sep 29, 2016
  • Iuliana F Iatan
  • Research Article
  • Citations201

Automatic Source Code Summarization of Context for Java Methods

  • Feb 01, 2016
  • IEEE Transactions on Software Engineering
  • Paul W Mcburney +1
  • Research Article
  • Citations18

A comparison of tree- and line-oriented observational slicing

  • Jan 24, 2019
  • Empirical Software Engineering
  • David Binkley +4
  • Research Article
  • Citations6

GA-SCS: Graph-Augmented Source Code Summarization

  • Feb 21, 2023
  • ACM Transactions on Asian and Low-Resource Language Information Processing
  • Mengli Zhang +4
  • Research Article
  • Citations6

A Smart Contract Vulnerability Detection Model Based on Syntactic and Semantic Fusion Learning

  • Feb 03, 2023
  • Wireless Communications and Mobile Computing
  • Daojun Han +3
  • Conference Article
  • Citations14

Control-Flow-Only Abstract Syntax Trees for Analyzing Students' Programming Progress

  • Aug 25, 2016
  • David Hovemeyer +3
  • Research Article

Bidirectional Recurrent Neural Network Language Model: Cross Entropy Churn Metrics for Defect Prediction Modeling

  • Dec 10, 2020
  • International Journal of Data Mining Techniques and Applications
  • Nivetha R +1
  • Conference Article
  • Citations1

Recurrent sub neural networks applied to speech recognition

  • Apr 13, 1994
  • Wei-Ying Li +3
  • Book Chapter
  • Citations14

Neural Network Compression via Learnable Wavelet Transforms

  • Jan 01, 2020
  • Moritz Wolter +2
  • PDF
  • Research Article
  • Citations1

A Novel Source Code Representation Approach Based on Multi-Head Attention

  • May 29, 2024
  • Electronics
  • Lei Xiao +5
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.