paperbot · PL 论文追踪

全部论文 待读 收藏

P2 UniCoR: Modality Collaboration for Robust Cross-Language Hybrid Code Retrieval

UniCoR:面向鲁棒跨语言混合代码检索的模态协作
ICSE Proceedings of the 2026 IEEE/ACM 48th International Conference on Software Engineering2026匹配度 2/10 · 该论文研究跨语言混合代码检索与代码表示学习,属于机器学习与程序语言的交叉,但与用户关注的静态分析、Agentic 程序、浮点程序分析、贝叶斯程序分析及 LLM/Agent 改进静态分析等核心方向无直接关联。仅在“代码的机器学习表示”这一宽泛层面有微弱联系。引用 2 inbox
Yang Yang, Li Kuang, Jiakun Liu, Zhongxin Liu, Yingjie Xia, David Lo
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 UniCoR,通过多视角对比学习与分布一致性学习实现鲁棒跨语言混合代码检索。

代码检索中混合自然语言与代码片段的查询日益常见,但现有方法在跨语言场景下的效果尚不明确。作者对代表性代码模型进行实证研究,揭示语义理解不足、混合模态融合低效和跨语言泛化弱三大挑战。为此提出自监督框架 UniCoR:多视角监督对比学习对齐代码-代码、自然语言-代码和自然语言-自然语言表示,增强语义理解与模态融合;表示分布一致性学习对齐不同编程语言的特征分布,实现语言无关表示。在实证基准与大规模基准上,UniCoR 优于所有基线,MRR 平均提升 8.64%,MAP 提升 11.54%,并展现混合检索稳定性与跨语言泛化能力。

问题
现有代码检索方法在处理自然语言与代码片段混合查询时效果不明,尤其跨语言场景存在语义理解不足、混合模态融合低效与泛化弱的问题。
方法
提出自监督框架 UniCoR,包含多视角监督对比学习模块和表示分布一致性学习模块,学习统一、模态协同且语言无关的代码表示。
评估
在实证基准与大规模基准上与多个基线比较,报告 MRR、MAP 等指标,并分析混合检索稳定性与跨语言泛化。
原文摘要(Abstract)

Effective code retrieval is indispensable and it has become an important paradigm to search code in hybrid mode using both natural language and code snippets. Nevertheless, it remains unclear whether existing approaches can effectively leverage such hybrid queries, particularly in cross-language contexts. We conduct a comprehensive empirical study of representative code models and reveal three challenges: (1) insufficient semantic understanding; (2) inefficient fusion in hybrid code retrieval; and (3) weak generalization in cross-language scenarios. To address these challenges, we propose UniCoR, a novel self-supervised framework designed to learn Unified Code Representations that are semantically robust, modally collaborative, and language-agnostic. Firstly, we design a multi-perspective supervised contrastive learning module to enhance semantic understanding and modality fusion. It aligns representations from multiple perspectives, including code-to-code, natural language-to-code, and natural language-to-natural language, enforcing the model to capture a semantic essence among modalities. Secondly, we introduce a representation distribution consistency learning module to improve cross-language generalization, which explicitly aligns the feature distributions of different programming languages, enabling language-agnostic representation learning. Extensive experiments on both an empirical benchmark and a large-scale benchmark show that UniCoR outperforms all baseline models, achieving an average improvement of 8.64% in MRR and 11.54% in MAP over the best-performing baseline. Furthermore, UniCoR exhibits stability in hybrid code retrieval and generalization capability in cross-language scenarios.

链接与引用

DOI 原文 · arXiv · DBLP

BibTeX
@inproceedings{abs-2512-10452,
  title = {UniCoR: Modality Collaboration for Robust Cross-Language Hybrid Code Retrieval},
  author = {Yang Yang and Li Kuang and Jiakun Liu and Zhongxin Liu and Yingjie Xia and David Lo},
  booktitle = {ICSE},
  year = {2026},
  doi = {10.1145/3744916.3773201}
}