Deduplicating Training Data Makes Language Models Better
Katherine Lee †、Daphne Ippolito †‡、Andrew Nystrom†、Chiyuan Zhang† \ANDDouglas Eck†、Chris Callison-Burch‡、Nicholas Carlini† Equal contribution. † Google Research, Brain Team. ‡ University of Pennsylvania. Correspond to and
Abstract
We find that existing language modeling datasets contain many near-duplicate examples and long repetitive substrings. As a result, over $1\%$ of the unprompted output of language models trained on these datasets is copied verbatim from the training data. We develop two tools that allow us to deduplicate training datasets—for example removing from C4 a single 61 word English sentence that is repeated over $60{,}000$ times. Deduplication allows us to train models that emit memorized text ten times less frequently and require fewer training steps to achieve the same or better accuracy. We can also reduce train-test overlap, which affects over $4\%$ of the validation set of standard datasets, thus allowing for more accurate evaluation. Code for deduplication is released at https://github.com/google-research/deduplicate-text-datasets.
中文速览
大规模语言模型的训练数据集中普遍存在大量重复文本,这直接导致模型"背书"——超过1%的模型自发生成内容是从训练集原文逐字复制出来的,还会造成训练集与验证集之间的数据污染,使模型评估结果虚高。研究者提出了两种可扩展的去重工具:基于后缀数组(suffix array)的精确子串匹配,以及基于MinHash的近似文档匹配,前者能在线性时间内找出跨样本重复的文本片段,后者则识别高度相似但非完全一致的文档。将这两种方法应用于C4、Wiki-40B等主流数据集后,数据集体积最多缩减19%,模型输出记忆内容的频率降低了10倍,验证集上超过4%的样本与训练集的重叠问题也得到显著改善,同时模型困惑度(perplexity)不升反降,最多改善10%。这项工作表明,训练数据去重既能提升模型质量与评估可靠性,又能降低训练成本,对大模型研究的数据治理实践具有重要参考价值。
原文 arXiv:2107.06499;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2107.06499v2