mlsanityData to 14 Oct 2026

Revisiting File Context for Source Code Summarization

arXiv 2309.02326 ↗First posted 5 Sep 2023cs.SE cs.AIcited by 3

Not on the map. Why?

Abstract (arXiv)

Source code summarization is the task of writing natural language descriptions of source code. A typical use case is generating short summaries of subroutines for use in API documentation. The heart of almost all current research into code summarization is the encoder-decoder neural architecture, and the encoder input is almost always a single subroutine or other short code snippet. The problem with this setup is that the information needed to describe the code is often not present in the code itself -- that information often resides in other nearby code. In this paper, we revisit the idea of ``file context'' for code summarization. File context is the idea of encoding select information from other subroutines in the same file. We propose a novel modification of the Transformer architecture that is purpose-built to encode file context and demonstrate its improvement over several baselines. We find that file context helps on a subset of challenging examples where traditional approaches struggle.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 31 of its 53 references that are in the map. First posted on arXiv 5 Sep 2023.

Builds on

31 of 53 references.

References · 31

  1. 2017Attention Is All You Needcited by 60,361
  2. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,380
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  4. 2014Sequence to Sequence Learning with Neural Networkscited by 2,986
  5. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  6. 2021Unified Pre-training for Program Understanding and Generationcited by 366
  7. 2018code2vec: Learning Distributed Representations of Codecited by 250
  8. 2020A Transformer-based Approach for Source Code Summarizationcited by 133
  9. 2022Few-shot training LLMs for project-specific code-summarizationcited by 129
  10. 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 126
  11. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 100
  12. 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNNcited by 89
19 more
  1. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  2. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 77
  3. 2020Improve Transformer Models with Better Relative Position Embeddingscited by 73
  4. 2022CoCoMIC: Code Completion By Jointly Modeling In-file and Cross-file Contextcited by 65
  5. 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
  6. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
  7. 2019Recommendations for Datasets for Source Code Summarizationcited by 46
  8. 2019Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 36
  9. 2020Improved Automatic Summarization of Subroutines via Attention to File Contextcited by 34
  10. 2021Project-Level Encoding for Neural Source Code Summarization of Subroutinescited by 24
  11. 2022Are We Building on the Rock? On the Importance of Data Preprocessing for Code Summarizationcited by 22
  12. 2020A Multi-Perspective Architecture for Semantic Code Searchcited by 20
  13. 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
  14. 2022Semantic Similarity Metrics for Evaluating Source Code Summarizationcited by 14
  15. 2021Action Word Prediction for Neural Source Code Summarizationcited by 11
  16. 2021Named Tensor Notationcited by 11
  17. 2020Retrieve and Refine: Exemplar-based Neural Comment Generationcited by 10
  18. 2023Towards Modeling Human Attention from Eye Movements for Neural Source Code Summarizationcited by 8
  19. 2021A Context-based Automated Approach for Method Name Consistency Checking and Suggestioncited by 5

Built on by

Cited by year

Citing papers per year: 2025: 3.

3 papers.