Code Search based on Context-aware Code Translation
Not on the map. Why?
Abstract (arXiv)
Code search is a widely used technique by developers during software development. It provides semantically similar implementations from a large code corpus to developers based on their queries. Existing techniques leverage deep learning models to construct embedding representations for code snippets and queries, respectively. Features such as abstract syntactic trees, control flow graphs, etc., are commonly employed for representing the semantics of code snippets. However, the same structure of these features does not necessarily denote the same semantics of code snippets, and vice versa. In addition, these techniques utilize multiple different word mapping functions that map query words/code tokens to embedding representations. This causes diverged embeddings of the same word/token in queries and code snippets. We propose a novel context-aware code translation technique that translates code snippets into natural language descriptions (called translations). The code translation is conducted on machine instructions, where the context information is collected by simulating the execution of instructions. We further design a shared word mapping function using one single vocabulary for generating embeddings for both translations and queries. We evaluate the effectiveness of our technique, called TranCS, on the CodeSearchNet corpus with 1,000 queries. Experimental results show that TranCS significantly outperforms state-of-the-art techniques by 49.31% to 66.50% in terms of MRR (mean reciprocal rank).
Key facts. Cited by 14 papers in the map (data through 14 Oct 2026). Builds on 26 of its 72 references that are in the map. First posted on arXiv 16 Feb 2022.
Builds on
26 of 72 references.
References · 26
- 2017Attention Is All You Needcited by 60,361
- 2014Neural Machine Translation by Jointly Learning to Align and Translatecited by 4,548
- 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,375
- 2013Distributed Representations of Words and Phrases and their Compositionalitycited by 3,474
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2015Gated Graph Sequence Neural Networkscited by 796
- 2014Distributed Representations of Sentences and Documentscited by 678
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2015Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networkscited by 306
- 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
- 2015Deep Sentence Embedding Using Long Short-Term Memory Networks: Analysis and Application to Information Retrievalcited by 54
- 2020Self-Supervised Contrastive Learning for Code Retrieval and Summarization via Semantic-Preserving Transformationscited by 49
14 more
- 2019When Deep Learning Met Code Searchcited by 46
- 2016Re-evaluating Automatic Metrics for Image Captioningcited by 45
- 2016Deep API Learningcited by 41
- 2019Multi-Modal Attention Network Learning for Semantic Source Code Retrievalcited by 41
- 2019CoaCor: Code Annotation for Code Retrieval with Reinforcement Learningcited by 22
- 2020Opportunities and Challenges in Code Search Toolscited by 22
- 2020A Multi-Perspective Architecture for Semantic Code Searchcited by 20
- 2018Practical Program Repair via Bytecode Mutationcited by 19
- 2017Query Expansion Based on Crowd Knowledge for Code Searchcited by 18
- 2020OCoR: An Overlapping-Aware Code Retrievercited by 9
- 2018Effective Reformulation of Query for Code Search using Crowdsourced Knowledge and Extra-Large Data Analyticscited by 4
- 2015Learning API Usages from Bytecode: A Statistical Approachcited by 3
- 2021deGraphCS: Embedding Variable-based Flow Graph for Neural Code Searchcited by 3
- 2020JCoffee: Using Compiler Feedback to Make Partial Code Snippets Compilablecited by 1
Built on by
Citing papers per year: 2022: 2; 2023: 6; 2024: 3; 2025: 2; 2026: 1.
14 papers.
Sort:
By area:
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2023Backdooring Neural Code Searchcited by 19
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 18
- 2023Rethinking Negative Pairs in Code Searchcited by 14
- 2025Show Me Your Code! Kill Code Poisoning: A Lightweight Method Based on Code Naturalnesscited by 8
- 2023LExecutor: Learning-Guided Executioncited by 7
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2024Eliminating Backdoors in Neural Code Models for Secure Code Understandingcited by 5
- 2024A Joint Learning Model with Variational Interaction for Multilingual Program Translationcited by 4
- 2023BadCS: A Backdoor Attack Framework for Code searchcited by 1
- 2022MQDD: Pre-training of Multimodal Question Duplicity Detection for Software Engineering Domaincited by 0
- 2026Securing Code Understanding: Detecting Natural Backdoor Vulnerability in Code Language Models9 Jun 2026
- 2025MT4DP: Data Poisoning Attack Detection for DL-based Code Search Models via Metamorphic Testing15 Jul 2025
- 2025Show Me Your Code! Kill Code Poisoning: A Lightweight Method Based on Code Naturalness20 Feb 2025
- 2024A Joint Learning Model with Variational Interaction for Multilingual Program Translation25 Aug 2024
- 2024Eliminating Backdoors in Neural Code Models for Secure Code Understanding8 Aug 2024
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023Rethinking Negative Pairs in Code Search12 Oct 2023
- 2023Backdooring Neural Code Search27 May 2023
- 2023BadCS: A Backdoor Attack Framework for Code search9 May 2023
- 2023LExecutor: Learning-Guided Execution5 Feb 2023
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2023Backdooring Neural Code Searchcited by 19
- 2025Show Me Your Code! Kill Code Poisoning: A Lightweight Method Based on Code Naturalnesscited by 8
- 2024Eliminating Backdoors in Neural Code Models for Secure Code Understandingcited by 5
- 2023BadCS: A Backdoor Attack Framework for Code searchcited by 1
- 2025MT4DP: Data Poisoning Attack Detection for DL-based Code Search Models via Metamorphic Testingcited by 0
- 2026Securing Code Understanding: Detecting Natural Backdoor Vulnerability in Code Language Modelscited by 0
- 2026Securing Code Understanding: Detecting Natural Backdoor Vulnerability in Code Language Models9 Jun 2026
- 2025MT4DP: Data Poisoning Attack Detection for DL-based Code Search Models via Metamorphic Testing15 Jul 2025
- 2025Show Me Your Code! Kill Code Poisoning: A Lightweight Method Based on Code Naturalness20 Feb 2025
- 2024Eliminating Backdoors in Neural Code Models for Secure Code Understanding8 Aug 2024
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun 2024
- 2023Backdooring Neural Code Search27 May 2023
- 2023BadCS: A Backdoor Attack Framework for Code search9 May 2023
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkitcited by 22
- 2022An Extractive-and-Abstractive Framework for Source Code Summarizationcited by 18
- 2023Rethinking Negative Pairs in Code Searchcited by 14
- 2023LExecutor: Learning-Guided Executioncited by 7
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?cited by 5
- 2024A Joint Learning Model with Variational Interaction for Multilingual Program Translationcited by 4
- 2022MQDD: Pre-training of Multimodal Question Duplicity Detection for Software Engineering Domaincited by 0
- 2024A Joint Learning Model with Variational Interaction for Multilingual Program Translation25 Aug 2024
- 2023Deep Learning for Code Intelligence: Survey, Benchmark and Toolkit30 Dec 2023
- 2023Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?1 Dec 2023
- 2023Rethinking Negative Pairs in Code Search12 Oct 2023
- 2023LExecutor: Learning-Guided Execution5 Feb 2023
- 2022An Extractive-and-Abstractive Framework for Source Code Summarization15 Jun 2022
- 2022MQDD: Pre-training of Multimodal Question Duplicity Detection for Software Engineering Domain26 Mar 2022