atlas

Research map / Large language models / Retrieval and knowledge

Follow My Instruction and Spill the Beans: Scalable Data Extraction from Retrieval-Augmented Generation Systems

ICLR 2025 · Large language models › Retrieval and knowledge · approach: RAG robustness and evaluation · 4 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Shows that instruction-tuned LMs in retrieval-in-context RAG systems can be prompt-injected to regurgitate datastore text verbatim, scaling with model size, and tests mitigations and attacks on production GPTs.

Problem

Private non-parametric datastores in retrieval-augmented generation (RAG) systems can be extracted by black-box adversaries exploiting instruction-following in LMs via prompt injection.

Approach

Prompt-injected data extraction: an adversarial prompt asks the RAG LM to copy the text preceding the query (where retrieved chunks are prepended), exploiting instruction following; stronger instruction-following models leak more. Mitigations combine a safety-aware system prompt with position-insensitive encoding (PINE), and the attack is adapted to production GPTs with a tool-call prompt.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Scale the instruction-tuned model from 7b to 70bLlama2-Chat · Wikipedia datastoreROUGE-L: 80.369_{\pm 1.679} -> 89.567_{\pm 0.958}Helped
Instruction-tune the base model (ablation)Llama2-7b/13b, Mistral-7b, and Mixtral-8x7b · Wikipedia datastoreROUGE: +65.76Helped
Use Harry Potter instead of Wikipedia as datastore (ablation)Llama2-Chat · Harry Potter datastoreROUGE-L: +12.446 (7b); +10.083 (13b); +5.743 (70b)Helped
Increase the retrieved context size (ablation)Mistral-Instruct-7b · Wikipedia datastoreAbsolute reconstruction lengthHelped
Use fewer, longer chunks rather than more, shorter chunks at fixed retrieved-context size (ablation)Mistral-Instruct-7b · Wikipedia datastoreAbsolute reconstruction lengthHelped
Use semantic-aware chunking rather than fixed-size chunking (ablation)Mistral-Instruct-7b · Wikipedia datastoreReconstruction rateHelped
Place the adversarial instruction near the beginning or end instead of the middle of the context (ablation)Mistral-Instruct-7b · Wikipedia datastoreReconstruction lengthHelped
Add a safety-aware system prompt (ablation)Llama3 8b Instruct · Wikipedia datastoreReconstruction Rate: 88.88 -> 87.57No clear effect
Apply Position-Insensitive Encoding (PINE) (ablation)Llama3 8b Instruct · Wikipedia datastoreReconstruction Rate: 88.88 -> 58.03Helped
Combine safety-aware prompting with PINE (ablation)Llama3 8b Instruct · Wikipedia datastoreReconstruction Rate: 88.88 -> 52.34Helped
Attack customized GPTs by prompting execution of the myfiles_browser search function25 customized GPTs · GPTs datastore leakageAttack success rate: 100\%Helped
Use 100 GPT-generated questions as extraction queriesHarry Potter GPT · Harry Potter and the Sorcerer's StoneReconstruction rate: 41.73\%Helped

Surprising findings

Limitations

Experimental setup

Datasets: Wikipedia articles created after November 1st 2023 (1165 articles, 1,569,000 words) WikiQA questions (230) as anchor queries Harry Potter and the Sorcerer's Stone text

Benchmarks: Wikipedia datastore extraction (WikiQA anchor queries) Harry Potter GPT reconstruction

Metrics: ROUGE-L BLEU F1 BERTScore absolute reconstruction length reconstruction rate attack success rate

Baselines: Llama2-Chat Mistral-Instruct Mixtral-Instruct Vicuna SOLAR WizardLM Qwen1.5-Chat Platypus2-Instruct

Builds on: retrieval-augmented generation PINE BM25

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy