RCL (Retrieval-Confidence Layer), a lightweight module inserted between retrieval and generation that combines a call-graph-derived structural coverage score with a novelty score estimating a query's dependence on knowledge outside the model's prior, to detect insufficient retrieval before generation occurs.
Abstract
Retrieval-Augmented Generation (RAG) for code generation has been studied extensively on public repositories, where a model's parametric knowledge often compensates for imperfect retrieval. This breaks down in enterprise codebases, where private APIs, internal frameworks, and undocumented team conventions fall entirely outside any model's pretraining distribution. Recent work on private-library code generation shows that even oracle (perfect) retrieval does not eliminate errors, but locates failures downstream in API usage; separately, confidence-gated retrieval has been studied for open-domain question answering using model-internal confidence. Neither addresses whether retrieval itself was structurally sufficient for a private-code query before generation begins. We introduce RCL (Retrieval-Confidence Layer), a lightweight module inserted between retrieval and generation that combines a call-graph-derived structural coverage score with a novelty score estimating a query's dependence on knowledge outside the model's prior, to detect insufficient retrieval before generation occurs. When confidence falls below a calibrated threshold, RCL triggers a targeted follow-up retrieval or labels the output for human review, rather than generating silently against incomplete context. We describe RCL's architecture, formalize its scoring functions, and propose an evaluation methodology using a private-code benchmark built by injecting synthetic internal APIs into open-source Java repositories, simulating the enterprise condition without proprietary code. We report results (Section 7) comparing RCL against similarity-only retrieval on generation correctness. Our position is that retrieval sufficiency, assessed structurally rather than from model-internal confidence, is a distinct and currently underaddressed signal for building safer code-generation systems in private, enterprise settings.
The results indicate that front-loading code understanding into a reusable, codebase-specialised vector store enables small local models to deliver grounded and repository-specific answers, making the agent well suited as a privacy-preserving development tool for in-house scientific codebases.
A. Nobile, Andreas Adelmann, Mohsen Sadr· 0 citations
It is argued both stages of retrieval and generation can be improved together, with generation in particular gaining from test-time scaling, and CARET, a training-free method is presented.
Jia-Jie Wang, Yu-Tong Zhao, Ke-Bin Peng et al.· 0 citations
A role-specialized retrieval-augmented generation framework composed of a deterministic Parser, a Reviewer guided by an Equilibrium Rule prompt, and a Critic that outputs a structured verdict that position the framework as a decision-support approach for engineering compliance review rather than as a fully autonomous a...
Retrieval-Augmented Generation (RAG) is widely used to ground answers in documents. For complex technical documentation, however, the primary bottleneck is often not model reasoning but a mismatch between a query and the way knowledge is organized for retrieval. This mismatch is pronounced in Electronic Design Automati...
Xiao-Tian Qiu, Kai-Rui Liu, Chen Shi et al.· 0 citations
Failure Analysis (FA) engineers must diagnose product malfunctions and identify root causes from large volumes of heterogeneous information, including prior debugging procedures and product documentation. This paper examines domain-specific fine-tuning of Large Language Models within a Retrieval-Augmented Generation...
Markus Kofler, Konstantin Schekotihin· International Symposium for...· 0 citations
This work revisits RAG compression from a data-mining perspective by aggregating historical query--document--model interactions into reusable evidence views and proposes Reusable Evidence View Aggregation (REVA), a framework that mines the target generator's historical attention traces into a document-keyed, budget-agn...
T. Nguyen, Qi-Ran Hu, Ban-Ruo Liu et al.· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.