paperbot · PL 论文追踪

全部论文 待读 收藏

Lost in Translation, Found in Summary: Summary-Driven Supervision for Cross-Language Code Retrieval

在翻译中迷失,在摘要中找回:面向跨语言代码检索的摘要驱动监督
ASE Proceedings of the 41st IEEE/ACM International Conference on Automated Software Engineering2026引用 0 inbox
Zhijie Liu, Yisi Liu, Linxi Jiang, Yutian Tang, Lili Xiao, Zhipeng Xue
crossref: 2026-10-09

AI 速览

一句话:提出 SemSIR,用摘要中间表示构建跨语言监督,并结合分布对齐与对比学习提升跨语言代码检索。

跨语言代码检索对现代软件开发至关重要,但现有对比学习方法受限于监督数据多样性或语义对齐不足,且不同语言编码分布异质会引入相似度偏差。本文提出端到端框架 SemSIR,其核心是以自然语言摘要作为中间表示 Summary IR,桥接跨语言语义鸿沟;SemSIR 从真实代码仓库自动构建可扩展的跨语言监督,并联合分布对齐与 CLIP 式对比训练,学习更具判别性的语言无关代码语义。作者收集 9 种语言、2400 万代码片段,自动构建 700 万语义组,抽样 1000 组人工检查显示 92.7% 完全语义一致、平均组纯度 96.8%。在两个 CLCR 基准上,SemSIR 一致优于所有基线,MRR 最高提升 24.7%,MAP 平均提升 50.1%;跨语言恶意软件改写追踪案例取得 92.20 MRR 和 88.40 MAP。

问题
跨语言代码检索中,现有对比学习方法依赖在线评测平台或多语言 NL-to-code 数据集,监督多样性与语义对齐不足;同时不同语言代码被编码到异质表示分布,导致相似度偏差并削弱跨语言语义学习。
方法
提出 SemSIR,以自然语言摘要 Summary IR 作为跨语言语义桥梁,从真实仓库自动构建可扩展监督,并联合分布对齐与 CLIP 式对比训练学习语言无关的代码表示。
评估
在 9 种语言、2400 万代码片段和 700 万自动构建语义组上进行实验,并在两个 CLCR 基准上对比基线;还通过跨语言恶意软件改写追踪案例验证安全场景效果。
原文摘要(Abstract)

Cross-language code retrieval (CLCR) is critical to modern software development, and recent studies have shown that contrastive learning is an effective way to learn cross-language code semantics. However, these methods are still limited by two fundamental challenges. First, they rely on online judge platforms or multilingual NL-to-code datasets, which either lack diversity or fail to ensure semantic alignment between code snippets, thereby limiting the effectiveness of cross-language semantic learning. Second, during training, code snippets from different languages are often encoded into heterogeneous representation distributions. This distribution inconsistency introduces similarity bias and weakens the model's ability to capture accurate cross-language semantics. To address these challenges, we propose SemSIR, an end-to-end framework for CLCR. The key insight is to use Summary IR, a natural-language intermediate representation, to bridge semantic gaps across languages. Built on this insight, SemSIR automatically constructs scalable cross-language supervision from real-world repositories, and further combines distribution alignment with CLIP-style contrastive training to learn more discriminative language-independent code semantics. In our evaluation, we collect 24 million real-world code snippets across 9 languages and automatically construct 7 million semantic groups. Manual inspection of 1,000 sampled groups shows that 92.7% are fully semantically coherent, with an average Group Purity of 96.8%. On CLCR, SemSIR consistently outperforms all baselines on two benchmarks, surpassing the state-of-the-art method by up to 24.7% in MRR and 50.1% in MAP on average. In addition, experimental results on a security case study of tracing rewritten malware across languages show that SemSIR achieves 92.20 MRR and 88.40 MAP, highlighting its potential for security-oriented CLCR.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot12210,
  title = {Lost in Translation, Found in Summary: Summary-Driven Supervision for Cross-Language Code Retrieval},
  author = {Zhijie Liu and Yisi Liu and Linxi Jiang and Yutian Tang and Lili Xiao and Zhipeng Xue},
  booktitle = {ASE},
  year = {2026},
  doi = {10.1145/3832783.3837444}
}