AST-Transformer: Encoding Abstract Syntax Trees Efficiently for Code Summarization

12/02/2021
by   Ze Tang, et al.
0

Code summarization aims to generate brief natural language descriptions for source code. As source code is highly structured and follows strict programming language grammars, its Abstract Syntax Tree (AST) is often leveraged to inform the encoder about the structural information. However, ASTs are usually much longer than the source code. Current approaches ignore the size limit and simply feed the whole linearized AST into the encoder. To address this problem, we propose AST-Transformer to efficiently encode tree-structured ASTs. Experiments show that AST-Transformer outperforms the state-of-arts by a substantial margin while being able to reduce 90∼95% of the computational complexity in the encoding process.

READ FULL TEXT

page 1

page 2

page 3

research
08/10/2023

AST-MHSA : Code Summarization using Multi-Head Self-Attention

Code summarization aims to generate concise natural language description...
research
06/19/2019

Automatic Source Code Summarization with Extended Tree-LSTM

Neural machine translation models are used to automatically generate a d...
research
08/01/2019

Tree-Transformer: A Transformer-Based Method for Correction of Tree-Structured Data

Many common sequential data sources, such as source code and natural lan...
research
04/28/2023

Outline, Then Details: Syntactically Guided Coarse-To-Fine Code Generation

For a complicated algorithm, its implementation by a human programmer us...
research
05/11/2022

CV4Code: Sourcecode Understanding via Visual Code Representations

We present CV4Code, a compact and effective computer vision method for s...
research
08/30/2021

CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax Trees

Code summarization aims to generate concise natural language description...
research
03/14/2021

Improving Code Summarization with Block-wise Abstract Syntax Tree Splitting

Automatic code summarization frees software developers from the heavy bu...

Please sign up or login with your details

Forgot password? Click here to reset