RAG Deserves an Index: Why Ingest-Time Compilation Beats Query-Time Interpretation

TL;DR

Proposes ingest-time semantic compilation (ISC) with maintained semantic index, outperforming query-time interpretation in accuracy and cost efficiency.

cs.AI 🔴 Advanced 2026-08-21 66 views
Kyle Wild Yusuke Takahashi Asako Uraki
Information Retrieval Semantic Indexing Knowledge Management System Optimization Large Language Models

Key Findings

Methodology

This paper introduces the ingest-time semantic compilation (ISC) framework, which precomputes semantic representations into two interconnected layers: incrementally maintained embeddings and validated atomic claims with provenance. It defines semantic DDL, maintenance contracts, migration protocols, and a cost model to enable continuous updates aligned with source changes. Experiments on 500 broadcast interview transcripts show that maintenance costs are only 1/33.7 of full reconstruction, and compiled claims achieve 85.2% accuracy at a 2.2k token budget, outperforming traditional chunking methods (72.5%) and matching hybrid retrieval pipelines at a fraction of the cost.

Key Results

  • In tests with 500 transcripts, compiled claims reached 85.2% correctness from 2.2k tokens, surpassing chunk-based approaches at 72.5% from 16.3k tokens.
  • Maintenance costs scaled linearly with source changes, remaining far below full re-computation, with maximum principal-angle drift below 10^-11 degrees.
  • Across multiple model budgets, compiled claims consistently outperformed chunking, validating efficiency and accuracy gains.

Significance

This work fundamentally shifts the retrieval paradigm by moving semantic understanding from query-time to ingestion-time, reducing inference costs and improving reliability. It addresses longstanding issues of cost, scalability, and provenance verification in large-scale knowledge systems, paving the way for more sustainable AI applications.

Technical Contribution

The paper introduces a novel architecture combining a maintained semantic embedding index with a symbolic layer of provenance-verified claims. It formalizes contracts for compilation, maintenance, and migration, and develops a cost model for decision-making. This approach enables incremental updates, guarantees provenance, and achieves superior retrieval accuracy with lower costs compared to existing methods.

Novelty

This is the first framework to implement ingest-time semantic compilation with validated atomic claims, integrating database-inspired indexing with large language model semantics. Unlike prior work that relies solely on raw text or unverified chunks, this method offers a verified, maintainable semantic substrate, representing a new paradigm in knowledge management.

Limitations

  • Validation currently relies on exact source span matching, which may be challenged by paraphrasing or ambiguous references in complex sources.
  • Real-world source dynamics and model upgrades may introduce additional costs not yet fully quantified.
  • The system's scalability to multi-tenant, multi-version environments requires further development.

Future Work

Future research will optimize the compilation planner to adaptively select what to compile based on query patterns, extend provenance verification to more complex sources, and explore multi-tenant architectures. Additionally, integrating multi-modal data and real-time source updates will be key to deploying ISC in production environments.

AI Executive Summary

The rapid growth of large-scale knowledge bases and retrieval-augmented systems has revealed a critical bottleneck: the repeated semantic decoding of raw source text at query time, which leads to high inference costs and inconsistent reliability. Traditional approaches, akin to scanning entire tables without indexes, are increasingly inefficient as context sizes grow. This paper proposes a transformative solution—ingest-time semantic compilation (ISC)—which shifts the heavy lifting from query execution to data ingestion. By precomputing and maintaining a semantic substrate composed of two layers—embeddings and validated atomic claims—the system can deliver accurate, provenance-verified answers with minimal runtime cost.

The core innovation lies in formalizing a set of contracts: semantic DDL for defining what gets compiled, maintenance protocols for incremental updates, migration strategies for model upgrades, and a cost model guiding when to compile versus interpret. The semantic layer is implemented using a PostgreSQL-based prototype, where each claim is a self-contained row with source provenance, validated through exact source span matching. Experimental results on 500 broadcast transcripts demonstrate that maintenance costs are dramatically lower than re-computation, and the compiled claims outperform chunk-based retrieval in accuracy at a fraction of the token budget.

This approach addresses fundamental limitations of existing retrieval paradigms, offering a scalable, reliable, and verifiable semantic index. It opens new avenues for building sustainable AI systems capable of handling dynamic sources and complex queries efficiently. The authors envision future systems with adaptive compilation planners, provenance-aware validation, and multi-tenant support, pushing the frontier of knowledge management and large language model integration. Overall, ISC represents a significant step toward a new era of semantic storage, retrieval, and reasoning, with profound implications for both academia and industry.

Deep Analysis

Background

Recent advances in large language models (LLMs) and retrieval-augmented generation (RAG) systems have revolutionized knowledge-based AI applications. Early works like FAISS, Proposition Indexing, and Contextual Chunking improved retrieval efficiency but relied on post hoc interpretive steps, which are costly and lack provenance guarantees. As models scale, the cost of repeated semantic decoding during inference becomes prohibitive, especially with long contexts. Existing solutions struggle with source dynamism, verification, and maintenance, leading to unreliable outputs and high operational costs. The need for a persistent, verifiable, and efficient semantic storage mechanism has become urgent, motivating the development of precompiled semantic structures that can be incrementally maintained and validated.

Core Problem

The core challenge is to eliminate the repetitive semantic decoding at query time, which inflates inference costs and reduces reliability. Traditional indexes lack semantic verification, leading to hallucinations and inaccuracies. Dynamic sources further complicate maintenance, as re-computation is expensive and often infeasible at scale. The fundamental problem is designing a semantic storage system that is both cost-effective and verifiable, capable of handling source updates, model upgrades, and multi-user access without sacrificing accuracy or provenance. Addressing this problem is critical for deploying scalable, trustworthy knowledge systems.

Innovation

The key innovation is the introduction of ingest-time semantic compilation (ISC), which precomputes and maintains a verified semantic substrate. This system employs two layers: a geometric layer of embeddings, maintained via incremental low-rank updates, and a symbolic layer of atomic claims with provenance validation. It formalizes contracts for compilation (semantic DDL), maintenance, migration, and cost optimization, enabling continuous updates aligned with source changes. Unlike prior methods relying solely on raw text or unverified chunks, ISC guarantees provenance, reduces maintenance costs, and improves retrieval accuracy. It leverages database principles—indexing, validation, and incremental updates—in a novel semantic context.

Methodology

  • �� Define semantic DDL to specify which source content is compiled into claims, with validation gates ensuring source span correctness.
  • �� Construct a semantic substrate with two layers: geometric embeddings for fast retrieval, maintained via incremental low-rank updates; symbolic claims with provenance data for verification.
  • �� Implement maintenance protocols that track source changes, updating only affected parts, reducing costs.
  • �� Develop migration strategies for model upgrades, using orthogonal Procrustes alignment to preserve embedding space.
  • �� Establish a cost model to decide when to compile based on expected read frequency, balancing compilation and interpretation.
  • �� Use validation gates to prevent invalid claims from entering the index, ensuring high provenance integrity.

Experiments

Experiments involved 500 broadcast interview transcripts, comparing compiled claims against chunking and hybrid retrieval pipelines. Metrics included accuracy, token budget, maintenance cost, and model migration impact. The system was tested under various source change scenarios, measuring incremental update costs and retrieval correctness. Results showed that incremental maintenance was 33.7× cheaper than full re-computation, with maximum principal-angle drift below 10^-11 degrees. In accuracy tests, compiled claims consistently outperformed chunking, especially at lower token budgets, demonstrating robustness and efficiency. The experiments validated the system's scalability and reliability in real-world scenarios.

Results

Compiled claims achieved 85.2% correctness at a 2.2k token budget, outperforming chunking (72.5%) at 16.3k tokens. Maintenance costs scaled linearly with source changes, remaining far below re-computation costs. The system maintained high geometric alignment accuracy after model upgrades, confirming robustness. Across multiple budgets, compiled claims consistently delivered higher accuracy per token, validating the approach’s efficiency and reliability.

Applications

This architecture is ideal for large-scale knowledge bases, enterprise document management, and legal or compliance systems requiring verified, up-to-date information. It supports dynamic sources, model upgrades, and multi-user access, enabling reliable AI-powered decision-making, automated compliance checks, and efficient information retrieval in complex environments.

Limitations & Outlook

Current validation relies on exact span matching, which may be challenged by paraphrasing or ambiguous references. Handling highly volatile sources or frequent model upgrades could incur higher costs. Multi-tenant deployment, access control, and version management require further development to meet real-world enterprise needs. Scalability to multi-modal data and complex source structures remains an open challenge.

Plain Language Accessible to non-experts

想象你在一家图书馆里,每次有人问你某个问题,你都得翻遍所有书,花费很多时间。而如果你提前把所有书的内容整理成目录,标明每个问题的答案和出处,你就可以直接查找答案,不用每次都重新阅读整本书。这就像系统提前把知识整理成“声明”,每次有人问问题时,系统只需要查找这些声明,快速给出答案。这样不仅节省时间,还能保证答案的真实性和可靠性。就像你把所有重要信息提前整理好,放在一个特别的索引里,随时可以快速找到需要的答案。

ELI14 Explained like you're 14

想象你在学校的图书馆,每次想找一本书都得翻遍所有书架,花费很多时间。而如果你提前把书里的重要内容整理成一个目录,告诉你每个问题的答案和在哪一页,就可以直接找到答案啦!这就像把知识提前整理好,变成一个超级方便的索引。每次问问题时,你不用再重新看一遍所有书,只要看这个目录就知道答案了。这样既快又准,还能保证答案是真的。就像你把所有重要信息都提前整理好,放在一个特别的“知识库”里,随时可以快速找到需要的东西。

Abstract

Nearly every retrieval-augmented question-answering system in production ships with a hidden interpreter: on each query a language model re-derives the meaning of raw corpus text and then throws that work away. Cheaper models do not close the gap: per-token prices have fallen by orders of magnitude while inference spend has risen, because context volume grows faster than prices fall. This is the modern equivalent of the full-table scan, and the remedy is the one databases found fifty years ago: do the expensive work once, at write time, into a maintained structure that makes reads cheap. A corpus whose read pattern is known before it ever meets a user can and should be indexed too. We call the paradigm ingest-time semantic compilation (ISC): compile a corpus's meaning into a queryable substrate with two coupled layers - incrementally maintained embeddings, and atomic claims whose provenance is validated at compile time - and treat that substrate as a first-class database object with its own DDL, maintenance contract, migration contract, and cost model. Two existence proofs support it. Substrate upkeep scales with change rather than corpus size: incremental updates run 33.7x cheaper than reconstruction while tracking it to floating-point precision. And on a held-out sample of 500 broadcast-interview transcripts, compiled claims as the retrieval payload win all 32 budget-by-model cells: 85.2% correct from roughly 2.2k reader tokens against 72.5% from 16.3k for the best chunk configuration anywhere. The only baseline that keeps pace is a contextualized-chunk pipeline with hybrid retrieval and reranking, statistically indistinguishable from compiled claims at roughly twenty-one times the query-path tokens - and it reaches that parity, we argue, precisely because it has itself begun to compile. We close with the systems agenda this opens, from compilation planners to read planning.

cs.AI cs.DB cs.IR