How Quantization Impacts Privacy Risk on LLMs for Code?
Not on the map. Why?
Abstract (arXiv)
Large language models for code (LLMs4Code) rely heavily on massive training data, including sensitive data, such as cloud service credentials of the projects and personal identifiable information of the developers, raising serious privacy concerns. Membership inference (MI) has recently emerged as an effective tool for assessing privacy risk by identifying whether specific data belong to a model's training set. In parallel, model compression techniques, especially quantization, have gained traction for reducing computational costs and enabling the deployment of large models. However, while quantized models still retain knowledge learned from the original training data, it remains unclear whether quantization affects their ability to retain and expose privacy information. Answering this question is of great importance to understanding privacy risks in real-world deployments. In this work, we conduct the first empirical study on how quantization influences task performance and privacy risk simultaneously in LLMs4Code. To do this, we implement widely used quantization techniques (static and dynamic) to three representative model families, namely Pythia, CodeGen, and GPTNeo. Our results demonstrate that quantization has a significant impact on reducing the privacy risk relative to the original model. We also uncover a positive correlation between task performance and privacy risk, indicating an underlying tradeoff. Moreover, we reveal the possibility that quantizing larger models could yield better balance than using full-precision small models. Finally, we demonstrate that these findings generalize across different architectures, model sizes and MI methods, offering practical guidance for safeguarding privacy when deploying compressed LLMs4Code.
Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). First posted on arXiv 31 Jul 2025.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2025: 1; 2026: 2.
3 papers.
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?cited by 0
- 2026Bits and Memories: Measuring Verbatim Extraction Across LLM Quantizationcited by 0
- 2026Not All 4-bit Quantizers Are Equal: Deployment-Time Mitigation of PII Leakage in Fine-Tuned Small Language Modelscited by 0
- 2026Not All 4-bit Quantizers Are Equal: Deployment-Time Mitigation of PII Leakage in Fine-Tuned Small Language Models2 Aug 2026
- 2026Bits and Memories: Measuring Verbatim Extraction Across LLM Quantization28 Jul 2026
- 2025How Do Semantically Equivalent Code Transformations Impact Membership Inference on LLMs for Code?17 Dec 2025
Similar, not cited
Close in wording, no citation either way
- 2025Membership Inference Risks in Quantized Models: A Theoretical and Empirical Study
- 2024Order of Magnitude Speedups for LLM Membership Inference
- 2026On the Privacy of LLMs: An Ablation Study
- 2025A Survey on Privacy Risks and Protection in Large Language Models
- 2022Quantifying Privacy Risks of Masked Language Models Using Membership Inference Attacks
- 2025(Token-Level) InfoRMIA: Stronger Membership Inference and Memorization Assessment for LLMs
- 2025Membership Inference Attacks on Large-Scale Models: A Survey
- 2024Underestimated Privacy Risks for Minority Populations in Large Language Model Unlearning