DICE: Detecting In-distribution Contamination in LLM's Fine-tuning Phase for Math Reasoning
作者: Shangqing Tu, Kejian Zhu, Yushi Bai, Zijun Yao, Lei Hou, Juanzi Li
分类: cs.CL
发布日期: 2024-06-06 (更新: 2024-09-22)
备注: 13 pages, 7 figures
🔗 代码/项目: GITHUB
💡 一句话要点
提出DICE以检测大语言模型微调阶段的数据污染问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 数据污染 大型语言模型 微调 数学推理 性能评估 机器学习 分类器
📋 核心要点
- 现有方法主要关注模型是否见过相同的数据,未能有效检测相似数据导致的分布内污染。
- DICE通过识别对污染敏感的层,并基于该层的内部状态训练分类器,提供了一种新的检测方法。
- 实验结果显示,DICE在多个LLMs和数学推理数据集上具有高准确性,并能有效检测不同基准的污染。
📝 摘要(中文)
大型语言模型(LLMs)的进步依赖于公共基准的评估,但数据污染可能导致性能被高估。以往研究主要集中在检测模型是否见过相同的数据,而本研究指出,即使在与基准数据相似的数据上训练,也会导致性能膨胀,即所谓的“分布内污染”。本文提出DICE,一种利用LLMs内部状态来定位和检测污染的新方法。DICE首先识别对污染最敏感的层,然后基于该层的内部状态训练分类器。实验表明,DICE在检测不同LLMs和数学推理数据集中的分布内污染方面具有高准确性,并且其预测与LLMs的微调性能相关,决定系数($R^2$)在0.61到0.75之间。
🔬 方法详解
问题定义:本文旨在解决大型语言模型微调阶段的分布内污染检测问题。现有方法主要关注模型是否见过相同的数据,未能有效识别相似数据导致的性能膨胀现象。
核心思路:DICE的核心思路是利用LLMs的内部状态,首先识别出对污染最敏感的层,然后基于该层的状态训练分类器,以实现高效的污染检测。这样的设计能够更精准地捕捉到污染的影响。
技术框架:DICE的整体架构包括两个主要阶段:第一阶段是识别敏感层,第二阶段是基于该层的内部状态训练分类器。通过这种分阶段的方法,DICE能够有效地定位和检测污染。
关键创新:DICE的最大创新在于其利用LLMs内部状态进行污染检测的方式,与传统方法相比,能够更全面地考虑数据的相似性对模型性能的影响。
关键设计:DICE在参数设置上进行了优化,使用特定的损失函数来提高分类器的准确性,并设计了适合于LLMs的网络结构,以确保检测的有效性和可靠性。
🖼️ 关键图片
📊 实验亮点
实验结果显示,DICE在检测分布内污染方面表现出色,准确率高达多个基准数据集,且其预测与微调性能之间的决定系数($R^2$)在0.61到0.75之间,表明DICE具有良好的泛化能力和实用性。
🎯 应用场景
该研究的潜在应用领域包括大型语言模型的开发和评估,尤其是在需要高准确性和可靠性的数学推理任务中。DICE能够帮助研究人员和开发者识别和减少数据污染的影响,从而提升模型的真实性能和可信度。未来,DICE的技术可以扩展到其他类型的机器学习模型和任务中,具有广泛的应用价值。
📄 摘要(原文)
The advancement of large language models (LLMs) relies on evaluation using public benchmarks, but data contamination can lead to overestimated performance. Previous researches focus on detecting contamination by determining whether the model has seen the exact same data during training. Besides, prior work has already shown that even training on data similar to benchmark data inflates performance, namely \emph{In-distribution contamination}. In this work, we argue that in-distribution contamination can lead to the performance drop on OOD benchmarks. To effectively detect in-distribution contamination, we propose DICE, a novel method that leverages the internal states of LLMs to locate-then-detect the contamination. DICE first identifies the most sensitive layer to contamination, then trains a classifier based on the internal states of that layer. Experiments reveal DICE's high accuracy in detecting in-distribution contamination across various LLMs and math reasoning datasets. We also show the generalization capability of the trained DICE detector, which is able to detect contamination across multiple benchmarks with similar distributions. Additionally, we find that DICE's predictions correlate with the performance of LLMs fine-tuned by either us or other organizations, achieving a coefficient of determination ($R^2$) between 0.61 and 0.75. The code and data are available at https://github.com/THU-KEG/DICE.