ByteCue: enhancing bytecode comment generation with API information
Bytecode is an instruction set designed for efficient execution by a program interpreter. Unlike human-readable source code, bytecode is more challenging for programmers and researchers to understand. Bytecode is widely used in various software tasks, including malware and clone detection. To quickly and accurately understand the meaning of bytecode and further assist programmers in those software activities, we propose a bytecode comment generation approach called ByteCue, using a neural language model. Specifically, to obtain the structured information of the bytecode, we first generate the control flow graph (CFG) of the bytecode, simultaneously parsing the APIs called in the bytecode and serializing them. Then, we propose a Transformer-based model to learn the bytecode features for comment generation. By collecting JAR packages from well-known open-source projects in the Maven repository, we ultimately created a dataset at the method level of size 122k. The experiment indicates that our approach surpasses state-of-the-art baselines in bytecode comment generation, achieving an average increase of 17.5% on BLEU-4 metrics, 16.1% on METEOR, and 8.6% on ROUGE-L, demonstrating its effectiveness and superiority. User studies show that ByteCue also surpasses existing methods in terms of informativeness and naturalness, further highlighting its practical value.
Authors
- Zibin Zheng (ORCID: https://orcid.org/0000-0001-7872-7718)
- J Chen
- Changlin Yang (ORCID: https://orcid.org/0000-0002-1431-4073)
- Neng Zhang (ORCID: https://orcid.org/0000-0002-7508-0346)
- Xiangping Chen (ORCID: https://orcid.org/0000-0001-8234-3186)
- Yuan Huang (ORCID: https://orcid.org/0009-0006-1691-0959)
Institutions
- Sun Yat-sen University (CN)
- Central China Normal University (CN)
Publication Details
- Journal
- ACM Transactions on Software Engineering and Methodology
- Published
- 2025-10-24
- DOI
- https://doi.org/10.1145/3772717
- Primary Topic
- Software Engineering Research
- Type
- article
- Field-Weighted Citation Impact
- 0.00