RCL: A Retrieval-Confidence Layer for Detecting Insufficient Context in Enterprise Retrieval-Augmented Code Generation
- URL: http://arxiv.org/abs/2609.11023v1
- Date: Thu, 10 Sep 2026 03:02:23 GMT
- Title: RCL: A Retrieval-Confidence Layer for Detecting Insufficient Context in Enterprise Retrieval-Augmented Code Generation
- Abstract summary: We introduce RCL (Retrieval-Confidence Layer), a lightweight module inserted between retrieval and generation.<n>When confidence falls below a calibrated threshold, RCL triggers a targeted follow-up retrieval or labels the output for human review.<n>Our position is that retrieval sufficiency, assessed structurally rather than from model-internal confidence, is a distinct signal for building safer code-generation systems in private, enterprise settings.
- Score: 0.0
- License: http://creativecommons.org/licenses/by/4.0/
- 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.
Related papers
- Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation [53.85136813868056]
ACToR is an adaptive critical token-aware retrieval framework for repository-level code generation.<n>We show that ACToR consistently outperforms state-of-the-art methods on repository-level benchmarks.
arXiv Detail & Related papers (2026-09-01T17:59:39Z) - Never the Number: Structural Abstention for AI Systems Whose Answers Are Consumed as Fact [0.0]
Large language models have made natural language interfaces to databases newly credible, but calibrated text-to-aggregated systems fail in a way that matters for deployment.<n>We propose an architectural pattern for such systems, a trusted kernel with a generative shell, resting on one invariant.<n>A generative shell interprets under input and phrases replies; a deterministic kernel matches fully specified questions against a bounded set of answerable question shapes.<n>The two meet at a confirmation the user reads before any value is computed, and requests the kernel cannot express are declined rather than approximated.
arXiv Detail & Related papers (2026-08-14T03:53:21Z) - RING: Retrieval-Internalized Generation for Continual Large-Scale Knowledge Injection [88.56816599695391]
Retrieval-augmented generation (RAG) improves factuality but adds latency and engineering overhead at serving time.<n>We propose RING (Retrieval-Internalized Generation), a holistic paradigm spanning both architecture and training.
arXiv Detail & Related papers (2026-08-03T03:00:43Z) - RH-RAG: Trustworthy Long-Form Generation for Privacy-Constrained Settings [0.0]
RH-RAG is a framework for secure and trustworthy long form generation using local language models.<n>It decomposes generation into three coordinated stages: a Planner Agent that constructs a global document outline from semantic summaries, a Writer Agent that incrementally generates coherent section-wise content, and a Checker Agent that mitigates hallucinations through natural language inference-based factual verification.<n> Evaluations across literary, financial, and legal domains demonstrate that RH-RAG consistently improves factual grounding, semantic coherence, and document-level alignment.
arXiv Detail & Related papers (2026-08-02T15:27:00Z) - GoldenRetriever: Non-Interactive Homomorphic Encrypted Retrieval for Privacy-Preserving RAG [20.647970767787225]
We propose a non-interactive encrypted retrieval framework for RAG based on threshold selection.<n>Instead of performing expensive top-$k$ ranking under encryption, our approach selects documents whose similarity scores exceed a predefined threshold.<n>Results highlight threshold-based selection as a practical foundation for scalable and secure RAG systems.
arXiv Detail & Related papers (2026-07-31T04:44:24Z) - Phantoms and Disclosures: a Causal Framework for Auditing Synthetic Data [56.86147283213652]
We present a customizable empirical auditing framework designed to detect and explain data disclosures.<n>Our framework introduces a mechanism to distinguish between "true disclosures"-where the system directly reproduces a user's information-and "phantom disclosures"-where the system incidentally generates a user's data.
arXiv Detail & Related papers (2026-06-15T16:54:02Z) - Retrieval from Within: An Intrinsic Capability of Attention-Based Models [45.52264380766645]
We introduce INTRA (INTrinsic Retrieval via Attention), a framework where decoder attention queries score pre-encoded evidence chunks that are then directly reused as context for generation.<n>On question-answering benchmarks, INTRA outperforms strong engineered retrieval pipelines on both evidence recall and end-to-end answer quality.
arXiv Detail & Related papers (2026-05-07T07:42:28Z) - Beyond Semantic Similarity: Rethinking Retrieval for Agentic Search via Direct Corpus Interaction [127.64173950476702]
We study direct corpus interaction (DCI), where an agent searches the raw corpus directly with general-purpose terminal tools.<n>This approach requires no offline indexing and adapts naturally to evolving local corpora.<n>Across IR benchmarks and end-to-end agentic search tasks, this simple setup substantially outperforms strong sparse, dense, and reranking baselines.
arXiv Detail & Related papers (2026-05-03T19:13:11Z) - Retrieval-Augmented Code Review Comment Generation [0.0]
Automated code review comment generation (RCG) aims to assist developers by automatically producing natural language feedback for code changes.<n>Existing approaches are primarily either generation-based, using pretrained language models, or information retrieval-based (IR), reusing comments from similar past examples.<n>This work proposes to leverage retrieval-augmented generation (RAG) for RCG by conditioning pretrained language models on retrieved code-review exemplars.
arXiv Detail & Related papers (2025-06-13T08:58:20Z) - Constrained Auto-Regressive Decoding Constrains Generative Retrieval [71.71161220261655]
Generative retrieval seeks to replace traditional search index data structures with a single large-scale neural network.<n>In this paper, we examine the inherent limitations of constrained auto-regressive generation from two essential perspectives: constraints and beam search.
arXiv Detail & Related papers (2025-04-14T06:54:49Z) - CONFLARE: CONFormal LArge language model REtrieval [0.0]
Retrieval-augmented generation (RAG) frameworks enable large language models (LLMs) to retrieve relevant information from a knowledge base and incorporate it into the context for generating responses.
RAG does not guarantee valid responses if retrieval fails to identify the necessary information as the context for response generation.
We introduce a four-step framework for applying conformal prediction to quantify retrieval uncertainty in RAG frameworks.
arXiv Detail & Related papers (2024-04-04T02:58:21Z) - Autoregressive Search Engines: Generating Substrings as Document
Identifiers [53.0729058170278]
Autoregressive language models are emerging as the de-facto standard for generating answers.
Previous work has explored ways to partition the search space into hierarchical structures.
In this work we propose an alternative that doesn't force any structure in the search space: using all ngrams in a passage as its possible identifiers.
arXiv Detail & Related papers (2022-04-22T10:45:01Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.