JOURNAL ARTICLE

A Code Completion Approach Based on Abstract Syntax Tree Splitting and Tree-LSTM

Abstract

Code completion refers to automatically generating the missing parts of code based on existing code snippets. Code completion can help programmers improve their coding efficiency and reduce errors. Providing accurate suggestions at the desired following token location in the completion recommendation list can significantly assist users. We have advanced the research on the next token prediction in code completion. Our work utilizes GPT-2 as the underlying architecture, and research has shown the effectiveness of incorporating the structural information of abstract syntax trees (ASTs) in code prediction. Particularly, predicting the type information of the next token has shown significant improvements. Our work proposes an algorithm to segment abstract syntax trees while preserving their structural characteristics. We use Tree-LSTM to extract the structural information of ASTs. We conducted experiments on a standard dataset and compared the effects of removing different components from the approach to validate its effectiveness.

Keywords:
Computer science Abstract syntax tree Security token Code (set theory) Syntax Coding (social sciences) Abstract syntax Tree (set theory) Artificial intelligence Data mining Programming language Operating system

Metrics

0
Cited By
0.00
FWCI (Field Weighted Citation Impact)
16
Refs
0.17
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Topics

Software Engineering Research
Physical Sciences →  Computer Science →  Information Systems
Software System Performance and Reliability
Physical Sciences →  Computer Science →  Computer Networks and Communications
Software Reliability and Analysis Research
Physical Sciences →  Computer Science →  Software
© 2026 ScienceGate Book Chapters — All rights reserved.