CoCoSum: Contextual Code Summarization with Multi-Relational Graph Neural Network
Not on the map. Why?
Abstract (arXiv)
Source code summaries are short natural language descriptions of code snippets that help developers better understand and maintain source code. There has been a surge of work on automatic code summarization to reduce the burden of writing summaries manually. However, most contemporary approaches mainly leverage the information within the boundary of the method being summarized (i.e., local context), and ignore the broader context that could assist with code summarization. This paper explores two global contexts, namely intra-class and inter-class contexts, and proposes the model CoCoSUM: Contextual Code Summarization with Multi-Relational Graph Neural Networks. CoCoSUM first incorporates class names as the intra-class context to generate the class semantic embeddings. Then, relevant Unified Modeling Language (UML) class diagrams are extracted as inter-class context and are encoded into the class relational embeddings using a novel Multi-Relational Graph Neural Network (MRGNN). Class semantic embeddings and class relational embeddings, together with the outputs from code token encoder and AST encoder, are passed to a decoder armed with a two-level attention mechanism to generate high-quality, context-aware code summaries. We conduct extensive experiments to evaluate our approach and compare it with other automatic code summarization models. The experimental results show that CoCoSUM is effective and outperforms state-of-the-art methods. Our source code and experimental data are available in the supplementary materials and will be made publicly available.
Key facts. Cited by 22 papers in the map (data through 7 Oct 2026). First posted on arXiv 5 Jul 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 2; 2022: 5; 2023: 5; 2024: 4; 2025: 1; 2026: 5.
22 papers.
Sort:
By area:
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 64
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2024Agents in Software Engineering: Survey, Landscape, and Visioncited by 60
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completioncited by 55
- 2021On the Evaluation of Neural Code Summarizationcited by 47
- 2021Multilingual training for Software Engineeringcited by 43
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2023Exploring Continual Learning for Code Generation Modelscited by 22
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
10 more
- 2024RACONTEUR: A Knowledgeable, Insightful, and Portable LLM-Powered Shell Command Explainercited by 9
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarizationcited by 6
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2022A Survey of Deep Learning Models for Structural Code Understandingcited by 4
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generationcited by 3
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
- 2023Statement-based Memory for Neural Source Code Summarizationcited by 2
- 2026PhoenixRepair: Rethinking Repair Strategy Exploration in Software Agentscited by 2
- 2026SWE-Gate: Passing Functional Tests Is Not Enough for Software Engineering Agentscited by 0
- 2026SWE-Gate: Passing Functional Tests Is Not Enough for Software Engineering Agents3 Sep 2026
- 2026PhoenixRepair: Rethinking Repair Strategy Exploration in Software Agents21 Jul 2026
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning28 Jan 2026
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2026ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generation14 Jan 2026
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2024Agents in Software Engineering: Survey, Landscape, and Vision13 Sep 2024
- 2024RACONTEUR: A Knowledgeable, Insightful, and Portable LLM-Powered Shell Command Explainer3 Sep 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2024Repoformer: Selective Retrieval for Repository-Level Code Completion15 Mar 2024
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Code14 Nov 2023
10 more
- 2023Statement-based Memory for Neural Source Code Summarization21 Jul 2023
- 2023Exploring Continual Learning for Code Generation Models5 Jul 2023
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?22 May 2023
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Context20 Dec 2022
- 2022Repository-Level Prompt Generation for Large Language Models of Code26 Jun 2022
- 2022An Extractive-and-Abstractive Framework for Source Code Summarization15 Jun 2022
- 2022A Survey of Deep Learning Models for Structural Code Understanding3 May 2022
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarization18 Mar 2022
- 2021Multilingual training for Software Engineering3 Dec 2021
- 2021On the Evaluation of Neural Code Summarization15 Jul 2021
- 2022Repository-Level Prompt Generation for Large Language Models of Codecited by 106
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 64
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Codecited by 62
- 2021On the Evaluation of Neural Code Summarizationcited by 47
- 2021Multilingual training for Software Engineeringcited by 43
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?cited by 34
- 2023Exploring Continual Learning for Code Generation Modelscited by 22
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 15
- 2022M2TS: Multi-Scale Multi-Modal Approach Based on Transformer for Source Code Summarizationcited by 14
- 2025Towards an Understanding of Context Utilization in Code Intelligencecited by 10
- 2024RACONTEUR: A Knowledgeable, Insightful, and Portable LLM-Powered Shell Command Explainercited by 9
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completioncited by 7
12 most cited of 16 All 16 (JSON)
- 2026AlignCoder: Aligning Retrieval with Target Intent for Repository-Level Code Completion27 Jan 2026
- 2025Towards an Understanding of Context Utilization in Code Intelligence11 Apr 2025
- 2024RACONTEUR: A Knowledgeable, Insightful, and Portable LLM-Powered Shell Command Explainer3 Sep 2024
- 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization1 Jul 2024
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023Unifying the Perspectives of NLP and Software Engineering: A Survey on Language Models for Code14 Nov 2023
- 2023Statement-based Memory for Neural Source Code Summarization21 Jul 2023
- 2023Exploring Continual Learning for Code Generation Models5 Jul 2023
- 2023Automatic Code Summarization via ChatGPT: How Far Are We?22 May 2023
- 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Context20 Dec 2022
- 2022Repository-Level Prompt Generation for Large Language Models of Code26 Jun 2022
- 2022An Extractive-and-Abstractive Framework for Source Code Summarization15 Jun 2022
12 newest of 16 All 16 (JSON)