NS3: Neuro-symbolic Semantic Code Search
Shushan Arakelyan, Anna Hakhverdyan, Miltiadis Allamanis, Luis Garcia, Christophe Hauser, Xiang Ren
摘要
Semantic code search is the task of retrieving a code snippet given a textual description of its functionality. Recent work has been focused on using similarity metrics between neural embeddings of text and code. However, current language models are known to struggle with longer, compositional text, and multi-step reasoning. To overcome this limitation, we propose supplementing the query sentence with a layout of its semantic structure. The semantic layout is used to break down the final reasoning decision into a series of lower-level decisions. We use a Neural Module Network architecture to implement this idea. We compare our model -NS 3 (Neuro-Symbolic Semantic Search) -to a number of baselines, including state-of-the-art semantic code retrieval methods, and evaluate on two datasets -CodeSearchNet and Code Search and Question Answering. We demonstrate that our approach results in more precise code retrieval, and we study the effectiveness of our modular design when handling compositional queries 1 .
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 1 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- CodeBERT: A Pre-Trained Model for Programming and Natural Languages 引用了 Learning and Evaluating Contextual Embedding of Source Code
- Learning and Evaluating Contextual Embedding of Source Code 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- ReACC: A Retrieval-Augmented Code Completion Framework 引用了 CodeBERT: A Pre-Trained Model for Programming and Natural Languages
- ReACC: A Retrieval-Augmented Code Completion Framework 引用了 GraphCodeBERT: Pre-training Code Representations with Data Flow
- Language-Agnostic Representation Learning of Source Code from Structure and Context 引用了 Learning and Evaluating Contextual Embedding of Source Code
引用它的顶会 Paper1
它引用的 Paper13
- CodeBERT: A Pre-Trained Model for Programming and Natural LanguagesZhangyin Feng, Daya Guo, Duyu Tang, Nan Duan 等EMNLP Findings 2020 · 2,828 次引用
- GraphCodeBERT: Pre-training Code Representations with Data FlowDaya Guo, Shuo Ren, Shuai Lu, Zhangyin Feng 等ICLR 2021 · 1,644 次引用
- Learning and Evaluating Contextual Embedding of Source CodeAditya Kanade, Petros Maniatis, Gogul Balakrishnan, Kensen ShiICML 2020 · 438 次引用
- ReACC: A Retrieval-Augmented Code Completion FrameworkShuai Lu, Nan Duan, Hojae Han, Daya Guo 等ACL 2022 · 208 次引用
- Language-Agnostic Representation Learning of Source Code from Structure and ContextDaniel Zügner, Tobias Kirschstein, Michele Catasta, Jure Leskovec 等ICLR 2021 · 131 次引用
相关 Paper
- XSearch: Explainable Code Search via Concept-to-Code AlignmentYiming Liu, Ruofan Liu, Yun Lin, Zicong Zhang 等ISSTA 2026 · 1 次引用
- Efficient Text-to-Code Retrieval with Cascaded Fast and Slow Transformer ModelsAkhilesh Deepak Gotmare, Junnan Li, Shafiq Joty, Steven C. H. HoiFSE 2023 · 5 次引用
- How to better utilize code graphs in semantic code search?Yucen Shi, Ying Yin, Zhengkui Wang, David Lo 等FSE 2022 · 25 次引用
- MGS3: A Multi-Granularity Self-Supervised Code Search FrameworkRui Li, Junfeng Kang, Qi Liu, Liyang He 等KDD 2025
- Structure-Aware Language Model Pretraining Improves Dense Retrieval on Structured DataXinze Li, Zhenghao Liu, Chenyan Xiong, Shi Yu 等ACL Findings 2023 · 10 次引用
