Large Language Models are Few-Shot Summarizers: Multi-Intent Comment Generation via In-Context Learning
Not on the map. Why?
Abstract (arXiv)
Code comment generation aims at generating natural language descriptions for a code snippet to facilitate developers' program comprehension activities. Despite being studied for a long time, a bottleneck for existing approaches is that given a code snippet, they can only generate one comment while developers usually need to know information from diverse perspectives such as what is the functionality of this code snippet and how to use it. To tackle this limitation, this study empirically investigates the feasibility of utilizing large language models (LLMs) to generate comments that can fulfill developers' diverse intents. Our intuition is based on the facts that (1) the code and its pairwise comment are used during the pre-training process of LLMs to build the semantic connection between the natural language and programming language, and (2) comments in the real-world projects, which are collected for the pre-training, usually contain different developers' intents. We thus postulate that the LLMs can already understand the code from different perspectives after the pre-training. Indeed, experiments on two large-scale datasets demonstrate the rationale of our insights: by adopting the in-context learning paradigm and giving adequate prompts to the LLM (e.g., providing it with ten or more examples), the LLM can significantly outperform a state-of-the-art supervised learning approach on generating comments with multiple intents. Results also show that customized strategies for constructing the prompts and post-processing strategies for reranking the results can both boost the LLM's performances, which shed light on future research directions for using LLMs to achieve comment generation.
Key facts. Cited by 71 papers in the map (data through 7 Oct 2026). First posted on arXiv 22 Apr 2023.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2023: 8; 2024: 32; 2025: 23; 2026: 8.
71 papers.
Sort:
By area:
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2024AI Agents Under Threat: A Survey of Key Security Challenges and Future Pathwayscited by 122
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2024MarsCode Agent: AI-native Automated Bug Fixingcited by 68
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2025LLM-based Agents Suffer from Hallucinations: A Survey of Taxonomy, Methods, and Directionscited by 49
- 2023Look Before You Leap: An Exploratory Study of Uncertainty Measurement for Large Language Modelscited by 40
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?cited by 37
- 2024Source Code Summarization in the Era of Large Language Modelscited by 30
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2023A Comparative Analysis of Large Language Models for Code Documentation Generationcited by 24
38 more
- 2024The Future of AI-Driven Software Engineeringcited by 23
- 2024An Empirical Study on LLM-based Agents for Automated Bug Fixingcited by 23
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2024A Pair Programming Framework for Code Generation via Multi-Plan Exploration and Feedback-Driven Refinementcited by 21
- 2024NLPerturbator: Studying the Robustness of Code LLMs to Natural Language Variationscited by 19
- 2024Comparison of Static Application Security Testing Tools and Large Language Models for Repo-level Vulnerability Detectioncited by 18
- 2024Evaluating Software Development Agents: Patch Patterns, Code Quality, and Issue Complexity in Real-World GitHub Scenarioscited by 16
- 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasetscited by 15
- 2024Calibration of Large Language Models on Code Summarizationcited by 12
- 2025Reflections on the Reproducibility of Commercial LLM Performance in Empirical Software Engineering Studiescited by 12
- 2024KADEL: Knowledge-Aware Denoising Learning for Commit Message Generationcited by 10
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completioncited by 10
- 2024Output Format Biases in the Evaluation of Large Language Models for Code Translationcited by 9
- 2024Natural Language Outlines for Code: Literate Programming in the LLM Eracited by 9
- 2024A Deep Dive Into Large Language Model Code Generation Mistakes: What and Why?cited by 9
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generationcited by 9
- 2024Model Editing for LLMs4Code: How Far are We?cited by 8
- 2024Can Developers Prompt? A Controlled Experiment for Code Documentation Generationcited by 7
- 2024Prompting and Fine-tuning Large Language Models for Automated Code Review Comment Generationcited by 7
- 2023Exploring Large Language Models for Code Explanationcited by 6
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2024Instruct or Interact? Exploring and Eliciting LLMs' Capability in Code Snippet Adaptation Through Prompt Engineeringcited by 6
- 2025Large Language Models are Qualified Benchmark Builders: Rebuilding Pre-Training Datasets for Advancing Code Intelligence Taskscited by 6
- 2023Semantic Similarity Loss for Neural Source Code Summarizationcited by 5
- 2025Generative AI for Self-Adaptive Systems: State of the Art and Research Roadmapcited by 5
- 2025Too Easily Fooled? Prompt Injection Breaks LLMs on Frustratingly Simple Multiple-Choice Questionscited by 4
- 2025LLM Agents for Automated Web Vulnerability Reproduction: Are We There Yet?cited by 4
- 2025Issue-Oriented Agent-Based Framework for Automated Review Comment Generationcited by 4
- 2023Language Models are Better Bug Detector Through Code-Pair Classificationcited by 3
- 2024Log Parsing using LLMs with Self-Generated In-Context Learning and Self-Correctioncited by 3
- 2025Leveraging Metamemory Agent for Enhanced Data-Free Code Generation in Large Language Modelscited by 3
- 2025Commenting Higher-level Code Unit: Full Code, Reduced Code, or Hierarchical Code Summarizationcited by 3
- 2026Atomizer: An LLM-based Collaborative Multi-Agent Framework for Intent-Driven Commit Untanglingcited by 3
- 2024MESIA: Understanding and Leveraging Supplementary Nature of Method-level Comments for Automatic Comment Generationcited by 2
- 2024Icing on the Cake: Automatic Code Summarization at Ericssoncited by 2
- 2024Exploring the Integration of Large Language Models in Industrial Test Maintenance Processescited by 2
- 2024Can the Rookies Cut the Tough Cookie? Exploring the Use of LLMs for SQL Equivalence Checkingcited by 2
- 2025Zero-Shot Cross-Domain Code Search without Fine-Tuningcited by 2
50 most cited of 71 All 71 (JSON)
- 2026On Predicting Vulnerability Severity Using In-Context Learning: An Industrial Case Study22 Aug 2026
- 2026Transformer-Assisted LLM-Based Source Code Summarisation: to Enable More Secure Software Development23 Jul 2026
- 2026Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation14 May 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review16 Apr 2026
- 2026Precision in Practice: Knowledge Guided Code Summarizing Grounded in Industrial Expectations3 Feb 2026
- 2026On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Study30 Jan 2026
- 2026Atomizer: An LLM-based Collaborative Multi-Agent Framework for Intent-Driven Commit Untangling3 Jan 2026
- 2025Multi-Intent Spoken Language Understanding: Methods, Trends, and Challenges12 Dec 2025
- 2025Generative AI for Self-Adaptive Systems: State of the Art and Research Roadmap4 Dec 2025
- 2025When More Retrieval Hurts: Retrieval-Augmented Code Review Generation7 Nov 2025
- 2025Issue-Oriented Agent-Based Framework for Automated Review Comment Generation1 Nov 2025
38 more
- 2025LLMBisect: Breaking Barriers in Bug Bisection with A Comparative Analysis Pipeline30 Oct 2025
- 2025Reflections on the Reproducibility of Commercial LLM Performance in Empirical Software Engineering Studies29 Oct 2025
- 2025LLM Agents for Automated Web Vulnerability Reproduction: Are We There Yet?16 Oct 2025
- 2025LLM-based Agents Suffer from Hallucinations: A Survey of Taxonomy, Methods, and Directions23 Sep 2025
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?18 Sep 2025
- 2025Too Easily Fooled? Prompt Injection Breaks LLMs on Frustratingly Simple Multiple-Choice Questions16 Aug 2025
- 2025LibRec: Benchmarking Retrieval-Augmented LLMs for Library Migration Recommendations13 Aug 2025
- 2025Issue Retrieval and Verification Enhanced Supplementary Code Comment Generation17 Jun 2025
- 2025Contamination Means Overestimation? A Fine-Grained Empirical Study in Code Intelligence3 Jun 2025
- 2025Towards Conversational Development Environments: Using Theory-of-Mind and Multi-Agent Architectures for Requirements Refinement27 May 2025
- 2025AI-Mediated Code Comment Improvement13 May 2025
- 2025Large Language Models are Qualified Benchmark Builders: Rebuilding Pre-Training Datasets for Advancing Code Intelligence Tasks28 Apr 2025
- 2025Zero-Shot Cross-Domain Code Search without Fine-Tuning10 Apr 2025
- 2025Large Language Models (LLMs) for Source Code Analysis: applications, models and datasets21 Mar 2025
- 2025Commenting Higher-level Code Unit: Full Code, Reduced Code, or Hierarchical Code Summarization13 Mar 2025
- 2025Mitigating Sensitive Information Leakage in LLMs4Code through Machine Unlearning9 Feb 2025
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generation5 Feb 2025
- 2025Leveraging Metamemory Agent for Enhanced Data-Free Code Generation in Large Language Models14 Jan 2025
- 2025Semantic Captioning: Benchmark Dataset and Graph-Aware Few-Shot In-Context Learning for SQL2Text6 Jan 2025
- 2024Selective Shot Learning for Code Explanation17 Dec 2024
- 2024Can the Rookies Cut the Tough Cookie? Exploring the Use of LLMs for SQL Equivalence Checking7 Dec 2024
- 2024Synergizing LLMs and Knowledge Graphs: A Novel Approach to Software Repository-Related Question Answering5 Dec 2024
- 2024Instruct or Interact? Exploring and Eliciting LLMs' Capability in Code Snippet Adaptation Through Prompt Engineering23 Nov 2024
- 2024An Empirical Study on LLM-based Agents for Automated Bug Fixing15 Nov 2024
- 2024Prompting and Fine-tuning Large Language Models for Automated Code Review Comment Generation15 Nov 2024
- 2024Model Editing for LLMs4Code: How Far are We?11 Nov 2024
- 2024A Deep Dive Into Large Language Model Code Generation Mistakes: What and Why?3 Nov 2024
- 2024Evaluating Software Development Agents: Patch Patterns, Code Quality, and Issue Complexity in Real-World GitHub Scenarios16 Oct 2024
- 2024In-Context Code-Text Learning for Bimodal Software Engineering8 Oct 2024
- 2024Generating Equivalent Representations of Code By A Self-Reflection Approach4 Oct 2024
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completion23 Sep 2024
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024Exploring the Integration of Large Language Models in Industrial Test Maintenance Processes10 Sep 2024
- 2024A Pair Programming Framework for Code Generation via Multi-Plan Exploration and Feedback-Driven Refinement8 Sep 2024
- 2024MarsCode Agent: AI-native Automated Bug Fixing2 Sep 2024
- 2024Icing on the Cake: Automatic Code Summarization at Ericsson19 Aug 2024
- 2024Natural Language Outlines for Code: Literate Programming in the LLM Era9 Aug 2024
- 2024Can Developers Prompt? A Controlled Experiment for Code Documentation Generation1 Aug 2024
50 newest of 71 All 71 (JSON)
- 2024MarsCode Agent: AI-native Automated Bug Fixingcited by 68
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2025LLM-based Agents Suffer from Hallucinations: A Survey of Taxonomy, Methods, and Directionscited by 49
- 2024An Empirical Study on LLM-based Agents for Automated Bug Fixingcited by 23
- 2024Evaluating Software Development Agents: Patch Patterns, Code Quality, and Issue Complexity in Real-World GitHub Scenarioscited by 16
- 2025LLM Agents for Automated Web Vulnerability Reproduction: Are We There Yet?cited by 4
- 2025Issue-Oriented Agent-Based Framework for Automated Review Comment Generationcited by 4
- 2025Leveraging Metamemory Agent for Enhanced Data-Free Code Generation in Large Language Modelscited by 3
- 2026Atomizer: An LLM-based Collaborative Multi-Agent Framework for Intent-Driven Commit Untanglingcited by 3
- 2025Towards Conversational Development Environments: Using Theory-of-Mind and Multi-Agent Architectures for Requirements Refinementcited by 1
- 2026Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentationcited by 1
- 2026Remember Your Trace: Memory-Guided Long-Horizon Agentic Framework for Consistent and Hierarchical Repository-Level Code Documentation14 May 2026
- 2026Atomizer: An LLM-based Collaborative Multi-Agent Framework for Intent-Driven Commit Untangling3 Jan 2026
- 2025Issue-Oriented Agent-Based Framework for Automated Review Comment Generation1 Nov 2025
- 2025LLM Agents for Automated Web Vulnerability Reproduction: Are We There Yet?16 Oct 2025
- 2025LLM-based Agents Suffer from Hallucinations: A Survey of Taxonomy, Methods, and Directions23 Sep 2025
- 2025Towards Conversational Development Environments: Using Theory-of-Mind and Multi-Agent Architectures for Requirements Refinement27 May 2025
- 2025Leveraging Metamemory Agent for Enhanced Data-Free Code Generation in Large Language Models14 Jan 2025
- 2024An Empirical Study on LLM-based Agents for Automated Bug Fixing15 Nov 2024
- 2024Evaluating Software Development Agents: Patch Patterns, Code Quality, and Issue Complexity in Real-World GitHub Scenarios16 Oct 2024
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024MarsCode Agent: AI-native Automated Bug Fixing2 Sep 2024
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generationcited by 9
- 2025When More Retrieval Hurts: Retrieval-Augmented Code Review Generationcited by 2
- 2025Issue Retrieval and Verification Enhanced Supplementary Code Comment Generationcited by 0
- 2025LibRec: Benchmarking Retrieval-Augmented LLMs for Library Migration Recommendationscited by 0
- 2025When More Retrieval Hurts: Retrieval-Augmented Code Review Generation7 Nov 2025
- 2025LibRec: Benchmarking Retrieval-Augmented LLMs for Library Migration Recommendations13 Aug 2025
- 2025Issue Retrieval and Verification Enhanced Supplementary Code Comment Generation17 Jun 2025
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generation5 Feb 2025
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
- 2024AI Agents Under Threat: A Survey of Key Security Challenges and Future Pathwayscited by 122
- 2024EvoCodeBench: An Evolving Code Generation Benchmark Aligned with Real-World Code Repositoriescited by 71
- 2024Exploring and Unleashing the Power of Large Language Models in Automated Code Translationcited by 57
- 2023Look Before You Leap: An Exploratory Study of Uncertainty Measurement for Large Language Modelscited by 40
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?cited by 37
- 2024Source Code Summarization in the Era of Large Language Modelscited by 30
- 2023Exploring Parameter-Efficient Fine-Tuning Techniques for Code Generation with Large Language Modelscited by 28
- 2023A Comparative Analysis of Large Language Models for Code Documentation Generationcited by 24
- 2024The Future of AI-Driven Software Engineeringcited by 23
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2024A Pair Programming Framework for Code Generation via Multi-Plan Exploration and Feedback-Driven Refinementcited by 21
12 most cited of 53 All 53 (JSON)
- 2026On Predicting Vulnerability Severity Using In-Context Learning: An Industrial Case Study22 Aug 2026
- 2026Transformer-Assisted LLM-Based Source Code Summarisation: to Enable More Secure Software Development23 Jul 2026
- 2026Bridging Generation and Training: A Systematic Review of Quality Issues in LLMs for Code6 May 2026
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review16 Apr 2026
- 2026Precision in Practice: Knowledge Guided Code Summarizing Grounded in Industrial Expectations3 Feb 2026
- 2026On the Impact of Code Comments for Automated Bug-Fixing: An Empirical Study30 Jan 2026
- 2025Multi-Intent Spoken Language Understanding: Methods, Trends, and Challenges12 Dec 2025
- 2025Generative AI for Self-Adaptive Systems: State of the Art and Research Roadmap4 Dec 2025
- 2025LLMBisect: Breaking Barriers in Bug Bisection with A Comparative Analysis Pipeline30 Oct 2025
- 2025Reflections on the Reproducibility of Commercial LLM Performance in Empirical Software Engineering Studies29 Oct 2025
- 2025SWE-QA: Can Language Models Answer Repository-level Code Questions?18 Sep 2025
- 2025Contamination Means Overestimation? A Fine-Grained Empirical Study in Code Intelligence3 Jun 2025
12 newest of 53 All 53 (JSON)