Evaluating the Effectiveness and Efficiency of Demonstration Retrievers in RAG for Coding Tasks
Pengfei He, Shaowei Wang, Shaiful Chowdhury, Tse-Hsun Chen

TL;DR
This paper systematically evaluates the trade-offs between effectiveness and efficiency of various retrievers in Retrieval-Augmented Generation for coding tasks, highlighting the strengths and limitations of each method.
Contribution
It provides a comprehensive comparison of six retrievers, analyzing their performance and efficiency trade-offs across multiple coding tasks, which was previously underexplored.
Findings
BM25 is highly effective but less efficient at large scale.
Approximate dense retrievers significantly improve speed with minimal accuracy loss.
Increasing demonstrations does not always enhance effectiveness and can increase latency.
Abstract
Retrieval-Augmented Generation (RAG) enhances Large Language Models (LLMs) by integrating external knowledge bases, achieving state-of-the-art results in various coding tasks. The core of RAG is retrieving demonstration examples, which is essential to balance effectiveness (generation quality) and efficiency (retrieval time) for optimal performance. However, the high-dimensional nature of code representations and large knowledge bases often create efficiency bottlenecks, which are overlooked in previous research. This paper systematically evaluates the efficiency-effectiveness trade-off of retrievers across three coding tasks: Program Synthesis, Commit Message Generation, and Assertion Generation. We examined six retrievers: two sparse (BM25 and BM25L) and four dense retrievers, including one exhaustive dense retriever (SBERT's Semantic Search) and three approximate dense retrievers…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsParallel Computing and Optimization Techniques · Machine Learning and Data Classification · Algorithms and Data Compression
