RAG에는 인덱스가 필요하다: 수집 시점 컴파일이 질의 시점 해석보다 나은 이유
RAG Deserves an Index: Why Ingest-Time Compilation Beats Query-Time Interpretation
한국어 초록
운영 중인 거의 모든 검색-증강 질의응답(RAG) 시스템에는 숨겨진 인터프리터가 들어 있다. 질의가 들어올 때마다 언어 모델이 원본 코퍼스 텍스트의 의미를 다시 도출하고, 그 작업 결과를 그대로 버린다는 것이다. 더 저렴한 모델로도 이 격차는 해소되지 않는다. 토큰당 가격은 수십 배에서 수천 배까지 하락했지만, 컨텍스트 볼륨이 가격 하락보다 빠르게 증가하기 때문에 추론 비용은 오히려 늘어났다. 이는 풀 테이블 스캔(full-table scan)의 현대판이며, 해법은 50년 전 데이터베이스가 찾아낸 것과 같다. 비용이 큰 작업을 쓰기 시점에 한 번만 수행하여, 읽기를 저렴하게 만드는 유지 관리형 구조로 저장하는 것이다. 사용자를 만나기 전에 읽기 패턴이 이미 알려진 코퍼스는 마찬가지로 인덱싱할 수 있고, 또 인덱싱해야 한다. 우리는 이 패러다임을 수집 시점 의미 컴파일(ingest-time semantic compilation, ISC)이라고 부른다. 이는 코퍼스의 의미를 질의 가능한 기반 구조로 컴파일하는 것으로, 점진적으로 유지되는 임베딩과 출처(provenance)가 컴파일 시점에 검증되는 원자적 주장(atomic claim)이라는 두 개의 결합된 계층으로 이루어진다. 그리고 이 기반 구조를 자체 DDL, 유지 관리 계약, 마이그레이션 계약, 비용 모델을 갖춘 일급(first-class) 데이터베이스 객체로 취급한다. 이를 뒷받침하는 두 가지 존재 증명이 있다. 첫째, 기반 구조의 유지 비용은 코퍼스 크기가 아니라 변경량에 비례하여 증가한다. 점진적 업데이트는 재구축보다 33.7배 저렴하게 수행되면서도 부동소수점 정밀도 수준으로 재구축 결과를 따라간다. 둘째, 방송 인터뷰 녹취록 500건의 홀드아웃 샘플에서, 컴파일된 주장을 검색 페이로드로 사용한 방식이 예산-모델 조합 32개 셀 전부에서 우세했다. 리더(reader) 토큰 약 2.2k개로 85.2%의 정답률을 기록했으며, 이는 어떤 설정에서든 최고의 청크 구성이 16.3k 토큰으로 얻은 72.5%보다 높다. 유일하게 대등한 성능을 보인 기준선은 하이브리드 검색과 리랭킹을 갖춘 컨텍스트화된 청크(contextualized-chunk) 파이프라인으로, 컴파일된 주장과 통계적으로 구분되지 않았으나 질의 경로 토큰은 약 21배에 달했다. 우리는 이 파이프라인이 그러한 동등성에 도달한 것이 바로 스스로 컴파일을 시작했기 때문이라고 주장한다. 마지막으로 이것이 여는 시스템 연구 과제를 컴파일 플래너(compilation planner)에서 읽기 계획(read planning)에 이르기까지 제시한다.
원문 초록
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.
제출 이력
확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.
- arXiv:2608.20845v1제출 시각 미확인
함께 살펴볼 논문
공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.
공통 태그로 연결된 공개 논문이 아직 없습니다.
토론
이 논문과 연결된 포럼 글이 아직 없습니다.