{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T19:41:30Z","timestamp":1760125290245,"version":"build-2065373602"},"reference-count":32,"publisher":"MDPI AG","issue":"4","license":[{"start":{"date-parts":[[2023,3,26]],"date-time":"2023-03-26T00:00:00Z","timestamp":1679788800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Entropy"],"abstract":"<jats:p>Source code summarization focuses on generating qualified natural language descriptions of a code snippet (e.g., functionality, usage and version). In an actual development environment, descriptions of the code are missing or not consistent with the code due to human factors, which makes it difficult for developers to comprehend and conduct subsequent maintenance. Some existing methods generate summaries from the sequence information of code without considering the structural information. Recently, researchers have adopted the Graph Neural Networks (GNNs) to capture the structural information with modified Abstract Syntax Trees (ASTs) to comprehensively represent a source code, but the alignment method of the two information encoder is hard to decide. In this paper, we propose a source code summarization model named SSCS, a unified transformer-based encoder\u2013decoder architecture, for capturing structural and sequence information. SSCS is designed upon a structure-induced transformer with three main novel improvements. SSCS captures the structural information in a multi-scale aspect with an adapted fusion strategy and adopts a hierarchical encoding strategy to capture the textual information from the perspective of the document. Moreover, SSCS utilizes a bidirectional decoder which generates a summary from opposite direction to balance the generation performance between prefix and suffix. We conduct experiments on two public Java and Python datasets to evaluate our method and the result show that SSCS outperforms the state-of-art code summarization methods.<\/jats:p>","DOI":"10.3390\/e25040570","type":"journal-article","created":{"date-parts":[[2023,3,27]],"date-time":"2023-03-27T03:31:48Z","timestamp":1679887908000},"page":"570","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":1,"title":["Structure and Sequence Aligned Code Summarization with Prefix and Suffix Balanced Strategy"],"prefix":"10.3390","volume":"25","author":[{"given":"Jianhui","family":"Zeng","sequence":"first","affiliation":[{"name":"Key Laboratory of Aerospace Information Security and Trusted Computing, Ministry of Education, School of Cyber Science and Engineering, Wuhan University, Wuhan 430072, China"}]},{"given":"Zhiheng","family":"Qu","sequence":"additional","affiliation":[{"name":"Key Laboratory of Aerospace Information Security and Trusted Computing, Ministry of Education, School of Cyber Science and Engineering, Wuhan University, Wuhan 430072, China"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-5261-0191","authenticated-orcid":false,"given":"Bo","family":"Cai","sequence":"additional","affiliation":[{"name":"Key Laboratory of Aerospace Information Security and Trusted Computing, Ministry of Education, School of Cyber Science and Engineering, Wuhan University, Wuhan 430072, China"}]}],"member":"1968","published-online":{"date-parts":[[2023,3,26]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","unstructured":"Wan, Y., Zhao, Z., Yang, M., Xu, G., Ying, H., Wu, J., and Yu, P.S. (2018, January 3\u20137). Improving automatic source code summarization via deep reinforcement learning. Proceedings of the 33rd ACM\/IEEE International Conference on Automated Software Engineering, ASE 2018, Montpellier, France.","DOI":"10.1145\/3238147.3238206"},{"key":"ref_2","doi-asserted-by":"crossref","unstructured":"Hill, E., Pollock, L.L., and Vijay-Shanker, K. (2009, January 16\u201324). Automatically capturing source code context of NL-queries for software maintenance and reuse. Proceedings of the 31st International Conference on Software Engineering, ICSE 2009, Vancouver, BC, Canada.","DOI":"10.1109\/ICSE.2009.5070524"},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Haiduc, S., Aponte, J., Moreno, L., and Marcus, A. (2010, January 13\u201316). On the Use of Automated Text Summarization Techniques for Summarizing Source Code. Proceedings of the 17th Working Conference on Reverse Engineering, WCRE 2010, Beverly, MA, USA.","DOI":"10.1109\/WCRE.2010.13"},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"Iyer, S., Konstas, I., Cheung, A., and Zettlemoyer, L. (2016, January 7\u201312). Summarizing Source Code using a Neural Attention Model. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, Berlin, Germany.","DOI":"10.18653\/v1\/P16-1195"},{"key":"ref_5","unstructured":"Allamanis, M., Peng, H., and Sutton, C. (2016, January 19\u201324). A Convolutional Attention Network for Extreme Summarization of Source Code. Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Hu, X., Li, G., Xia, X., Lo, D., Lu, S., and Jin, Z. (2018, January 13\u201319). Summarizing Source Code with Transferred API Knowledge. Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI 2018, Stockholm, Sweden.","DOI":"10.24963\/ijcai.2018\/314"},{"key":"ref_7","unstructured":"Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A.N., Kaiser, L., and Polosukhin, I. (2017, January 4\u20139). Attention is All you Need. Proceedings of the Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, Long Beach, CA, USA."},{"key":"ref_8","doi-asserted-by":"crossref","unstructured":"Ahmad, W.U., Chakraborty, S., Ray, B., and Chang, K. (2020, January 5\u201310). A Transformer-based Approach for Source Code Summarization. Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online.","DOI":"10.18653\/v1\/2020.acl-main.449"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Wu, H., Zhao, H., and Zhang, M. (2021, January 1\u20136). Code Summarization with Structure-induced Transformer. Proceedings of the Findings of the Association for Computational Linguistics: ACL\/IJCNLP 2021, Online Event.","DOI":"10.18653\/v1\/2021.findings-acl.93"},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Gao, Y., and Lyu, C. (2022). M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarization. arXiv.","DOI":"10.1145\/3524610.3527907"},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Gong, Z., Gao, C., Wang, Y., Gu, W., Peng, Y., and Xu, Z. (2022, January 15\u201318). Source Code Summarization with Structural Relative Position Guided Transformer. Proceedings of the IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2022, Honolulu, HI, USA.","DOI":"10.1109\/SANER53432.2022.00013"},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Guo, J., Liu, J., Wan, Y., Li, L., and Zhou, P. (2022, January 22\u201327). Modeling Hierarchical Syntax Structure with Triplet Position for Source Code Summarization. Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2022, Dublin, Ireland.","DOI":"10.18653\/v1\/2022.acl-long.37"},{"key":"ref_13","doi-asserted-by":"crossref","unstructured":"Hu, X., Li, G., Xia, X., Lo, D., and Jin, Z. (2018, January 27\u201328). Deep code comment generation. Proceedings of the 26th Conference on Program Comprehension, ICPC 2018, Gothenburg, Sweden.","DOI":"10.1145\/3196321.3196334"},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"LeClair, A., Jiang, S., and McMillan, C. (2019, January 25\u201331). A neural model for generating natural language summaries of program subroutines. Proceedings of the 41st International Conference on Software Engineering, ICSE 2019, Montreal, QC, Canada.","DOI":"10.1109\/ICSE.2019.00087"},{"key":"ref_15","unstructured":"Alon, U., Brody, S., Levy, O., and Yahav, E. (2019, January 6\u20139). code2seq: Generating Sequences from Structured Representations of Code. Proceedings of the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA."},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Shido, Y., Kobayashi, Y., Yamamoto, A., Miyamoto, A., and Matsumura, T. (2019, January 14\u201319). Automatic Source Code Summarization with Extended Tree-LSTM. Proceedings of the International Joint Conference on Neural Networks, IJCNN 2019, Budapest, Hungary.","DOI":"10.1109\/IJCNN.2019.8851751"},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Wang, Y., Dong, Y., Lu, X., and Zhou, A. (2022). GypSum: Learning Hybrid Representations for Code Summarization. arXiv.","DOI":"10.1145\/3524610.3527903"},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"Choi, Y., Bak, J., Na, C., and Lee, J. (2021, January 1\u20136). Learning Sequential and Structural Information for Source Code Summarization. Proceedings of the Findings of the Association for Computational Linguistics: ACL\/IJCNLP 2021, Online Event.","DOI":"10.18653\/v1\/2021.findings-acl.251"},{"key":"ref_19","unstructured":"Wei, B., Li, G., Xia, X., Fu, Z., and Jin, Z. (2019, January 8\u201314). Code Generation as a Dual Task of Code Summarization. Proceedings of the Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, Vancouver, BC, Canada."},{"key":"ref_20","unstructured":"Liang, Y., and Zhu, K.Q. (2018, January 2\u20137). Automatic Generation of Text Descriptive Comments for Code Blocks. Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, (AAAI-18), the 30th innovative Applications of Artificial Intelligence (IAAI-18), and the 8th AAAI Symposium on Educational Advances in Artificial Intelligence (EAAI-18), New Orleans, LA, USA."},{"key":"ref_21","unstructured":"Fernandes, P., Allamanis, M., and Brockschmidt, M. (2019, January 6\u20139). Structured Neural Summarization. Proceedings of the 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA."},{"key":"ref_22","unstructured":"Li, Y., Tarlow, D., Brockschmidt, M., and Zemel, R.S. (2016, January 2\u20134). Gated Graph Sequence Neural Networks. Proceedings of the 4th International Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"LeClair, A., Haque, S., Wu, L., and McMillan, C. (2020, January 13\u201315). Improved Code Summarization via a Graph Neural Network. Proceedings of the ICPC \u201920: 28th International Conference on Program Comprehension, Seoul, Republic of Korea.","DOI":"10.1145\/3387904.3389268"},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"102","DOI":"10.1109\/TSE.2020.2979701","article-title":"Reinforcement-Learning-Guided Source Code Summarization Using Hierarchical Attention","volume":"48","author":"Wang","year":"2022","journal-title":"IEEE Trans. Softw. Eng."},{"key":"ref_25","unstructured":"Devlin, J., Chang, M., Lee, K., and Toutanova, K. (2019, January 2\u20137). BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA."},{"key":"ref_26","first-page":"140:1","article-title":"Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer","volume":"21","author":"Raffel","year":"2020","journal-title":"J. Mach. Learn. Res."},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Feng, Z., Guo, D., Tang, D., Duan, N., Feng, X., Gong, M., Shou, L., Qin, B., Liu, T., and Jiang, D. (2020, January 16\u201320). CodeBERT: A Pre-Trained Model for Programming and Natural Languages. Proceedings of the Findings of the Association for Computational Linguistics: EMNLP 2020, Online Event.","DOI":"10.18653\/v1\/2020.findings-emnlp.139"},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Wang, Y., Wang, W., Joty, S.R., and Hoi, S.C.H. (2021, January 7\u201311). CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generation. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event\/Punta Cana, Dominican Republic.","DOI":"10.18653\/v1\/2021.emnlp-main.685"},{"key":"ref_29","doi-asserted-by":"crossref","unstructured":"Liu, L., Utiyama, M., Finch, A.M., and Sumita, E. (2016, January 12\u201317). Agreement on Target-bidirectional Neural Machine Translation. Proceedings of the NAACL HLT 2016, The 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, San Diego, CA, USA.","DOI":"10.18653\/v1\/N16-1046"},{"key":"ref_30","doi-asserted-by":"crossref","unstructured":"Papineni, K., Roukos, S., Ward, T., and Zhu, W. (2002, January 6\u201312). Bleu: a Method for Automatic Evaluation of Machine Translation. Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, Philadelphia, PA, USA.","DOI":"10.3115\/1073083.1073135"},{"key":"ref_31","unstructured":"Banerjee, S., and Lavie, A. (2005, January 29). METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments. Proceedings of the Workshop on Intrinsic and Extrinsic Evaluation Measures for Machine Translation and\/or Summarization@ACL 2005, Ann Arbor, MI, USA."},{"key":"ref_32","unstructured":"Lin, C.Y. ROUGE: A Package for Automatic Evaluation of Summaries. Proceedings of the Text Summarization Branches Out."}],"container-title":["Entropy"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1099-4300\/25\/4\/570\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T19:03:24Z","timestamp":1760123004000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1099-4300\/25\/4\/570"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2023,3,26]]},"references-count":32,"journal-issue":{"issue":"4","published-online":{"date-parts":[[2023,4]]}},"alternative-id":["e25040570"],"URL":"https:\/\/doi.org\/10.3390\/e25040570","relation":{},"ISSN":["1099-4300"],"issn-type":[{"type":"electronic","value":"1099-4300"}],"subject":[],"published":{"date-parts":[[2023,3,26]]}}}