arXiv(opens in a new tab)cs.CRAug 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2608.25735

Pointing the Way, Hiding the Destination: Practical Private Dense Retrieval at Scale

Peichun Hua, Danyang Chen, Junan Zhang, Haifeng Sun, Jingyu Wang, Diwen Xue, Mingyu Li, Yunming Xiao

Abstract

Hosted retrieval-augmented generation (RAG) and semantic search allow users to query valuable provider-held corpora, raising two competing demands: to hide each query and chosen result, yet reveal only the documents that the user is authorized to receive. Existing cryptographic approaches either make this costly by processing the entire corpus for every query, or sacrifice quality for efficiency by scanning a few clusters. We repurpose learned deep hashing as a private filter: a randomized binary code points the provider to a short candidate list, while encrypted reranking and oblivious key transfer protect the precise query and final selection. This shortlist short-circuits full-corpus cryptographic search without sacrificing retrieval quality: with 200–500 candidates, it closely matches full-corpus retrieval across five zero-shot corpora spanning 25K to 5.4M documents. On the full 2.68M-passage NQ corpus over a 10-Gbps link, our protocol only adds 0.73 seconds, or 10%, to a 128-token Qwen3-32B RAG pipeline. The released code satisfies directional metric differential privacy (DP) and substantially reduces embedding-inversion and property-inference leakage, demonstrating that a carefully learned shortlist can make private dense retrieval both accurate and practical.

1 Introduction

The proliferation of Retrieval-Augmented Generation (RAG) has transformed large language models (LLMs) from static artifacts into dynamic, knowledge-grounded reasoning engines [25, 27, 47, 67]. At the core of RAG lies dense retrieval: mapping documents and queries into a high-dimensional vector space and searching via nearest neighbors. As organizations deploy RAG over sensitive corpora such as legal archives, medical records, and proprietary knowledge bases, both the document collection and user queries become sensitive assets [14, 62, 74, 88]. Recent embedding inversion attacks [12, 35, 49, 61, 73, 90] have demonstrated that continuous embeddings are not opaque fingerprints, but rich, invertible semantic representations from which an adversary can reconstruct sensitive source text and infer private attributes.

Existing cryptographic approaches to private retrieval struggle to balance security with the scale and dimensionality of modern dense embeddings. Homomorphic encryption (HE) and multi-party computation (MPC) protocols [14, 48, 59] incur orders-of-magnitude of computational overhead, while ORAM-based methods [96] require multiple interactions and high user-side computation and storage [19]. Trusted execution environments (TEEs) avoid homomorphic scoring, while access-pattern [84] and microarchitectural leakage [6] remain.

This work. Our central design choice is to expose a coarse candidate pattern under directional metric differential privacy (mDP) [37] and reserve cryptographic computation for the resulting shortlist. An honest-but-curious Corpus Owner keeps its proprietary corpus with full-precision embeddings while additionally maintaining a lightweight binary index; an authorized User randomizes released hash codes that satisfy stringent mDP guarantees and encrypts the clean query representation. The resulting code makes the nearby query directions induce similar candidate-pattern distributions, making them hard to distinguish from one another and thereby protecting critical detailed privacy information (§3.3). The Owner performs a Hamming search on the corpus (N) and packed Brakerski–Fan–Vercauteren (BFV) homomorphic scoring over the resulting K candidates. The User decrypts the scores, selects locally, and uses active-secure k-out-of-K oblivious transfer (OT) to open at most k payloads without revealing its choices or accessing the other K−k payloads.

Recovering retrieval quality under DP may require scoring K=500−3,000K = 500-3,000 candidates, while a RAG request typically releases and bills only k=3−10k = 3-10 documents. The gap between K and k makes OT central to this deployment model. Returning the shortlist would disclose hundreds of times more content; requesting the final documents directly would reveal the User's selection. Instead, our k-out-of-K transfer binds each round to the billable result count, while authenticated accounts and cumulative quotas govern repeated extraction. In our model, we assume that the User might want to actively learn the payloads beyond its billed k per round and design our protocol to handle such threats ( §\S6.4; Theorem 5).

Three empirical insights make our design highly practical.

① Candidate-set redundancy persists across scales and domains. A learned binary filter (Stage 1) needs only to preserve the documents that matter for the final ranking (Stage 2), while the ranking among the top documents is not critical. At K = 500, the two-stage pipeline (§5) retains 98.84%–100% of full-corpus NDCG@10 (ranking quality) across five zero-shot BEIR corpora [75] on both evaluated encoders. In particular, on Climate-FEVER with 5.4M documents, the shortlist excludes noisy high-scoring documents and raises NDCG@10 by 0.0012–0.0158. Even under DP protection, expanding the candidate pool up to 3,000 achieves a good balance between efficiency and search quality (§7.2.1). These corpora span scientific search, question answering, entity retrieval, and fact verification at scales from 25K to 5.4M documents (Figure 1), demonstrating strong generalizability of our approach.

② Dense embeddings contain substantial precision redundancy. We find that scalar int8 quantization preserves the pretrained ranking closely; our symmetric zero-point-free realization converts floating-point similarity into exact, low-depth integer dot products. Without this precision reduction, private real-valued scoring relies on approximate-number HE such as CKKS [15], higher-precision fixed-point BFV [40], or interactive fixed-point MPC [60]; int8 enables exact packed BFV scoring with a small plaintext modulus while preserving high ranking quality.

③ Model separation creates pipeline parallelism. We adopt low-rank adaptation (LoRA) fine-tuning [34] of pretrained encoders to create the learned hash models efficiently. This ensures that the hash codes can select a high-recall subset without incurring the storage and memory burden of an entirely new model. Our protocol implementation carefully overlaps the pretrained scoring forward and BFV query encryption with Owner-side Hamming shortlist construction, then streams the candidate ciphertexts while encrypted scoring and key transfer advance. This successfully hides the latency and makes our protocol efficient under different network bandwidths.

We investigate randomized response, Gaussian, Rényi-DP-calibrated von Mises–Fisher (RDP-vMF), and exactly calibrated pure-vMF mechanisms that achieve mDP, extensively evaluating their privacy–utility trade-offs through retrieval quality, representation attacks, protocol latency, and end-to-end RAG. In summary, we make the following contributions:

  1. A leakage-aware retrieval protocol and security contract that reveals a metric-DP candidate pattern, confines encrypted exact scoring to K candidates, protects the clean query against the Owner, and uses active-secure k-out-of-K OT to hide the final selection and bound payload recovery.

  2. A learned candidate-filter design and training recipe that retrofits pretrained encoders via LoRA while preserving the original model as the Stage 2 scorer. It sustains near-lossless zero-shot retrieval across domains and corpus scales and improves over direct quantization, classical hashing, and supervised binary-retrieval baselines.

  3. A directional randomization mechanism and analysis that gives the released shortlist code pure metric-DP protection, carries the guarantee through candidate generation by post-processing, and establishes its retrieval–privacy frontier against randomized response, Gaussian, and RDP-vMF mechanisms and representation attacks.

  4. A practical two-forward system realization that combines int8 quantization, shallow packed BFV, key-only OT, and pipeline overlap in a networked prototype, reducing cryptographic work from N documents to a high-recall shortlist while retaining efficient million-scale retrieval and end-to-end RAG.

References (93)

  • Homomorphic encryption security standard
  • Practical and optimal LSH for angular distance
  • Scalable private search with wally (opens arXiv in a new tab)
  • Improving the Gaussian mechanism for differential privacy: Analytical calibration and optimal denoising
  • Comparing privacy notions for protection against reconstruction attacks in machine learning
  • Foreshadow: Extracting the keys to the intel SGX kingdom with transient out-of-order execution
  • Broadening the scope of differential privacy using metrics
  • Differentially private access patterns for searchable symmetric encryption
  • SANNS: Scaling up secure approximate k-nearest neighbors search
  • M3-embedding: Multilinguality, multi-functionality, multi-granularity text embeddings through self-knowledge distillation
  • Text embedding inversion security for multilingual language models
  • How to make cross encoder a good teacher for efficient image-text retrieval? In IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2024, Seattle, WA, USA, June 16-22, 2024, pages 26984–26993
  • Remoterag: A privacy-preserving LLM cloud RAG service
  • Homomorphic encryption for arithmetic of approximate numbers
  • Cross-encoder data annotation for bi-encoder based product matching
  • Private information retrieval
  • SPECTER: document-level representation learning using citation-informed transformers
  • MESS: Fast and private semantic search on multi-graph HNSW. CoRR, abs/2607.28999, 2026 (opens arXiv in a new tab)
  • Searchable symmetric encryption: Improved definitions and efficient constructions
  • CLIMATE-FEVER: A dataset for verification of real-world climate claims (opens arXiv in a new tab)
  • Calibrating noise to sensitivity in private data analysis
  • The algorithmic foundations of differential privacy
  • Somewhat practical fully homomorphic encryption
  • A survey on RAG meeting llms: Towards retrieval-augmented large language models
  • Locality sensitive hashing with extended differential privacy
  • Retrieval-augmented generation for large language models: A survey, 2023
  • Iterative quantization: A procrustean approach to learning binary codes
  • DBpedia-Entity v2: A test collection for entity search
  • Hashing as tie-aware learning to rank
  • A survey on deep text hashing: Efficient semantic text retrieval with binary representation
  • Private web search with tiptoe
  • One loss for all: Deep hashing with a single cosine similarity based learning objective
  • Lora: Low-rank adaptation of large language models
  • Transferable embedding inversion attack: Uncovering privacy risks in text embeddings without model queries
  • Ciphertext-simulatable HE from BFV with randomized evaluation
  • Metric differential privacy at the user-level via the earth-mover's distance
  • Extending oblivious transfers efficiently
  • Super-bit locality-sensitive hashing
  • GAZELLE: A low latency framework for secure neural network inference
  • Dense passage retrieval for open-domain question answering
  • LightGBM: A highly efficient gradient boosting decision tree
  • Isotropic hashing
  • Natural questions: A benchmark for question answering research
  • Speakeasy: Billion-scale two-server private semantic search
  • Retrieval-augmented generation for knowledge-intensive NLP tasks
  • Avpmir: Adaptive verifiable privacy-preserving medical image retrieval
  • Sentence embedding leaks more information than you expect: Generative embedding inversion attack to recover the whole sentence
  • PANTHER: Private approximate nearest neighbor search in the single server setting
  • Feature learning based deep supervised hashing with pairwise labels
  • Pisces: Cryptography-based private retrieval-augmented generation with dual-path retrieval
  • Deep supervised hashing for fast image retrieval
  • Privacy-preserving approximate nearest neighbor search on high-dimensional data
  • The Llama 3 Herd of Models
  • A survey on deep hashing methods
  • Multi-probe LSH: Efficient indexing for high-dimensional similarity search
  • Learning word vectors for sentiment analysis
  • $P^{2}RAG$: Efficient privacy-preserving RAG service supporting arbitrary top-k retrieval (opens arXiv in a new tab)
  • SecureML: A system for scalable privacy-preserving machine learning
  • Text embeddings reveal (almost) as much as text
  • Five queries are enough: Query-efficient and surrogate-free membership inference attacks on RAG via entailment
  • MS MARCO: A human generated machine reading comprehension dataset
  • Actively secure 1-out-of-n OT extension with application to private set intersection
  • Refining BERT embeddings for document hashing via mutual information maximization
  • Falconn++: A locality-sensitive filtering approach for approximate nearest neighbor search
  • In-context retrieval-augmented language models
  • BCE4ZSR: bi-encoder empowered by teacher cross-encoder for zero-shot cold-start news recommendation
  • Sentence-BERT: Sentence embeddings using Siamese BERT-networks
  • Okapi at TREC-3
  • Private approximate nearest neighbor search with sublinear communication
  • Obfuscated access and search patterns in searchable encryption
  • Information leakage in embedding models
  • Differentially private retrieval-augmented generation (opens arXiv in a new tab)
  • BEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models
  • FEVER: A large-scale dataset for fact extraction and VERification
  • Private retrieval, computing, and learning: Recent progress and future challenges
  • Text embeddings by weakly-supervised contrastive pre-training (opens arXiv in a new tab)
  • Deep hashing with minimal-distance-separated hash centers
  • Minilm: Deep self-attention distillation for task-agnostic compression of pre-trained transformers
  • Searching privately by imperceptible lying: A novel private hashing method with differential privacy
  • Differential privacy for directional data
  • A decade of metric differential privacy: Advancements and applications
  • Controlled-channel attacks: Deterministic side channels for untrusted operating systems
  • Efficient passage retrieval with hashing for open-domain question answering
  • Qwen3 Technical Report
  • Connect the dots: Knowledge graph-guided crawler attack on retrieval-augmented generation systems
  • Central similarity quantization for efficient image and video retrieval
  • Universal zero-shot embedding inversion
  • Personalizing dialogue agents: I have a dog, do you have pets too? In Iryna Gurevych and Yusuke Miyao, editors, Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018, Melbourne, Australia, July 15-20, 2018, Volume 1: Long Papers, pages 2204–2213
  • Character-level convolutional networks for text classification
  • DIALOGPT : Large-scale generative pre-training for conversational response generation
  • PAC-MANN: Efficient private approximate nearest neighbor search
  • Deep hashing network for efficient similarity retrieval
  • Compass: Encrypted semantic search with high accuracy