How Much Do Code Language Models Remember? An Investigation on Data Extraction Attacks before and after Fine-tuning
Fabio Salerno, Ali Al-Kaswan, Maliheh Izadi

TL;DR
This paper investigates how much sensitive data code language models can memorize and extract, comparing pre-trained and fine-tuned models, revealing that fine-tuning reduces data extractability but can increase vulnerability in smaller models.
Contribution
The study introduces a benchmark for assessing data extraction vulnerability in both pre-trained and fine-tuned code models, providing new insights into data memorization and privacy risks.
Findings
54.9% of pre-training data can be extracted from StarCoder2-15B
Fine-tuning reduces data extractability from 54.9% to 23.5%
Data carriers and licensing info are most memorized, with some forgetting after fine-tuning
Abstract
Code language models, while widely popular, are often trained on unsanitized source code gathered from across the Internet. Previous work revealed that pre-trained models can remember the content of their training data and regurgitate them through data extraction attacks. Due to the large size of current models, only a few entities have the resources for pre-training such models. However, fine-tuning requires fewer resources and is increasingly used by both small and large entities for its effectiveness on specialized data. Such small curated data for fine-tuning might contain sensitive information or proprietary assets. In this study, we attack both pre-trained and fine-tuned code language models to investigate the extent of data extractability. We first develop a custom benchmark to assess the vulnerability of both pre-training and fine-tuning samples to extraction attacks. Our…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Web Application Security Vulnerabilities · Advanced Malware Detection Techniques
