mlsanityData to 7 Oct 2026

Tram: A Token-level Retrieval-augmented Mechanism for Source Code Summarization

arXiv 2305.11074 ↗First posted 18 May 2023cs.AIcited by 6

On the map: Retrieval-augmented generation → RAG for code

Abstract (arXiv)

Automatically generating human-readable text describing the functionality of a program is the intent of source code summarization. Although neural language models achieve significant performance in this field, they are limited by their inability to access external knowledge. To address this limitation, an emerging trend is combining neural models with external knowledge through retrieval methods. Previous methods have relied on the sentence-level retrieval paradigm on the encoder side. However, this paradigm is coarse-grained, noise-filled and cannot directly take advantage of the high-quality retrieved summary tokens on the decoder side. In this paper, we propose a fine-grained Token-level retrieval-augmented mechanism (Tram) on the decoder side rather than the encoder side to enhance the performance of neural models and produce more low-frequency tokens in generating summaries. Furthermore, to overcome the challenge of token-level retrieval in capturing contextual code semantics, we also propose integrating code semantics into individual summary tokens. The results of extensive experiments and human evaluation show that our token-level retrieval-augmented approach significantly improves performance and is more interpretable.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in RAG for code, one of 15 directions in Retrieval-augmented generation. Builds on 25 of its 36 references that are in the map. First posted on arXiv 18 May 2023.

Builds on

25 of 36 references.

Closest ancestors · 2

Same direction, newest first

  1. 2021Retrieval Augmented Code Generation and Summarization26 Aug
  2. 2020Retrieval-Augmented Generation for Code Summarization via Hybrid GNN9 Jun

Other references · 23

  1. 2017Attention Is All You Needcited by 59,932
  2. 2015Deep Residual Learning for Image Recognitioncited by 51,809
  3. 2017Graph Attention Networkscited by 8,854
  4. 2016Layer Normalizationcited by 5,579
  5. 2017Billion-scale similarity search with GPUscited by 2,477
  6. 2017Get To The Point: Summarization with Pointer-Generator Networkscited by 1,281
  7. 2018Self-Attention with Relative Position Representationscited by 1,112
  8. 2020Nearest Neighbor Machine Translationcited by 209
  9. 2020A Transformer-based Approach for Source Code Summarizationcited by 129
  10. 2018Improving Automatic Source Code Summarization via Deep Reinforcement Learningcited by 99
  11. 2020Improved Code Summarization via a Graph Neural Networkcited by 79
  12. 2019Code Generation as a Dual Task of Code Summarizationcited by 62
11 more
  1. 2021Adaptive Nearest Neighbor Machine Translationcited by 58
  2. 2019Joey NMT: A Minimalist NMT Toolkit for Novicescited by 39
  3. 2021CAST: Enhancing Code Summarization with Hierarchical Splitting and Reconstruction of Abstract Syntax Treescited by 31
  4. 2020Code Summarization with Structure-induced Transformercited by 29
  5. 2016Tree-to-Sequence Attentional Neural Machine Translationcited by 28
  6. 2019Automatic Source Code Summarization with Extended Tree-LSTMcited by 28
  7. 2021Learning Kernel-Smoothed Machine Translation with Retrieved Examplescited by 25
  8. 2017A Neural Architecture for Generating Natural Language Descriptions from Source Code Changescited by 23
  9. 2021Non-Parametric Unsupervised Domain Adaptation for Neural Machine Translationcited by 20
  10. 2018Automatic Generation of Text Descriptive Comments for Code Blockscited by 18
  11. 2022Source Code Summarization with Structural Relative Position Guided Transformercited by 14

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 2; 2024: 1; 2025: 2; 2026: 1.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2024ESALE: Enhancing Code-Summary Alignment Learning for Source Code Summarization
  2. 2024Retrieval-augmented code completion for local projects using large language models
  3. 2024CodeXEmbed: A Generalist Embedding Model Family for Multiligual and Multi-task Code Retrieval
  4. 2025An Empirical Study of Retrieval-Augmented Code Generation: Challenges and Opportunities
  5. 2026Context-Augmented Code Generation Using Programming Knowledge Graphs
  6. 2024Source Code Summarization in the Era of Large Language Models
  7. 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization
  8. 2024Context-Augmented Code Generation Using Programming Knowledge Graphs