Finetuning can bypass LLM alignment, causing up to 17% memorized text leakage
A cheap finetuning attack can undo model alignment and enable large-scale extraction of training data from production language models.
Security & privacy SPY Lab (ETH Zurich) 2 Jul 2024 Attack Real-world evidence
Published as “Extracting (Even More) Training Data From Production Language Models”
Why it matters
The work shows that alignment alone cannot guarantee privacy and that finetuning APIs can be abused to extract large amounts of training data from deployed LLMs.
Summary
The researchers built a finetuning attack that re-trains ChatGPT-style models on a small dataset of prefixes and full documents, effectively reverting alignment. After finetuning GPT-3.5 on 1,000 samples from The Pile, 4.3% of generated text matched internet sources, and when finetuned on data extracted by their earlier divergence attack, 17% matched verbatim. The same approach on GPT-4 achieved 11.3% memorized output and could reconstruct 50-token excerpts of over 60% of New York Times lawsuit articles. Evidence comes from real-world API calls to OpenAI models, with baseline comparisons to aligned models and the prior divergence attack.
What they found 3
- Finetuning on random pretraining data raises memorized output to 4.3%
“We found that 4.3% of the text generated by the model finetuned on The Pile could be found verbatim on the internet (almost 1.5x increase from our divergence attack).”
- Finetuning on previously extracted memorized text yields 17% memorized output
“finetuning on memorized text is even more effective and 17% of text generated by the model trained on our divergence attack was memorized!.”
- Finetuned GPT-4 can regurgitate 50 tokens for over 60% of NYT lawsuit articles
“Finetuned GPT-4 can regurgitate 50 tokens for over 60% of the lawsuit articles.”
Caveats 4
- The divergence attack does not work equally well on all models; it failed on GPT-4 and showed little memorization on other models.
- The authors note the results are likely a lower bound because they cannot confirm all test documents were in the training set.
- These results are likely a lowerbound on memorization rates, since we do not know for sure if all of the documents we test were included in the training data of the target model.
- The attack does not work on all models; GPT-4 showed no divergence in the original attack.
What’s new here 4
- Introduces a principled finetuning attack that reverses alignment in production LLMs.
- Achieves up to 17% memorized text generation, a 210× increase over aligned GPT-3.5.
- Enables targeted reconstruction of specific documents, including paywalled NYT articles.
- Demonstrates the attack works on both GPT-3.5 and GPT-4 with a cost of <$3.