Towards Improving the Performance of Comment Generation Models by Using Bytecode Information

Code comment plays an important role in program understanding, and a large number of automatic comment generation methods have been proposed in recent years. To get a better effect of generating comments, many studies try to extract a variety of information (e.g., code tokens, AST traverse sequence, APIs call sequence) from source code as model input. In this study, we found that the bytecode compiled from the source code can provide useful information for comment generation, hence we propose to use the information from bytecode to assist the comment generation. Specifically, we extract the control flow graph (CFG) from the bytecode and propose a serialization method to obtain the CFG sequence that preserves the program structure. Then, we discuss three methods for introducing bytecode information for different models. We collected 390,000 Java methods from the maven repository, and created a dataset of 101,124 samples after deduplication and preprocessing to evaluate our method. The results show that introducing the information extracted from the bytecode can improve the BLEU- 4 of 7 comment generation models.

Authors

Institutions

Publication Details

Journal
IEEE Transactions on Software Engineering
Published
2025-01-09
DOI
https://doi.org/10.1109/tse.2024.3523713
Citations
2
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
6.49
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Towards Improving the Performance of Comment Generation Models by Using Bytecode Information

Zibin Zheng, Jinbo Huang, Xiangping Chen, Yuan Huang
2 citations
IEEE Transactions on Software Engineering
Software Engineering Research
6.49
article

Towards Improving the Performance of Comment Generation Models by Using Bytecode Information

Zibin Zheng, Jinbo Huang, Xiangping Chen, Yuan Huang
article en
2 citations

Abstract

Code comment plays an important role in program understanding, and a large number of automatic comment generation methods have been proposed in recent years. To get a better effect of generating comments, many studies try to extract a variety of information (e.g., code tokens, AST traverse sequence, APIs call sequence) from source code as model input. In this study, we found that the bytecode compiled from the source code can provide useful information for comment generation, hence we propose to use the information from bytecode to assist the comment generation. Specifically, we extract the control flow graph (CFG) from the bytecode and propose a serialization method to obtain the CFG sequence that preserves the program structure. Then, we discuss three methods for introducing bytecode information for different models. We collected 390,000 Java methods from the maven repository, and created a dataset of 101,124 samples after deduplication and preprocessing to evaluate our method. The results show that introducing the information extracted from the bytecode can improve the BLEU- 4 of 7 comment generation models.

IEEE Transactions on Software EngineeringVol. 51(2)
Sun Yat-sen University (CN)
Openalex Percentile: Top 5%
Software Engineering Research
6.49
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.