paper-with-me

홈 › Papers

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

2024-11-21 · Alex Mathai, Kranthi Sedamaki, Debeshee Das, Noble Saji Mathews, Srikanth Tamilselvam, Sridhar Chimalakonda, Atul Kumar

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.

📄 PDF Abstract BibTeX arXiv:2411.14611

Code (1)

ibm/tree-sitter-codeviews

Tasks

Clone DetectionCode SearchRepresentation LearningSmall Language Model

Methods 이 논문이 사용한 방법론

CodeBERT 설명 없음

Similar Papers 제목 키워드 기반

SMILE: Infusing Spatial and Motion Semantics in Masked Video Learning

2025-04-01 · CVPR 2025 1 · Fida Mohammad Thoker, Letian Jiang, Chen Zhao, Bernard Ghanem

Masked video modeling, such as VideoMAE, is an effective paradigm for video self-supervised learning (SSL). However, they are primarily based on reconstructing pixel-level details on natural videos which have substantial…

Representation LearningSelf-Supervised Learning

KSAM: Infusing Multi-Source Knowledge into Dialogue Generation via Knowledge Source Aware Multi-Head Decoding

2022-05-01 · Findings (ACL) 2022 5 · Sixing Wu, Ying Li, Dawei Zhang, Zhonghai Wu

Knowledge-enhanced methods have bridged the gap between human beings and machines in generating dialogue responses. However, most previous works solely seek knowledge from a single source, and thus they often fail to obt…

DecoderDialogue GenerationDiversity

Infusing Prompts with Syntax and Semantics

2024-12-08 · Anton Bulle Labate, Fabio Gagliardi Cozman

Despite impressive success, language models often generate outputs with flawed linguistic structure. We analyze the effect of directly infusing various kinds of syntactic and semantic information into large language mode…

Natural Language QueriesTranslation

Infusing Commonsense World Models with Graph Knowledge

2023-01-13 · Alexander Gurung, Mojtaba Komeili, Arthur Szlam, Jason Weston 외

While language models have become more capable of producing compelling language, we find there are still gaps in maintaining consistency, especially when describing events in a dynamically changing world. We study the se…

Passing Parser Uncertainty to the Transformer. Labeled Dependency Distributions for Neural Machine Translation.

2022-06-01 · EAMT 2022 6 · Dongqi Pu, Khalil Sima’an

Existing syntax-enriched neural machine translation (NMT) models work either with the single most-likely unlabeled parse or the set of n-best unlabeled parses coming out of an external parser. Passing a single or n-best …

Machine TranslationNMTTranslation