Lune

AAAI2024Top-tier venue

CONSIDER: Commonalities and Specialties Driven Multilingual Code Retrieval Framework

Rui Li, Liyang He, Qi Liu, Yuze Zhao, Zheng Zhang, Zhenya Huang, Yu Su, Shijin Wang

Abstract

Multilingual code retrieval aims to find code snippets relevant to a user's query from a multilingual codebase, which plays a crucial role in software development and expands their application scenarios compared to classical monolingual code retrieval. Despite the performance improvements achieved by previous studies, two crucial problems are overlooked in the multilingual scenario. First, certain programming languages face data scarcity in specific domains, resulting in limited representation capabilities within those domains. Second, different programming languages can be used interchangeably within the same domain, making it challenging for multilingual models to accurately identify the intended programming language of a user's query. To address these issues, we propose the CommONalities and SpecIalties Driven Multilingual CodE Retrieval Framework (CONSIDER), which includes two modules. The first module enhances the representation of various programming languages by modeling pairwise and global commonalities among them. The second module introduces a novel contrastive learning negative sampling algorithm that leverages language confusion to automatically extract specific language features. Through our experiments, we confirm the significant benefits of our model in real-world multilingual code retrieval scenarios in various aspects. Furthermore, an evaluation demonstrates the effectiveness of our proposed CONSIDER framework in monolingual scenarios as well. Our source code is available at https://github.com/smsquirrel/consider .

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • VERSE: Verification-based Self-Play for Code Instructions cites Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language Models
  • Cross-domain recommendation via user interest alignment cites A Simple Framework for Contrastive Learning of Visual Representations
  • Distribution-Driven Dense Retrieval: Modeling Many-to-One Query-Document Relationship cites Dense Passage Retrieval for Open-Domain Question Answering
  • Distribution-Driven Dense Retrieval: Modeling Many-to-One Query-Document Relationship cites Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language Models
  • Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language Models cites CodeBERT: A Pre-Trained Model for Programming and Natural Languages
  • Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language Models cites GraphCodeBERT: Pre-training Code Representations with Data Flow
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Collaborative Cognitive Diagnosis with Disentangled Representation Learning for Learner ModelingWeibo Gao, Qi Liu, Linan Yue, Fangzhou Yao et al.NeurIPS 2024 · 12 citations
  2. QiMeng-GEMM: Automatically Generating High-Performance Matrix Multiplication Code by Exploiting Large Language ModelsQirui Zhou, Yuanbo Wen, Ruizhi Chen, Ke Gao et al.AAAI 2025 · 7 citations
  3. Optimizing Code Retrieval: High-Quality and Scalable Dataset Annotation through Large Language ModelsRui Li, Qi Liu, Liyang He, Zheng Zhang et al.EMNLP 2024 · 4 citations
  4. VERSE: Verification-based Self-Play for Code InstructionsHao Jiang, Qi Liu, Rui Li, Yuze Zhao et al.AAAI 2025 · 3 citations
  5. Distribution-Driven Dense Retrieval: Modeling Many-to-One Query-Document RelationshipJunfeng Kang, Rui Li, Qi Liu, Zhenya Huang et al.AAAI 2025 · 2 citations

Builds on14

  1. A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
  2. CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan et al.EMNLP Findings 2020 · 2,828 citations
  3. GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng et al.ICLR 2021 · 1,644 citations
  4. Dense Passage Retrieval for Open-Domain Question AnsweringVladimir Karpukhin, Barlas Oguz, Sewon Min, Patrick Lewis et al.EMNLP 2020 · 142 citations
  5. Cross-domain recommendation via user interest alignmentChuang Zhao, Hongke Zhao, Ming He, Jian Zhang et al.WWW 2023 · 127 citations

Related papers

  1. UNICS: Multilingual Code Search via Unified Pseudocode and Contrastive Transfer LearningYe Fan, Jidong Ge, Chuanyi Li, LiGuo Huang et al.FSE 2026
  2. UniCoR: Modality Collaboration for Robust Cross-Language Hybrid Code RetrievalYang Yang, Li Kuang, Jiakun Liu, Zhongxin Liu et al.ICSE 2026
  3. Uncertainty-Aware Contrastive Learning with Hard Negative Sampling for Code Search TasksHan Liu, Jiaqing Zhan, Qin ZhangAAAI 2025 · 1 citation
  4. AdaCCD: Adaptive Semantic Contrasts Discovery Based Cross Lingual Adaptation for Code Clone DetectionYangkai Du, Tengfei Ma, Lingfei Wu, Xuhong Zhang et al.AAAI 2024 · 9 citations
  5. Boosting Data Utilization for Multilingual Dense RetrievalChao Huang, Fengran Mo, Yufeng Chen, Changhao Guan et al.EMNLP 2025 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines