Skip to content
Yulong Ming's Homepage
Go back

P²RAG: Efficient Privacy-Preserving RAG Service Supporting Arbitrary Top-k Retrieval

Updated:

Abstract

Retrieval-Augmented Generation (RAG) enables large language models to use external knowledge, but outsourcing the RAG service raises privacy concerns for both data owners and users. Privacy-preserving RAG systems address these concerns by performing secure top-kk retrieval, which is typically implemented using secure sorting to identify relevant documents. However, existing systems face challenges supporting arbitrary kk due to their inability to change kk, new security issues, and in particular, efficiency degradation with large kk. This is a significant limitation because applications such as finance, law, and healthcare require a kk that is large enough to cause huge overhead for existing systems. Also, modern long-context models generally achieve higher accuracy with larger retrieval sets. We propose P²RAG, an efficient privacy-preserving RAG service that supports arbitrary top-kk retrieval. Unlike existing systems, P²RAG avoids sorting candidate documents. Instead, it uses an interactive bisection method to determine the set of top-kk documents. For security, P²RAG uses secret sharing on two semi-honest non-colluding servers to protect the data owner’s database and the user’s prompt. It enforces restrictions and verification to defend against malicious users and tightly bounds the information leakage of the database. The experiments show that P²RAG is 3—300×\times faster than the state-of-the-art PRAG for k=16k = 1610241024.

Workflow Figure

Workflow of P²RAG

The workflow of P²RAG. During the offline stage, the data owner sets up the secret-shared database. During the distance calculation, the servers compute the secret-shared distances between each document and the user’s prompt. During the distance bisection, the user determines a distance threshold dkd_k for the top-kk documents. The bisection iteration ends when dkd_k is found, or the number of iterations exceeds an upper bound. During the text retrieval, the user retrieves textual documents using the indices of the top-kk documents.

Full Paper

The preprint PDF is available on arXiv 2603.14778.


Share this post: