A Prompt Learning Framework for Source Code Summarization
Not on the map. Why?
Abstract (arXiv)
(Source) code summarization is the task of automatically generating natural language summaries (also called comments) for given code snippets. Recently, with the successful application of large language models (LLMs) in numerous fields, software engineering researchers have also attempted to adapt LLMs to solve code summarization tasks. The main adaptation schemes include instruction prompting, task-oriented (full-parameter) fine-tuning, and parameter-efficient fine-tuning (PEFT). However, instruction prompting involves designing crafted prompts and requires users to have professional domain knowledge, while task-oriented fine-tuning requires high training costs, and effective, tailored PEFT methods for code summarization are still lacking. This paper proposes an effective prompt learning framework for code summarization called PromptCS. It no longer requires users to rack their brains to design effective prompts. Instead, PromptCS trains a prompt agent that can generate continuous prompts to unleash the potential for LLMs in code summarization. Compared to the human-written discrete prompt, the continuous prompts are produced under the guidance of LLMs and are therefore easier to understand by LLMs. PromptCS is non-invasive to LLMs and freezes the parameters of LLMs when training the prompt agent, which can greatly reduce the requirements for training resources. Our comprehensive experimental results show that PromptCS significantly outperforms instruction prompting schemes (including zero-shot learning and few-shot learning) on all four widely used metrics, and is comparable to the task-oriented fine-tuning scheme. In some base LLMs, e.g., StarCoderBase-1B and -3B, PromptCS even outperforms the task-oriented fine-tuning scheme. More importantly, the training efficiency of PromptCS is faster than the task-oriented fine-tuning scheme, with a more pronounced advantage on larger LLMs.
Key facts. Cited by 9 papers in the map (data through 7 Oct 2026). Builds on 38 of its 72 references that are in the map. First posted on arXiv 26 Dec 2023.
Builds on
38 of 72 references.
References · 38
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,049
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2020Scaling Laws for Neural Language Modelscited by 6,411
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,530
- 2014Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translationcited by 4,016
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
- 2022Self-Instruct: Aligning Language Models with Self-Generated Instructionscited by 2,674
- 2014On the Properties of Neural Machine Translation: Encoder-Decoder Approachescited by 1,303
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
26 more
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2023Is ChatGPT a General-Purpose Natural Language Processing Task Solver?cited by 486
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2022The Stack: 3 TB of permissively licensed source codecited by 354
- 2020A Transformer-based Approach for Source Code Summarizationcited by 129
- 2022Few-shot training LLMs for project-specific code-summarizationcited by 128
- 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
- 2023Is ChatGPT the Ultimate Programming Assistant -- How far is it?cited by 72
- 2021On the Evaluation of Neural Code Summarizationcited by 47
- 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2020Code Summarization with Structure-induced Transformercited by 29
- 2020Code to Comment "Translation": Data, Metrics, Baselining & Evaluationcited by 28
- 2023One Adapter for All Programming Languages? Adapter Tuning for Code Search and Summarizationcited by 16
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2022Semantic Similarity Metrics for Evaluating Source Code Summarizationcited by 14
- 2021NASOA: Towards Faster Task-oriented Online Fine-tuning with a Zoo of Modelscited by 6
- 2023Exploring Large Language Models for Code Explanationcited by 6
- 2019A Convolutional Neural Network for Language-Agnostic Source Code Summarizationcited by 2
Built on by
Citing papers per year: 2024: 6; 2025: 1; 2026: 2.
9 papers.
- 2024RepoAgent: An LLM-Powered Open-Source Framework for Repository-level Code Documentation Generationcited by 69
- 2024Source Code Summarization in the Era of Large Language Modelscited by 30
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2025Commenting Higher-level Code Unit: Full Code, Reduced Code, or Hierarchical Code Summarizationcited by 3
- 2024Icing on the Cake: Automatic Code Summarization at Ericssoncited by 2
- 2024Can the Rookies Cut the Tough Cookie? Exploring the Use of LLMs for SQL Equivalence Checkingcited by 2
- 2024In-Context Code-Text Learning for Bimodal Software Engineeringcited by 0
- 2026Prompt-Driven Code Summarization: A Systematic Literature Reviewcited by 0
- 2026Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflowscited by 0
- 2026Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflows10 Jul 2026
- 2026Prompt-Driven Code Summarization: A Systematic Literature Review16 Apr 2026
- 2025Commenting Higher-level Code Unit: Full Code, Reduced Code, or Hierarchical Code Summarization13 Mar 2025
- 2024Can the Rookies Cut the Tough Cookie? Exploring the Use of LLMs for SQL Equivalence Checking7 Dec 2024
- 2024In-Context Code-Text Learning for Bimodal Software Engineering8 Oct 2024
- 2024Icing on the Cake: Automatic Code Summarization at Ericsson19 Aug 2024
- 2024Source Code Summarization in the Era of Large Language Models9 Jul 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024RepoAgent: An LLM-Powered Open-Source Framework for Repository-level Code Documentation Generation26 Feb 2024