Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
119 tokens/sec
GPT-4o
56 tokens/sec
Gemini 2.5 Pro Pro
43 tokens/sec
o3 Pro
6 tokens/sec
GPT-4.1 Pro
47 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

What to Retrieve for Effective Retrieval-Augmented Code Generation? An Empirical Study and Beyond (2503.20589v1)

Published 26 Mar 2025 in cs.SE

Abstract: Repository-level code generation remains challenging due to complex code dependencies and the limitations of LLMs in processing long contexts. While retrieval-augmented generation (RAG) frameworks are widely adopted, the effectiveness of different retrieved information sources-contextual code, APIs, and similar snippets-has not been rigorously analyzed. Through an empirical study on two benchmarks, we demonstrate that in-context code and potential API information significantly enhance LLM performance, whereas retrieved similar code often introduces noise, degrading results by up to 15%. Based on the preliminary results, we propose AllianceCoder, a novel context-integrated method that employs chain-of-thought prompting to decompose user queries into implementation steps and retrieves APIs via semantic description matching. Through extensive experiments on CoderEval and RepoExec, AllianceCoder achieves state-of-the-art performance, improving Pass@1 by up to 20% over existing approaches.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (9)
  1. Wenchao Gu (10 papers)
  2. Juntao Chen (45 papers)
  3. Yanlin Wang (76 papers)
  4. Tianyue Jiang (2 papers)
  5. Xingzhe Li (6 papers)
  6. Mingwei Liu (21 papers)
  7. Xilin Liu (26 papers)
  8. Yuchi Ma (22 papers)
  9. Zibin Zheng (194 papers)

Summary

We haven't generated a summary for this paper yet.

X Twitter Logo Streamline Icon: https://streamlinehq.com