Manuscript Offprint

arXiv:2609.11841

Atlas: Efficient Verifiable Semantic Search

Nikolay Avramov, Hidde Lycklama, Alexander Viand, Anwar Hithnawi

Abstract

Semantic search is a core primitive of modern applications, powering recommender systems, web search, and retrieval-augmented generation for language models. The provider controls the index and query execution, leaving clients to trust that results come from the right algorithm over the intended index. A provider may truncate search to cut cost, bias results, or otherwise deviate from the specified execution undetected. Verifiability can remove this trust assumption by proving that results follow the agreed algorithm over a committed index. Realizing this efficiently is hard, as retrieval at scale relies on HNSW, a graph-based algorithm whose data-dependent traversal maps poorly onto the fixed constraint systems of zero-knowledge proofs. Prior verifiable systems therefore target regular, cluster-based indices that are easier to encode, sacrificing the recall of graph-based search. We present Atlas, a system that lets a provider prove a query was answered correctly against its committed index without revealing the index. At its core is a new zero-knowledge proof for HNSW search, built on three techniques: preprocessing that shifts all database-dependent cost offline, so per-query proving scales with the traversal rather than the database; a restructuring of HNSW into a fixed-size-state procedure that we prove returns the same result; and a timestep-tagged batching that merges the per-step arguments of the entire traversal into one. Atlas is the first to demonstrate verifiable graph-based search at scale, proving a query in under a second on the SIFT1M benchmark and in 2.0 seconds at 100 million vectors, while maintaining the recall of plaintext HNSW and revealing nothing about the index beyond the result. In a complete RAG pipeline, Atlas' proven retrieval preserves end-to-end answer quality, and reaches higher quality at lower proving cost than all prior verifiable retrieval systems.

1 Introduction

Recommender systems, web search, and retrieval-augmented generation (RAG) for large language models increasingly rely on semantic search [26]. Semantic search embeds items and queries as vectors and returns the nearest items to the query in this space. Because proximity is intended to capture semantic similarity, it can retrieve relevant content even when it has little lexical overlap with the query. Approximate nearest-neighbor (ANN) search [1, 29] makes this practical at scale: instead of computing exact nearest neighbors, it returns sufficiently close points, enabling low-latency search over billions of vectors. This ability to retrieve by meaning at massive scale has made semantic search a default mechanism for finding relevant content in modern systems.

Retrieval-grounded AI systems are only as reliable as the passages they retrieve: production systems have returned incorrect answers after surfacing stale or erroneous content [30], and attackers have exploited the retrieval path, planting documents that hijack generation once retrieved [45]. Semantic search also plays a role in content provenance, where it is used to detect copyrighted material in AI pipelines or attribute generated content to rightholders [6, 24, 25, 33, 41]. In such settings, the incentives to deviate from the intended protocol can be substantial. ANN search likewise underpins recommendation systems for social networks, e-commerce, advertising, and dating platforms [7, 39]. In each of these settings, the search is executed by a third-party provider that controls both the index and the computation, while the client sees only the returned results. This opacity leaves room for failures and/or deliberate deviations. A provider may serve stale results, truncate the search to cut costs, bias the ranking toward preferred outcomes, or quietly depart from the specified algorithm. These risks compound as semantic search is increasingly embedded in automated pipelines spanning multiple services that run on third-party infrastructure, where retrieved results are consumed directly by downstream services with no human oversight. These concerns have already drawn public scrutiny and regulatory interest [10, 42]. Clients therefore need a way to verify semantic-search correctness: a guarantee that the returned set is exactly the one produced by the specified algorithm over an index to which the provider committed in advance.

Zero-knowledge proofs (ZKPs) [13, 14] can, in principle, provide such a guarantee. The provider generates a succinct proof that the returned search result is correct, which the client can verify without learning anything about the database beyond the result itself. Realizing this for semantic search, how-ever, is challenging. The de facto standard for ANN search at scale is HNSW [29]. HNSW is control-flow heavy by construction: it navigates a layered proximity graph using priority queues, data-dependent branching, and early exits. Such computation maps poorly onto the arithmetic constraint systems underlying modern ZKPs, which require circuits to be fixed in advance and provisioned for worst-case behavior at every step.

To overcome this, prior verifiable search systems avoid HNSW and instead build on cluster-based indices [27, 34]. These methods partition the dataset into clusters offline and answer a query by searching the clusters nearest to it. This fixed, data-independent search pattern encodes compactly as polynomial constraints. This data-independence, however, sacrifices recall, as the clusters are selected once and a closer neighbor outside them is unreachable for the remainder of the search. HNSW, by contrast, selects nodes throughout the search, conditioning each step on measured distances to the query, and its candidates therefore keep improving whereas a cluster-based search is confined to its initial selection. Cluster-based systems thus trade retrieval quality for provability, and the adaptivity that quality requires is exactly what a fixed constraint system struggles to capture.

In this paper, we present Atlas, an efficient zero-knowledge proof system for HNSW search. Atlas enables a provider to prove that a query was answered correctly against a committed index, while retaining the graph-based traversal on which modern retrieval systems rely. The proven search matches the recall of plaintext HNSW at lower proving cost than all existing verifiable search systems, cluster-based and graph-based alike. Atlas achieves these results through three key ideas. (i) Preserving HNSW's sublinear per-query cost. HNSW answers a query by visiting only O(log⁡N)O(\log N) of the index's N nodes. Every visited node and traversed edge, however, must be proven consistent with the committed index. A naive consistency check reads the entire committed index, and the O(log⁡N)O(\log N) search then incurs a linear proving cost. We decouple the consistency check from the traversal and defer its database-dependent cost to a preprocessing phase via cq lookup arguments [8]. The per-query proving cost then scales with the length of the traversal rather than the size of the database, preserving HNSW's sublinearity. (ii) Restructuring HNSW. We eliminate nearly all data-dependent control flow from HNSW by reformulating search as a procedure over fixed-size state and a fixed number of steps. Concretely, we collapse the multilayer descent into a single graph walk and replace the two interdependent priority queues with one bounded candidate set. This reformulation substantially shrinks the trace to be proven, as each step merges an entire neighborhood into the set in a single batched update rather than one node at a time. These structural changes preserve the search exactly, as we prove the reformulated output equivalent to HNSW's. The step bound is the only point at which the reformulated search differs from HNSW, with sufficiently large budgets recovering HNSW's result exactly and smaller ones lowering proving cost at the expense of recall. (iii) Compacting the per-step constraints. A naive encoding instantiates separate permutation and lookup arguments for each traversal step over the corresponding region of the witness. Each instantiation introduces its own auxiliary polynomials and polynomial identities, causing the proving overhead to grow with the step budget. We introduce timestep-tagged arguments, which tag every tuple with a step identifier and merge the per-step arguments of the entire traversal into a single invocation.

Evaluation Summary. We implement Atlas and evaluate it on six standard ANN benchmarks, spanning one million to one hundred million vectors and embedding dimensions from 96 to 960, as well as on end-to-end RAG pipelines with learned text embeddings (§6). Atlas proves a query over SIFT1M in 0.8 seconds, with a 16.5 kB proof that the client verifies in 40 milliseconds. Proving cost scales with the beam width and step budget needed to reach a recall target, not with database size, and the 100× larger BIGANN-100M raises proving time only 2.5×, to 2.0 seconds. Truncation to a fixed step budget sacrifices little recall, as at 95th-percentile budgets the proven search stays within 0.8 recall@1 points of plaintext HNSW on integer datasets and every dataset exceeds 0.9 recall@1 at a deployable configuration. In a complete RAG pipeline, Atlas preserves this quality end to end, attaining higher answer quality at lower proving cost than prior verifiable retrieval systems.

References (35)

  • ANN-Benchmarks: A benchmarking tool for approximate nearest neighbor algorithms
  • Transparent SNARKs from DARK compilers
  • ZKML: An optimizing system for ML inference in zero-knowledge proofs
  • M3-Embedding: Multi-linguality, multi-functionality, multi-granularity text embeddings through self-knowledge distillation
  • cq: Cached quotients for fast lookups
  • HERS: Homomorphically encrypted representation search
  • Regulation (EU) 2022/2065 of 19 October 2022 on a single market for digital services (Digital Services Act)
  • plookup: A simplified polynomial protocol for lookup tables
  • PLONK: Permutations over Lagrange-Bases for Oecumenical Noninteractive Arguments of Knowledge
  • The knowledge complexity of interactive proof-systems
  • SoK: Lookup table arguments
  • Private web search with Tiptoe
  • Product quantization for nearest neighbor search
  • CoBBl: Dynamic constraint generation for SNARKs
  • zkRAG: Efficiently proving RAG retrieval in zero knowledge
  • TriviaQA: A large scale distantly supervised challenge dataset for reading comprehension
  • Constant-size commitments to polynomials and their applications
  • Output-based attribution for content, including musical content, generated by an artificial intelligence (AI)
  • Adjusting attribution for content generated by an artificial intelligence (AI)
  • Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  • VeriRAG: Efficient zero-knowledge proofs for verifiable retrieval-augmented generation
  • Artemis: Efficient commit-and-prove SNARKs for zkML (opens arXiv in a new tab)
  • Efficient and robust approximate nearest neighbor search using hierarchical navigable small world graphs
  • CirC: Compiler infrastructure for proof systems, software verification, and more
  • KILT: a benchmark for knowledge intensive language tasks
  • V3DB: Audit-on-demand zero-knowledge proofs for verifiable vector search over committed snapshots (opens arXiv in a new tab)
  • zkGPT: An efficient non-interactive zero-knowledge proof framework for LLM inference
  • SQuAD: 100,000+ questions for machine comprehension of text
  • Onyx: Cost-efficient disk-oblivious ANN search (opens arXiv in a new tab)
  • Video Google: A text retrieval approach to object matching in videos
  • zkLLM: Zero knowledge proofs for large language models
  • Qwen2 Technical Report
  • Compass: Encrypted semantic search with high accuracy
  • The quotient $Q_B$ costs $O(n \log n)$
  • The commitment to $Q_A$ is computed as a sparse linear combination of the preprocessed cached quotient commitments in $O(n)$ [8]