mlsanityData to 14 Oct 2026

CodeSAM: Source Code Representation Learning by Infusing Self-Attention with Multi-Code-View Graphs

arXiv 2411.14611 ↗First posted 21 Nov 2024cs.SE cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

Machine Learning (ML) for software engineering (SE) has gained prominence due to its ability to significantly enhance the performance of various SE applications. This progress is largely attributed to the development of generalizable source code representations that effectively capture the syntactic and semantic characteristics of code. In recent years, pre-trained transformer-based models, inspired by natural language processing (NLP), have shown remarkable success in SE tasks. However, source code contains structural and semantic properties embedded within its grammar, which can be extracted from structured code-views like the Abstract Syntax Tree (AST), Data-Flow Graph (DFG), and Control-Flow Graph (CFG). These code-views can complement NLP techniques, further improving SE tasks. Unfortunately, there are no flexible frameworks to infuse arbitrary code-views into existing transformer-based models effectively. Therefore, in this work, we propose CodeSAM, a novel scalable framework to infuse multiple code-views into transformer-based models by creating self-attention masks. We use CodeSAM to fine-tune a small language model (SLM) like CodeBERT on the downstream SE tasks of semantic code search, code clone detection, and program classification. Experimental results show that by using this technique, we improve downstream performance when compared to SLMs like GraphCodeBERT and CodeBERT on all three tasks by utilizing individual code-views or a combination of code-views during fine-tuning. We believe that these results are indicative that techniques like CodeSAM can help create compact yet performant code SLMs that fit in resource constrained settings.

Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 6 of its 56 references that are in the map. First posted on arXiv 21 Nov 2024.

Builds on

6 of 56 references.

References · 6

  1. 2020Longformer: The Long-Document Transformercited by 3,413
  2. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
  3. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  4. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
  5. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
  6. 2022Multi-View Graph Representation for Programming Language Processing: An Investigation into Algorithm Detectioncited by 6

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.