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- retrieval, which is typically implemented using secure sorting to identify relevant documents. However, existing systems face challenges supporting arbitrary due to their inability to change , new security issues, and in particular, efficiency degradation with large . This is a significant limitation because applications such as finance, law, and healthcare require a 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- retrieval. Unlike existing systems, P²RAG avoids sorting candidate documents. Instead, it uses an interactive bisection method to determine the set of top- 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 faster than the state-of-the-art PRAG for —.
Workflow Figure

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 for the top- documents. The bisection iteration ends when 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- documents.
Full Paper
The preprint PDF is available on arXiv 2603.14778.