What to Retrieve? Investigating Effective Call Information in Repository-level Code Generation

Retrieval-Augmented Generation (RAG) emerges as a widely adopted solution in repository-level code generation by retrieving functions for direct reuse or learning similar usage patterns. Nevertheless, it remains unexplored which types of contexts effectively assist LLMs. In this paper, we categorize the context of function calls and empirically analyze the performance of LLMs. Specifically, we define call information along two dimensions: call depth , including direct-level , inward expansion (to callees), and outward expansion (to callers), as well as call granularity , including function-level , module-level , and file-level . We investigate the utility of the context in two distinct scenarios: precision-oriented call extraction and relevance-oriented call retrieval , targeting precise call information and relevant call information , respectively. We conduct comprehensive experiments with three mainstream LLMs on two widely used benchmarks, CoderEval and DevEval. When precise call information is provided, the additional inclusion of inward expansion, outward expansion, module-level, and file-level context enhances the average Pass@1 of the studied LLMs by 2.11%, 79.59%, 37.54%, and 82.54%, respectively. When the relevant call information is provided, incorporating the same set of strategies leads to improvements of 18.00%, 4.77%, 26.07%, and 44.60% in average Pass@1, respectively. This empirical study offers practical insights for optimizing RAG strategies in repository-level code generation.

Authors

Institutions

Publication Details

Journal
ACM Transactions on Software Engineering and Methodology
Published
2026-11-05
DOI
https://doi.org/10.1145/3860324
Primary Topic
Software Engineering Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

What to Retrieve? Investigating Effective Call Information in Repository-level Code Generation

Yutao Ma, Zhihao Wang, Jian Wang, Bo Li et al.
ACM Transactions on Software Engineering and Methodology
Software Engineering Research
article

What to Retrieve? Investigating Effective Call Information in Repository-level Code Generation

Yutao Ma, Zhihao Wang, Jian Wang, Bo Li, Neng Zhang, Siyu Nan, Yaling Luo
article en

Abstract

Retrieval-Augmented Generation (RAG) emerges as a widely adopted solution in repository-level code generation by retrieving functions for direct reuse or learning similar usage patterns. Nevertheless, it remains unexplored which types of contexts effectively assist LLMs. In this paper, we categorize the context of function calls and empirically analyze the performance of LLMs. Specifically, we define call information along two dimensions: call depth , including direct-level , inward expansion (to callees), and outward expansion (to callers), as well as call granularity , including function-level , module-level , and file-level . We investigate the utility of the context in two distinct scenarios: precision-oriented call extraction and relevance-oriented call retrieval , targeting precise call information and relevant call information , respectively. We conduct comprehensive experiments with three mainstream LLMs on two widely used benchmarks, CoderEval and DevEval. When precise call information is provided, the additional inclusion of inward expansion, outward expansion, module-level, and file-level context enhances the average Pass@1 of the studied LLMs by 2.11%, 79.59%, 37.54%, and 82.54%, respectively. When the relevant call information is provided, incorporating the same set of strategies leads to improvements of 18.00%, 4.77%, 26.07%, and 44.60% in average Pass@1, respectively. This empirical study offers practical insights for optimizing RAG strategies in repository-level code generation.

ACM Transactions on Software Engineering and Methodology
Wuhan University (CN), Central China Normal University (CN)
Openalex Percentile: Top 9%
Software Engineering Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
What to Retrieve? Investigating Effective Call Information in Repository-level Code Generation — Yutao Ma, Zhihao Wang, et al. · ACM Transactions on Software Engineering and Methodology (2026) | TGRS Research Map | TGRS