Senatus -- A Fast and Accurate Code-to-Code Recommendation Engine
Not on the map. Why?
Abstract (arXiv)
Machine learning on source code (MLOnCode) is a popular research field that has been driven by the availability of large-scale code repositories and the development of powerful probabilistic and deep learning models for mining source code. Code-to-code recommendation is a task in MLOnCode that aims to recommend relevant, diverse and concise code snippets that usefully extend the code currently being written by a developer in their development environment (IDE). Code-to-code recommendation engines hold the promise of increasing developer productivity by reducing context switching from the IDE and increasing code-reuse. Existing code-to-code recommendation engines do not scale gracefully to large codebases, exhibiting a linear growth in query time as the code repository increases in size. In addition, existing code-to-code recommendation engines fail to account for the global statistics of code repositories in the ranking function, such as the distribution of code snippet lengths, leading to sub-optimal retrieval results. We address both of these weaknesses with Senatus, a new code-to-code recommendation engine. At the core of Senatus is De-Skew LSH a new locality sensitive hashing (LSH) algorithm that indexes the data for fast (sub-linear time) retrieval while also counteracting the skewness in the snippet length distribution using novel abstract syntax tree-based feature scoring and selection algorithms. We evaluate Senatus and find the recommendations to be of higher quality than competing baselines, while achieving faster search. For example on the CodeSearchNet dataset Senatus improves performance by 31.21% F1 and 147.9x faster query time compared to Facebook Aroma. Senatus also outperforms standard MinHash LSH by 29.2% F1 and 51.02x faster query time.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 17 of its 57 references that are in the map. First posted on arXiv 5 Nov 2021.
Builds on
17 of 57 references.
References · 17
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 221
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
- 2021Language-Agnostic Representation Learning of Source Code from Structure and Contextcited by 63
- 2017Code Completion with Neural Attention and Pointer Networkscited by 49
- 2019When Deep Learning Met Code Searchcited by 46
- 2015SourcererCC: Scaling Code Clone Detection to Big Codecited by 40
- 2018Aroma: Code Recommendation via Structural Code Searchcited by 29
- 2016LSH Ensemble: Internet-Scale Domain Searchcited by 24
- 2020Opportunities and Challenges in Code Search Toolscited by 22
5 more
- 2018Oreo: Detection of Clones in the Twilight Zonecited by 19
- 2019Neural Code Search Evaluation Datasetcited by 13
- 2016Learning Python Code Suggestion with a Sparse Pointer Networkcited by 12
- 2020CoNCRA: A Convolutional Neural Network Code Retrieval Approachcited by 3
- 2018Locality-Sensitive Hashing for Earthquake Detection: A Case Study of Scaling Data-Driven Sciencecited by 1
Built on by
Citing papers per year: 2023: 3.
3 papers.
- 2023Improving Code Example Recommendations on Informal Documentation Using BERT and Query-Aware LSH: A Comparative Studycited by 7
- 2023DeepLSH: Deep Locality-Sensitive Hash Learning for Fast and Efficient Near-Duplicate Crash Report Detectioncited by 3
- 2023Deduplicating and Ranking Solution Programs for Suggesting Reference Solutionscited by 1
- 2023DeepLSH: Deep Locality-Sensitive Hash Learning for Fast and Efficient Near-Duplicate Crash Report Detection10 Oct 2023
- 2023Deduplicating and Ranking Solution Programs for Suggesting Reference Solutions16 Jul 2023
- 2023Improving Code Example Recommendations on Informal Documentation Using BERT and Query-Aware LSH: A Comparative Study4 May 2023