Semantic similarity metrics for evaluating source code summarization
Open accessThe DOI matches its Crossref record; 59 of the 59 references it cites were found in a registry or an index.
Abstract
Source code summarization involves creating brief descriptions of source code in natural language. These descriptions are a key component of software documentation such as JavaDocs. Automatic code summarization is a prized target of software engineering research, due to the high value summaries have to programmers and the simultaneously high cost of writing and maintaining documentation by hand. Current work is almost all based on machine models trained via big data input. Large datasets of examples of code and summaries of that code are used to train an e.g. encoder-decoder neural model. Then the output predictions of the model are evaluated against a set of reference summaries. The input is code not seen by the model, and the prediction is compared to a reference. The means by which a prediction is compared to a reference is essentially word overlap, calculated via a metric such as BLEU or ROUGE. The problem with using word overlap is that not all words in a sentence have the same importance, and many words have synonyms. The result is that calculated similarity may not match the perceived similarity by human readers. In this paper, we conduct an experiment to measure the degree to which various word overlap metrics correlate to human-rated similarity of predicted and reference summaries. We evaluate alternatives based on current work in semantic similarity metrics and propose recommendations for evaluation of source code summarization.
Overview
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Integrity signals
Registry
Cites
Statistics
Verification
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Free: it reads the open-access text and checks the first 5 claims that cite a source we can check. Create a free account to check every claim.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
In the citing paper
“Other proposed metrics such as BERTScore [28,70], BLEURT [58], NU-BIA [37], are computationally expensive, not widely used and thus not readily comparable with prior work for benchmarking.”
From Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization) (2024) · cites this paper as [28]
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Citations
Cites
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., & Polosukhin, I. (2017) · arXiv · doi:10.48550/arxiv.1706.03762 · Cited by 120,404 · cited 1×
“Universal sentence encoder [65] encodes text into high dimensional vectors using transformers [66].”
BackgroundBERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
Devlin, J., Chang, M.-W., Lee, K., & Toutanova, K. (2018) · arXiv · doi:10.48550/arxiv.1810.04805 · Cited by 73,173 · cited 7×
“Similar to the model we use in BertScore, SentenceBert uses RoBERTa to generate embeddings for the words in a sentence.”
MethodInfluentialThree Approaches to Qualitative Content Analysis
Hsieh, H.-F., & Shannon, S. E. (2005) · Qualitative Health Research · doi:10.1177/1049732305276687 · Cited by 44,601 · cited 1×
“Usually the term “reliability” refers to how consistent the ratings given by different people are [42, 43].”
BackgroundGlove: Global Vectors for Word Representation
Pennington, J., Socher, R., & Manning, C. (2014) · Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.3115/v1/d14-1162 · Cited by 34,071 · cited 2×
“A word embedding is a fixed-length representation of words in a vector space [57] [58].”
BackgroundMethodEfficient Estimation of Word Representations in Vector Space
Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013) · arXiv · doi:10.48550/arxiv.1301.3781 · Cited by 26,568 · cited 2×
“A word embedding is a fixed-length representation of words in a vector space [57] [58].”
BackgroundLearning Phrase Representations using RNN Encoder–Decoder for Statistical Machine Translation
Cho, K., van Merrienboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., & Bengio, Y. (2014) · Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP) · doi:10.3115/v1/d14-1179 · Cited by 25,545 · cited 3×
“Both the encoder and decoder layers of the at-tendgru model uses a GRU [68] to encode the text.”
MethodInfluentialBLEU: a method for automatic evaluation of machine translation
Papineni, K., Roukos, S., Ward, T., & Zhu, W.-J. (2001) · Proceedings of the 40th Annual Meeting on Association for Computational Linguistics - ACL '02 · doi:10.3115/1073083.1073135 · Cited by 21,344 · cited 3×
“By far the most popular metric for measuring word overlap in source code summarization research is BLEU [8].”
BackgroundRoBERTa: A Robustly Optimized BERT Pretraining Approach
Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., & Stoyanov, V. (2019) · arXiv · doi:10.48550/arxiv.1907.11692 · Cited by 16,515 · cited 2×
“For our experiment, we use the stsb-roberta-large pre-trained model [62].”
MethodSentence-BERT: Sentence Embeddings using Siamese BERT-Networks
Reimers, N., & Gurevych, I. (2019) · Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP) · doi:10.18653/v1/d19-1410 · Cited by 12,778 · cited 2×
“Results from our experiments showed that the Sentence Bert Encoder (SentenceBert) [14] produced vectorized representations of the summaries that have the highest correlation to perceived similarity by the human experts in our experiment.”
MethodTerm-weighting approaches in automatic text retrieval
Salton, G., & Buckley, C. (1988) · Information Processing & Management · doi:10.1016/0306-4573(88)90021-0 · Cited by 9,740 · cited 1×
“Term frequency-inverse document frequency (tf-idf) reflects the importance of a word to the entire document [63] [64].”
Background
Research works printed but not linked: 11
- [3] D. Kramer, 'Api documentation from source code comments: a case study of javadoc,' in Proceedings of the 17th annual international conference on Computer documentation . ACM, 1999, pp. 147-153. -
- [4] A. Forward and T. C. Lethbridge, 'The relevance of software documentation, tools and technologies: a survey,' in Proceedings of the 2002 ACM symposium on Document engineering . ACM, 2002, pp. 26-33. -
- [13] D. Gros, H. Sezhiyan, P. Devanbu, and Z. Yu, 'Code to comment 'translation': Data, metrics, baselining evaluation,' in 2020 35th IEEE/ACM International Conference on Automated Software Engineering (ASE) , 2020, pp. 746-757. -
- [21] P. Rodeghero, C. McMillan, P. W. McBurney, N. Bosch, and S. D'Mello, 'Improving automated source code summarization via an eye-tracking study of programmers,' in Proceedings of the 36th international conference on Software engineering . ACM, 2014, pp. 390-401. -
- [22] S. Iyer, I. Konstas, A. Cheung, and L. Zettlemoyer, 'Summarizing source code using a neural attention model,' in Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , 2016, pp. 2073-2083. -
- [25] U. Alon, S. Brody, O. Levy, and E. Yahav, 'code2seq: Generating sequences from structured representations of code,' International Conference on Learning Representations , 2019. -
- [26] U. Alon, M. Zilberstein, O. Levy, and E. Yahav, 'code2vec: Learning distributed representations of code,' Proceedings of the ACM on Programming Languages , vol. 3, no. POPL, pp. 1-29, 2019. -
- [34] E. Clark, A. Celikyilmaz, and N. A. Smith, 'Sentence mover's similarity: Automatic evaluation for multi-sentence texts,' in Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics , 2019, pp. 2748-2760. -
- [44] H. C. Kraemer, 'Kappa coefficient,' Wiley StatsRef: Statistics Reference Online , pp. 1-4, 2014. -
- [54] Y. Li, D. McLean, Z. A. Bandar, J. D. O'shea, and K. Crockett, 'Sentence similarity based on semantic nets and corpus statistics,' IEEE transactions on knowledge and data engineering , vol. 18, no. 8, pp. 1138-1150, 2006. -
- [70] C. P. Dancey and J. Reidy, Statistics without maths for psychology . Pearson education, 2007.
Cited by
Items 101–143 of 143
Social Media Text Summarization: A Survey Towards a Transformer-based System Design
Papagiannopoulou, A., & Angeli, C. (2023) · Advances in Science Technology and Engineering Systems Journal · doi:10.25046/aj080604 · Cited by 1
CogCol: Code Graph-Based Contrastive Learning Model for Code Summarization
Shi, Y., Yin, Y., Yu, M., & Chu, L. (2024) · Electronics · doi:10.3390/electronics13101816 · Cited by 2
Merdol, L., Tüzün, E., & Doğrusöz, U. (2025) · Journal of Systems and Software · doi:10.1016/j.jss.2025.112589 · Cited by 1
Mukherjee, U., & Rahman, M. M. (2025) · Journal of Systems and Software · doi:10.1016/j.jss.2025.112636 · Cited by 1
Issue Retrieval and Verification Enhanced Supplementary Code Comment Generation
Zou, Y., Zhao, X., Pan, X., & Xie, B. (2025) · Asia-Pacific Symposium on Internetware · doi:10.1145/3755881.3755897 · Cited by 1
Billah, M. M., Rahman, M. S., & Roy, B. (2025) · International Conference on Evaluation and Assessment in Software Engineering (EASE) · doi:10.1145/3756681.3756977 · Cited by 2
Code2Doc: A Quality-First Curated Dataset for Code DocumentationPreprint
Karaman, R. K., & Akarsu, M. (2025) · arXiv (Cornell University) · doi:10.48550/arxiv.2512.18748 · Cited by 1
Comparing Power Models for circuits design with Mathematical Language Processing
Desormiere, A., Gzara, L., Bigeon, J., & Nguyen-Thê, L. (2024) · Procedia Computer Science · doi:10.1016/j.procs.2024.05.097
Will Metaverse Face Failure in Future Like Nfts: An Empirical Study
(2024) · Journal of Logistics Informatics and Service Science · doi:10.33168/jliss.2024.0313 · Cited by 3
Decentralized lock-free distributed queue in MPI remote memory access model
Paznikov, A. A., Burachenko, A. V., & Abuelsoud, M. M. (2024) · E3S Web of Conferences · doi:10.1051/e3sconf/202454803007
Zhang, S., & Liu, Y. (2024) · Lecture notes in computer science · doi:10.1007/978-3-031-66459-5_1
Evaluation of Code Similarity Search Strategies in Large-Scale Codebases
Martínez-Gil, J., & Yin, S. (2024) · Lecture notes in computer science · doi:10.1007/978-3-662-70140-9_4 · Cited by 1
Is Our Chatbot Telling Lies? Assessing Correctness of an LLM-based Dutch Support ChatbotPreprint
Lassche, H., Overeem, M., & Rastogi, A. (2024) · arXiv (Cornell University) · doi:10.48550/arxiv.2411.00034
Periyasamy, R., & Selvaraj, S. (2024) · Traitement du signal · doi:10.18280/ts.410523
Analysis of Supply Chain Resilience at RiRiShun Logistics Using Simulation Modelling
Meredith, E., Papakostas, N., & Hargaden, V. (2024) · Lecture notes in networks and systems · doi:10.1007/978-3-031-77603-8_6
Empowering Skill Development: A Dual Perspective on Revitalizing Student Engagement
Hawaldar, I. T., Ganesh, A., Roopesh, & Frederick, D. P. (2025) · Studies in big data · doi:10.1007/978-3-031-83915-3_48
Husain (2025) · Journal of Education Technology · doi:10.23887/jet.v9i1.92673
Convolutional Neural Networks for Brain-Computer Interfaces
Shukla, A. K., Rathore, N., Patra, J. P., Dhivya, R., Singh, A. P., Gayathri, B., Kirubakaran, D., & Bhoopathy, V. (2025) · IGI Global eBooks · doi:10.4018/979-8-3693-9445-8.ch004
Using natural language definitions and language models for relationship classification
Amorim, M. M., Lopes, A., Rodrigues, F. H., & Carbonera, J. L. (2025) · Knowledge-Based Systems · doi:10.1016/j.knosys.2025.114154 · Cited by 1
Is Our Chatbot Telling Lies? Assessing Correctness of an Llm-Based Dutch Support ChatbotPreprint
Lassche, H., Overeem, M., & Rastogi, A. (2025) · SSRN Electronic Journal · doi:10.2139/ssrn.5362625
Multiactivity Agent Using LLM for YouTubers
Reddy, S. S., Tiwari, K., & Agarwal, R. (2025) · IFIP advances in information and communication technology · doi:10.1007/978-3-031-98360-3_17
Chowdhary, S. N., & Suryawanshi, S. M. (2025) · Lecture notes in networks and systems · doi:10.1007/978-981-96-5918-0_12
Reinforcement Learning-Based Traffic Signal Control
Husin, H. S., Azman, A., Hamzah, N., Phang, S. K., Yogarayan, S., & Lalitha, R. (2025) · Lecture notes in electrical engineering · doi:10.1007/978-981-96-7249-3_31
Understanding the Impact of Domain Term Explanation on Duplicate Bug Report Detection
Mukherjee, U., & Rahman, M. M. (2025) · International Conference on Evaluation and Assessment in Software Engineering (EASE) · doi:10.1145/3756681.3756978 · Cited by 4
Prompt Recovery From Source Code: A Comparative Study of Large Language Models
Mukherjee, A. (2026) · IEEE Access · doi:10.1109/access.2026.3678864
Artwork Copyright Legal Protection on Non-Fungible Tokens (NFT)
Tuhana, T., Kharisma, D. B., & Khoirunnisa, N. (2024) · Pena Justisia Media Komunikasi dan Kajian Hukum · doi:10.31941/pj.v23i3.4405
Desormiere, A. (2024) · theses.fr (ABES) · doi:10.70675/72647cafz5b43z44dbza579zcb5c8c878d3e
Exploring the Impact of the User’s Browsing Environment on Web Privacy
Intumwayase, J. L. (2024) · theses.fr (ABES) · doi:10.70675/b3612ab4za77az40edzb85fz8a8458703759
Mohammadi, F. A., & Vasconcelos, A. (2025) · IEEE International Conference on Distributed Ledger Technologies (ICDLT) · doi:10.1109/icdlt66400.2025.11466972
“Technological fragmentation, incompatible governance models, and security risks in cross-chain communication [84], [85], particularly the lack of standardized frameworks across diverse platforms [83], explain why technical solutions alone remain insufficient.”
Pothukuchi, S. L. (2025) · Iconic Research and Engineering Journals · doi:10.64388/irev8i8-1716726
Exploring private blockchain solutions for multi-level marketing: Fraud detection in MLM systems
Kaur, M., & Dandotiya, M. (2026) · AIP conference proceedings · doi:10.1063/5.0327534
SEMANTIC TEXT SIMILARITY ESTIMATION ACROSS DIVERSE LARGE LANGUAGE MODELS
Parubochyi, V., Chmykhalo, O., Husak, O., & Shuvar, R. (2026) · Electronics and Information Technologies · doi:10.30970/eli.34.3
Beyond the Prompt: How Novices Engage with AI During Code Summarization
Mohamed, S., Parvin, A., Ismail, N., Amaya, K., Parra, E., & Oliver, M. D. (2026) · ACM/IEEE International Conference on Software Engineering: Companion Proceedings (ICSE-Companion) · doi:10.1145/3786580.3786961 · Cited by 2
G-MACS: Graph-Guided Multi-agent Collaboration for Project-Aware Code Summarization
Qi, R., Li, H., Li, S. Y., & Mao, Y. (2026) · Lecture notes in computer science · doi:10.1007/978-981-92-3403-5_2
A Grounded Theory Study to Guide AI‐Driven Code Comment Improvement
Dhakal, M., Su, C., Wallace, R., Fakhimi, C., Bansal, A., Li, T., Huang, Y., & McMillan, C. (2026) · Journal of Software Evolution and Process · doi:10.1002/smr.70157
“We mitigate the threat from metrics by using two well-studied metrics that have been specifically recommended for code summary evaluation [70, 71], and by using recommended statistical tests [72].”
InfluentialSelf-citationLeveraging Code Embeddings to Identify and Address Blind Spots in Benchmark Creation
Moloney, C. (2026) · Lincoln (University of Nebraska)
Evaluating prompting strategies for LLM-based code generation in offensive security tasks
Luca, R. D., Liguori, P., & Natella, R. (2026) · Information and Software Technology · doi:10.1016/j.infsof.2026.108281
Abstractive Urdu Text Summarization Using Multilingual Transformer Models: A Deep Learning Approach
Laeeq, K., Shaikh, K., & Abbasi, M. A. (2025) · International Journal of Innovations in Science and Technology · doi:10.33411/ijist/1671
Indexing meets machine learning: a systematic literature review of learned indexes
Abdelhamid, M., Elzanfaly, D. S., Nagaty, K. A., & Yakoub, A. (2026) · Journal Of Big Data · doi:10.1186/s40537-026-01542-1
“It requires multi-dimensional architectures that do not need to employ dimension-reduction techniques to learn spatial relationships [60, 61].”
Enriching Experiment Artifacts with LLMs for Comprehensive and Understandable Documentation
Warmuth, K., Hauser, E., Rocha, D. P., Kempf, M., & Carle, G. (2026) · ACM Conference on Reproducibility and Replicability (ACM REP) · doi:10.1145/3820002.3828596
Christian, J., & Hariyanto, S. (2025) · POTERS (Proceedings of Technology, Engineering and Computers)
A Semantic and Lexical Analysis of LLM-Generated Responses in Comparison with Stack Overflow Answers
CELEPKOLU, K. C., Ortakcı, Y., & Karaoğlan, K. M. (2026) · Sakarya University Journal of Computer and Information Sciences · doi:10.35377/saucis...1865546
iLeapTutor: a RAG-enabled generative AI platform for standards-aligned university course authoring
Alboaneen, D., Alanzi, N., Alrshidi, N., Aljearah, W., Alshahrani, S. M., Alsayednasser, F., & Alibrahim, L. (2026) · Frontiers in Computer Science · doi:10.3389/fcomp.2026.1994444
Metadata
- Authors
- Haque, S., Eberhart, Z., Bansal, A., & McMillan, C.
- Affiliations
- University of Notre Dame (US)
- Venue
- Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension
- Publisher
- ACM
- Published
- 2022-05-16
- Pages
- 36-47
- OpenAlex
- W4313185449
- Semantic Scholar
- 763977b812a08dc0e4214fd8ce4a5aba5fe26044
- Cited by
- 116
- References
- 59
- Citations by year
- 2026: 13 · 2025: 42 · 2024: 40 · 2023: 20 · 2022: 1
- FWCI
- 23.02
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- IEEE International Conference on Program Comprehension (ICPC) (publishedVersion)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Funders
- NSF (CCF-2100035)
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Keywords
- source code summarization, semantic similarity metrics, BLEU, ROUGE, synonymy (linguistics), software documentation
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review
Data sources
Bibliographic data: Semantic Scholar, OpenAlex, Crossref.
Contains information from the Semantic Scholar Academic Graph Datasets, made available under the ODC Attribution License (ODC-BY 1.0).
Semantic Scholar’s data is described in: Kinney, R., et al. (2023). The Semantic Scholar Open Data Platform. arXiv:2301.10140.