mlsanityData to 7 Oct 2026

Source Code Summarization in the Era of Large Language Models

arXiv 2407.07959 ↗First posted 9 Jul 2024cs.SE cs.AIcited by 30

Not on the map. Why?

Abstract (arXiv)

To support software developers in understanding and maintaining programs, various automatic (source) code summarization techniques have been proposed to generate a concise natural language summary (i.e., comment) for a given code snippet. Recently, the emergence of large language models (LLMs) has led to a great boost in the performance of code-related tasks. In this paper, we undertake a systematic and comprehensive study on code summarization in the era of LLMs, which covers multiple aspects involved in the workflow of LLM-based code summarization. Specifically, we begin by examining prevalent automated evaluation methods for assessing the quality of summaries generated by LLMs and find that the results of the GPT-4 evaluation method are most closely aligned with human evaluation. Then, we explore the effectiveness of five prompting techniques (zero-shot, few-shot, chain-of-thought, critique, and expert) in adapting LLMs to code summarization tasks. Contrary to expectations, advanced prompting techniques may not outperform simple zero-shot prompting. Next, we investigate the impact of LLMs' model settings (including topp and temperature parameters) on the quality of generated summaries. We find the impact of the two parameters on summary quality varies by the base LLM and programming language, but their impacts are similar. Moreover, we canvass LLMs' abilities to summarize code snippets in distinct types of programming languages. The results reveal that LLMs perform suboptimally when summarizing code written in logic programming languages compared to other language types. Finally, we unexpectedly find that CodeLlama-Instruct with 7B parameters can outperform advanced GPT-4 in generating summaries describing code implementation details and asserting code properties. We hope that our findings can provide a comprehensive understanding of code summarization in the era of LLMs.

Key facts. Cited by 30 papers in the map (data through 7 Oct 2026). Builds on 50 of its 85 references that are in the map. First posted on arXiv 9 Jul 2024.

Builds on

50 of 85 references.

References · 50

  1. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
  4. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2019BERTScore: Evaluating Text Generation with BERTcited by 5,462
  7. 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
  8. 2023G-Eval: NLG Evaluation using GPT-4 with Better Human Alignmentcited by 2,205
  9. 2023Code Llama: Open Foundation Models for Codecited by 2,105
  10. 2014On the Properties of Neural Machine Translation: Encoder-Decoder Approachescited by 1,303
  11. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  12. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
38 more
  1. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  2. 2023Is ChatGPT a General-Purpose Natural Language Processing Task Solver?cited by 486
  3. 2018Universal Sentence Encodercited by 485
  4. 2023Is ChatGPT a Good NLG Evaluator? A Preliminary Studycited by 420
  5. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
  6. 2023Language Models can Solve Computer Taskscited by 371
  7. 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
  8. 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 178
  9. 2023ExpertPrompting: Instructing Large Language Models to be Distinguished Expertscited by 140
  10. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  11. 2022Few-shot training LLMs for project-specific code-summarizationcited by 128
  12. 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 123
  13. 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
  14. 2022Shortcut Learning of Large Language Models in Natural Language Understandingcited by 83
  15. 2023Element-aware Summarization with Large Language Models: Expert-aligned Evaluation and Chain-of-Thought Methodcited by 76
  16. 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
  17. 2023Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learningcited by 71
  18. 2023A Survey on Large Language Models for Software Engineeringcited by 58
  19. 2021On the Evaluation of Neural Code Summarizationcited by 47
  20. 2023What Makes Good In-context Demonstrations for Code Intelligence Tasks with LLMs?cited by 47
  21. 2024Large Language Model for Vulnerability Detection: Emerging Results and Future Directionscited by 44
  22. 2022No More Fine-Tuning? An Experimental Evaluation of Prompt Tuning in Code Intelligencecited by 41
  23. 2024A Systematic Literature Review on Large Language Models for Automated Program Repaircited by 37
  24. 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
  25. 2023Distilled GPT for Source Code Summarizationcited by 30
  26. 2024Teaching Code LLMs to Use Autocompletion Tools in Repository-Level Code Generationcited by 30
  27. 2020Code Summarization with Structure-induced Transformercited by 29
  28. 2023A Critical Review of Large Language Model on Software Engineering: An Example from ChatGPT and Automated Program Repaircited by 29
  29. 2020Code to Comment "Translation": Data, Metrics, Baselining & Evaluationcited by 28
  30. 2023Disinformation Capabilities of Large Language Modelscited by 23
  31. 2023Evaluating Code Summarization Techniques: A New Metric and an Empirical Characterizationcited by 21
  32. 2023Developer-Intent Driven Code Comment Generationcited by 16
  33. 2023One Adapter for All Programming Languages? Adapter Tuning for Code Search and Summarizationcited by 16
  34. 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
  35. 2023A Prompt Learning Framework for Source Code Summarizationcited by 9
  36. 2024Learning in the Wild: Towards Leveraging Unlabeled Data for Effectively Tuning Pre-trained Code Modelscited by 9
  37. 2024Evaluating Large Language Models for Line-Level Vulnerability Localizationcited by 7
  38. 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 5; 2025: 13; 2026: 12.

30 papers.

Sort:

By area:

  1. 2024Code Comprehension then Auditing for Unsupervised LLM Evaluationcited by 31
  2. 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasetscited by 15
  3. 2024Natural Language Outlines for Code: Literate Programming in the LLM Eracited by 9
  4. 2025Positional Biases Shift as Inputs Approach Context Window Limitscited by 9
  5. 2024CursorCore: Assist Programming through Aligning Anythingcited by 6
  6. 2025Meta-RAG on Large Codebases Using Code Summarizationcited by 4
  7. 2025ALMAS: an Autonomous LLM-based Multi-Agent Software Engineering Frameworkcited by 4
  8. 2024On the Compression of Language Models for Code: An Empirical Study on CodeBERTcited by 3
  9. 2025Requirements Development and Formalization for Reliable Code Generation: A Multi-Agent Visioncited by 3
  10. 2025Reverse Engineering User Stories from Code using Large Language Modelscited by 2
  11. 2026An Exploratory Study on LLM-Generated Code and Comments in Code Repositoriescited by 2
  12. 2025Secure Resource Allocation via Constrained Deep Reinforcement Learningcited by 1
18 more
  1. 2025Can Large Language Models Understand Intermediate Representations in Compilers?cited by 1
  2. 2025Investigating Execution-Aware Language Models for Code Optimizationcited by 1
  3. 2026ArchAgent: Scalable Legacy Software Architecture Recovery with LLMscited by 1
  4. 2026Rethinking Code Review in the Age of AI: A Vision for Agentic Code Reviewcited by 1
  5. 2026DeepDiscovery: A Location-Inference Framework for Task-Level Repository Understandingcited by 1
  6. 2026Automated Summarization of Software Documents: An LLM-based Multi-Agent Approachcited by 1
  7. 2024LSem2Vec: A Simple yet Effective Two-Stage Approach for Source Code Embeddingcited by 0
  8. 2025Issue Retrieval and Verification Enhanced Supplementary Code Comment Generationcited by 0
  9. 2025Knowledge-Guided Multi-Agent Framework for Automated Requirements Development: A Visioncited by 0
  10. 2025On the Difficulty of Selecting Few-Shot Examples for Effective LLM-based Vulnerability Detectioncited by 0
  11. 2025Assertion-Aware Test Code Summarization with Large Language Modelscited by 0
  12. 2026BatCoder: Self-Supervised Bidirectional Code-Documentation Learning via Back-Translationcited by 0
  13. 2026Precision in Practice: Knowledge Guided Code Summarizing Grounded in Industrial Expectationscited by 0
  14. 2026Prompt-Driven Code Summarization: A Systematic Literature Reviewcited by 0
  15. 2026A Metamorphic Testing Approach to Diagnosing Memorization in LLM-Based Program Repaircited by 0
  16. 2026ROSUM-MCTS: Monte Carlo Tree Search-Inspired HDL Code Summarization with Structural Rewardscited by 0
  17. 2026CoSTAR: Data Synthesis-Driven Constraint-Aware COBOL Section Summarization for Legacy System Modernizationcited by 0
  18. 2026Complexity-Aware Evaluation of LLM Comprehensioncited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2024Can Large Language Models Serve as Evaluators for Code Summarization?
  2. 2025Code Summarization Beyond Function Level
  3. 2024The Impact of Prompt Programming on Function-Level Code Generation
  4. 2024A RAG Method for Source Code Inquiry Tailored to Long-Context LLMs
  5. 2026AdaptEval: A Benchmark for Evaluating Large Language Models on Code Snippet Adaptation
  6. 2023Little Giants: Exploring the Potential of Small LLMs as Evaluation Metrics in Summarization in the Eval4NLP 2023 Shared Task
  7. 2026Measuring and Mitigating Bias in Code Generated by Large Language Models
  8. 2025Code Semantic Zooming ↗