学习还是记忆?量化代码大语言模型中的记忆优势
Learned or Memorized ? Quantifying Memorization Advantage in Code LLMs
AI总结:
本文通过扰动方法量化代码LLM的记忆优势,评估8个开源代码LLM在19个基准测试中的表现,发现任务和模型差异显著,部分基准测试显示低敏感度,挑战了数据泄露的常见担忧。
摘要:
大型语言模型(LLMs)训练所用代码数据集的透明度不足,使得检测、评估和缓解数据泄露变得困难。本文提出了一种基于扰动的方法,用于量化代码LLM中的记忆优势,即在可能看到和未看到输入之间的性能差距。我们评估了8个开源代码LLM在19个基准测试中的表现,涵盖代码生成、代码理解、漏洞检测和bug修复四个任务类别。敏感性模式在模型和任务之间变化很大。例如,StarCoder在某些基准测试中达到高敏感度(高达0.8),而QwenCoder则较低(大多低于0.4),表明泛化行为的差异。任务类别也不同:代码摘要倾向于显示低敏感度,而测试生成则显著更高。我们随后分析了两个广受讨论的基准测试,CVEFixes和Defects4J,通常被认为存在泄露问题。与常见担忧相反,这两个基准测试在所有模型中显示低记忆优势:CVEFixes始终保持在0.1以下,Defects4J低于其他程序修复基准。这些结果表明,对于这些数据集,模型可能更多依赖于学习的泛化而非直接记忆。总体而言,我们的发现提供了记忆风险高度依赖于任务和模型的证据,并强调了在安全导向设置中需要更强的评估协议的必要性。
英文摘要:
The lack of transparency about code datasets used to train large language models (LLMs) makes it difficult to detect, evaluate, and mitigate data leakage. We present a perturbation-based method to quantify memorization advantage in code LLMs, defined as the performance gap between likely seen and unseen inputs. We evaluate 8 open-source code LLMs on 19 benchmarks across four task families: code generation, code understanding, vulnerability detection, and bug fixing. Sensitivity patterns vary widely across models and tasks. For example, StarCoder reaches high sensitivity on some benchmarks (up to 0.8), while QwenCoder remains lower (mostly below 0.4), suggesting differences in generalization behavior. Task categories also differ: code summarization tends to show low sensitivity, whereas test generation is substantially higher. We then analyze two widely discussed benchmarks, CVEFixes and Defects4J, often suspected of leakage. Contrary to common concerns, both show low memorization advantage across models: CVEFixes remains below 0.1, and Defects4J is lower than other program repair benchmarks. These results suggest that, for these datasets, models may rely more on learned generalization than direct memorization. Overall, our findings provide evidence that memorization risk is highly task- and model-dependent, and highlight the need for stronger evaluation protocols, especially in security-focused settings.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。