← Latest papers
💻 computer science

Privacy-Preserving RAG by Concealing Sensitive Information from External LLMs

This paper introduces SEAG, a privacy-preserving framework that utilizes a lightweight model to identify sensitive entities and replace them with aliases in both user queries and retrieved documents, thereby enabling the secure use of external Large Language Models in Retrieval-Augmented Generation without exposing confidential information.

Original authors: Saleh Almohaimeed, Saad Almohaimeed, Mousa Jari, Fahad Alotaibi, Khalid A. Alobaid

Published 2026-08-14
📖 5 min read🧠 Deep dive

Original authors: Saleh Almohaimeed, Saad Almohaimeed, Mousa Jari, Fahad Alotaibi, Khalid A. Alobaid

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you're at a giant, magical library where the books are written by super-smart robots called Large Language Models (LLMs). These robots are amazing at answering questions, but they don't know everything about the world on their own. So, to help them, we use a system called RAG (Retrieval-Augmented Generation). Think of RAG like a research assistant: when you ask a question, the assistant quickly grabs the most relevant pages from the library's shelves and hands them to the robot. The robot then reads those pages and writes a perfect answer for you.

But here's the tricky part: sometimes, those library pages contain super-secret stuff, like your medical records, your bank account numbers, or a company's secret recipe. Usually, we worry about you accidentally seeing secrets you aren't supposed to. But what if the problem is the robot itself? If you send those secret pages to a robot that lives in a different company's cloud (like a third-party AI service), that robot sees everything. It might accidentally leak your secrets or use them in ways you never intended. The big question this paper tackles is: How can we use these powerful, outside robots to get great answers without them ever seeing our private secrets?


The Secret Agent Framework: SEAG

The authors of this paper, a team from Saudi Arabia, came up with a clever solution called SEAG (Sensitive Entity Alias Generator). Imagine you have a top-secret spy mission. You need to send a report to a friendly but distant headquarters (the external AI) to get help, but you can't let them see the names of the spies, the locations of the bases, or the code names of the weapons.

In a normal RAG system, you'd just send the raw report to the headquarters, and they'd read every word. But with SEAG, you insert a local, tiny, super-fast translator right before you send the report. This translator is a small AI model that lives safely on your own computer.

Here is how the magic happens:

  1. The Scan: Your local translator reads your question and the secret documents you found. It spots the "sensitive entities"—the names, dates, places, and numbers that need protection.
  2. The Swap: It creates a secret codebook (an "entity replacement table"). It swaps "Dr. Smith" with "Dr. Jones," "New York" with "Chicago," and "$5 million" with "$10 million." Crucially, it makes sure the swap makes sense. If it changes a country name, it also changes the capital city to match the new country, so the story still makes grammatical and logical sense.
  3. The Send: It sends this "cleaned" version to the powerful outside robot. The outside robot does its job, answering the question based on the fake names and numbers. It has no idea it's working with a disguise.
  4. The Reveal: When the outside robot sends back its answer, your local translator grabs the codebook again. It swaps "Dr. Jones" back to "Dr. Smith" and "$10 million" back to "$5 million."
  5. The Result: You get the perfect, accurate answer with all your real secrets intact, while the outside robot never saw a thing.

What They Found

The team tested this idea by building two special sets of practice questions and documents. One set was used to teach their local translator how to swap names correctly, and the other set was used to see if the whole system actually worked. They tried this with three different small translator models: Qwen-3, LLaMA-3.2, and Phi-4. They then sent the disguised questions to two of the world's most powerful outside robots: GPT-5 and Claude-4 sonnet.

The results were quite promising. The system successfully hid the sensitive information in most cases. When they measured how well the system kept secrets (the "Privacy" score), the LLaMA-3.2 model was the star performer, hiding about 89.67% of the secrets when paired with the Claude-4 generator.

But hiding the secrets is only half the battle; the answer still needs to be right for you. The team measured this with a "User" score. They found that the combination of LLaMA-3.2 as the translator and Claude-4 sonnet as the answer-bot gave the best results, with a score of 83.67%. This means that in more than 8 out of 10 tries, the user got the correct answer with their secrets safe, even though the outside robot was working with fake data.

Interestingly, when they looked at how well the models hid every single sensitive word in the documents (not just the ones needed for the answer), Qwen-3 and LLaMA-3.2 performed very closely, with total accuracies of 77.83% and 76.73% respectively. The Phi-4 model was a bit less effective in this specific comprehensive test, scoring around 74.91%.

The Catch and the Future

The authors are careful to note that this isn't a perfect, solved problem yet. Their tests were done on documents that were about 300 words long with roughly 15 sensitive items each. They admit that if the documents get much longer or have hundreds of secrets, the system might struggle to keep the story consistent and the secrets hidden.

However, this paper suggests a very exciting path forward. It shows that we don't need to build expensive, massive computers to keep our data safe. Instead, we can use a small, cheap local model to act as a "privacy filter," allowing us to enjoy the superpowers of giant, outside AI robots without ever handing over our keys to the kingdom. The authors suggest that future work will need to test this on longer, more complex documents to see if the system holds up under pressure.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →