Improving Code Example Recommendations on Informal Documentation Using BERT and Query-Aware LSH: A Comparative Study
Not on the map. Why?
Abstract (arXiv)
Our research investigates the recommendation of code examples to aid software developers, a practice that saves developers significant time by providing ready-to-use code snippets. The focus of our study is Stack Overflow, a commonly used resource for coding discussions and solutions, particularly in the context of the Java programming language. We applied BERT, a powerful Large Language Model (LLM) that enables us to transform code examples into numerical vectors by extracting their semantic information. Once these numerical representations are prepared, we identify Approximate Nearest Neighbors (ANN) using Locality-Sensitive Hashing (LSH). Our research employed two variants of LSH: Random Hyperplane-based LSH and Query-Aware LSH. We rigorously compared these two approaches across four parameters: HitRate, Mean Reciprocal Rank (MRR), Average Execution Time, and Relevance. Our study revealed that the Query-Aware (QA) approach showed superior performance over the Random Hyperplane-based (RH) method. Specifically, it exhibited a notable improvement of 20% to 35% in HitRate for query pairs compared to the RH approach. Furthermore, the QA approach proved significantly more time-efficient, with its speed in creating hashing tables and assigning data samples to buckets being at least four times faster. It can return code examples within milliseconds, whereas the RH approach typically requires several seconds to recommend code examples. Due to the superior performance of the QA approach, we tested it against PostFinder and FaCoY, the state-of-the-art baselines. Our QA method showed comparable efficiency proving its potential for effective code recommendation.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 6 of its 38 references that are in the map. First posted on arXiv 4 May 2023.
Builds on
6 of 38 references.
References · 6
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
- 2016Deep API Learningcited by 41
- 2021Leveraging Unsupervised Learning to Summarize APIs Discussed in Stack Overflowcited by 9
- 2021Development of recommendation systems for software engineering: the CROSSMINER experiencecited by 4
- 2022Towards Code Summarization of APIs Based on Unofficial Documentation Using NLP Techniquescited by 4
- 2021Senatus -- A Fast and Accurate Code-to-Code Recommendation Enginecited by 3
Built on by
Citing papers per year: 2023: 4; 2024: 2; 2025: 1.
7 papers.
- 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 399
- 2023A Survey on Large Language Models for Recommendationcited by 379
- 2023How Can Recommender Systems Benefit from Large Language Models: A Surveycited by 142
- 2023When Large Language Models Meet Personalization: Perspectives of Challenges and Opportunitiescited by 90
- 2024Enhancing Recommendation Diversity by Re-ranking with Large Language Modelscited by 19
- 2024Large Language Models Make Sample-Efficient Recommender Systemscited by 3
- 2025Automating API Documentation with LLMs: A BERTopic Approachcited by 1
- 2025Automating API Documentation with LLMs: A BERTopic Approach6 Sep 2025
- 2024Large Language Models Make Sample-Efficient Recommender Systems4 Jun 2024
- 2024Enhancing Recommendation Diversity by Re-ranking with Large Language Models21 Jan 2024
- 2023Large Language Models for Software Engineering: A Systematic Literature Review21 Aug 2023
- 2023When Large Language Models Meet Personalization: Perspectives of Challenges and Opportunities31 Jul 2023
- 2023How Can Recommender Systems Benefit from Large Language Models: A Survey9 Jun 2023
- 2023A Survey on Large Language Models for Recommendation31 May 2023