研究微调大模型如何记忆训练数据,揭示隐私风险与性能的权衡。
Memorization in Fine-Tuned Large Language Models
- 通过成员推理攻击和生成测试,分析不同参数对记忆的影响。
- 输出与值矩阵更易导致记忆,困惑度越低记忆越强。
- LoRA秩越高记忆越多,但收益递减,适合关注隐私的开发者。
本研究探究微调大语言模型(LLMs)中记忆化的机制与影响因素,聚焦医疗领域这一敏感隐私场景。基于药物警戒事件数据集PHEE,采用成员推理攻击检测记忆数据,并通过提示前缀生成任务评估原文复现情况。分析了Transformer架构中不同权重矩阵的适应性、困惑度与记忆之间的关系,以及低秩适应(LoRA)微调中秩增加的影响。关键发现包括:(1) 值矩阵与输出矩阵比查询和键矩阵更显著促进记忆;(2) 微调后模型困惑度越低,记忆倾向越强;(3) 较高LoRA秩会增加记忆,但收益随秩升高而递减。研究揭示了模型性能与隐私风险间的权衡,为负责任地微调大模型提供依据。
原文摘要 · Abstract (English)
This study investigates the mechanisms and factors influencing memorization in fine-tuned large language models (LLMs), with a focus on the medical domain due to its privacy-sensitive nature. We examine how different aspects of the fine-tuning process affect a model's propensity to memorize training data, using the PHEE dataset of pharmacovigilance events. Our research employs two main approaches: a membership inference attack to detect memorized data, and a generation task with prompted prefixes to assess verbatim reproduction. We analyze the impact of adapting different weight matrices in the transformer architecture, the relationship between perplexity and memorization, and the effect of increasing the rank in low-rank adaptation (LoRA) fine-tuning. Key findings include: (1) Value and Output matrices contribute more significantly to memorization compared to Query and Key matrices; (2) Lower perplexity in the fine-tuned model correlates with increased memorization; (3) Higher LoRA ranks lead to increased memorization, but with diminishing returns at higher ranks. These results provide insights into the trade-offs between model performance and privacy risks in fine-tuned LLMs. Our findings have implications for developing more effective and responsible strategies for adapting large language models while managing data privacy concerns.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。