paper-with-me

Papers

MGS3: A Multi-Granularity Self-Supervised Code Search Framework

2025-05-30 · Rui Li, Junfeng Kang, Qi Liu, Liyang He, Zheng Zhang, Yunhao Sha, Linbo Zhu, Zhenya Huang

In the pursuit of enhancing software reusability and developer productivity, code search has emerged as a key area, aimed at retrieving code snippets relevant to functionalities based on natural language queries. Despite significant progress in self-supervised code pre-training utilizing the vast amount of code data in repositories, existing methods have primarily focused on leveraging contrastive learning to align natural language with function-level code snippets. These studies have overlooked the abundance of fine-grained (such as block-level and statement-level) code snippets prevalent within the function-level code snippets, which results in suboptimal performance across all levels of granularity. To address this problem, we first construct a multi-granularity code search dataset called MGCodeSearchNet, which contains 536K+ pairs of natural language and code snippets. Subsequently, we introduce a novel Multi-Granularity Self-Supervised contrastive learning code Search framework (MGS$^{3}$}). First, MGS$^{3}$ features a Hierarchical Multi-Granularity Representation module (HMGR), which leverages syntactic structural relationships for hierarchical representation and aggregates fine-grained information into coarser-grained representations. Then, during the contrastive learning phase, we endeavor to construct positive samples of the same granularity for fine-grained code, and introduce in-function negative samples for fine-grained code. Finally, we conduct extensive experiments on code search benchmarks across various granularities, demonstrating that the framework exhibits outstanding performance in code search tasks of multiple granularities. These experiments also showcase its model-agnostic nature and compatibility with existing pre-trained code representation models.

📄 PDF Abstract BibTeX arXiv:2505.24274

Code (0)

등록된 구현이 없습니다.

Tasks

Code SearchContrastive LearningNatural Language Queries

Methods 이 논문이 사용한 방법론

Contrastive Learning 설명 없음
ALIGN In the ALIGN method, visual and language representations are jointly trained from noisy image alt-text data. The image and text encoders are learned via contrastive loss…

Similar Papers 제목 키워드 기반

S5 Framework: A Review of Self-Supervised Shared Semantic Space Optimization for Multimodal Zero-Shot Learning

2022-01-16 · ACL ARR January 2022 1 · Anonymous

In this review, we aim to inspire research into Self-Supervised Shared Semantic Space (S5) multimodal learning problems. We equip non-expert researchers with a framework of informed modeling decisions via an extensive li…

DenoisingZero-Shot Learning

Multi-Granularity Click Confidence Learning via Self-Distillation in Recommendation

2023-09-28 · Chong Liu, Xiaoyang Liu, Lixin Zhang, Feng Xia 외

Recommendation systems rely on historical clicks to learn user interests and provide appropriate items. However, current studies tend to treat clicks equally, which may ignore the assorted intensities of user interests i…

Recommendation SystemsSelf-Supervised Learning

MGAE: Masked Autoencoders for Self-Supervised Learning on Graphs

2022-01-07 · Qiaoyu Tan, Ninghao Liu, Xiao Huang, Rui Chen 외

We introduce a novel masked graph autoencoder (MGAE) framework to perform effective learning on graph structure data. Taking insights from self-supervised learning, we randomly mask a large proportion of edges and try to…

DecoderGraph Neural NetworkLink PredictionNode Classification+1

Granularity-aware Adaptation for Image Retrieval over Multiple Tasks

2022-10-05 · Jon Almazán, Byungsoo Ko, Geonmo Gu, Diane Larlus 외

Strong image search models can be learned for a specific domain, ie. set of labels, provided that some labeled images of that domain are available. A practical visual search model, however, should be versatile enough to …

Image RetrievalPseudo LabelRetrievalSelf-Supervised Learning

UnSAMv2: Self-Supervised Learning Enables Segment Anything at Any Granularity

2025-11-17 · Junwei Yu, Trevor Darrell, XuDong Wang arxiv

The Segment Anything Model (SAM) family has become a widely adopted vision foundation model, but its ability to control segmentation granularity remains limited. Users often need to refine results manually - by adding mo…

Self-Supervised LearningContinuous ControlVideo Segmentation