通过重要性重采样进行语言模型的数据选择
Data Selection for Language Models via Importance Resampling
AI总结:
提出DSIR框架,通过哈希n-gram特征估计重要性权重并重采样,高效匹配目标数据分布,在GLUE基准上比基线提升2-2.5%。
摘要:
选择合适的预训练数据集对于通用领域(如GPT-3)和特定领域(如Codex)语言模型(LMs)都至关重要。我们将这个问题形式化为:在给定无标签目标样本的情况下,从大型原始无标签数据集中选择一个子集,以匹配期望的目标分布。由于原始文本数据的规模和高维特性,现有方法使用简单的启发式方法或需要人类专家手动整理数据。相反,我们将低维中使用的经典重要性重采样方法扩展用于LM数据选择。我们提出了Data Selection with Importance Resampling(DSIR),这是一个高效且可扩展的框架,它在缩减的特征空间中估计重要性权重以提高可处理性,并根据这些权重通过重要性重采样来选择数据。我们使用哈希n-gram特征实例化DSIR框架以提高效率,从而能够在4.5小时内从完整的Pile数据集中选择100M文档。为了衡量哈希n-gram特征是否保留了与目标相关的数据方面,我们定义了KL reduction,这是一种数据指标,用于衡量在某些特征空间中选定的预训练数据与目标之间的接近程度。在8种数据选择方法(包括专家选择)中,哈希n-gram特征上的KL reduction与平均下游准确率高度相关(r=0.82)。在为特定领域的持续预训练选择数据时,DSIR在8个目标分布上的表现与专家整理相当。在预训练通用领域模型(目标为Wikipedia和books)时,DSIR在GLUE基准上比随机选择和启发式过滤基线提高了2-2.5%。代码可在https://github.com/p-lambda/dsir获取。
英文摘要:
Selecting a suitable pretraining dataset is crucial for both general-domain (e.g., GPT-3) and domain-specific (e.g., Codex) language models (LMs). We formalize this problem as selecting a subset of a large raw unlabeled dataset to match a desired target distribution given unlabeled target samples. Due to the scale and dimensionality of the raw text data, existing methods use simple heuristics or require human experts to manually curate data. Instead, we extend the classic importance resampling approach used in low-dimensions for LM data selection. We propose Data Selection with Importance Resampling (DSIR), an efficient and scalable framework that estimates importance weights in a reduced feature space for tractability and selects data with importance resampling according to these weights. We instantiate the DSIR framework with hashed n-gram features for efficiency, enabling the selection of 100M documents from the full Pile dataset in 4.5 hours. To measure whether hashed n-gram features preserve the aspects of the data that are relevant to the target, we define KL reduction, a data metric that measures the proximity between the selected pretraining data and the target on some feature space. Across 8 data selection methods (including expert selection), KL reduction on hashed n-gram features highly correlates with average downstream accuracy (r=0.82). When selecting data for continued pretraining on a specific domain, DSIR performs comparably to expert curation across 8 target distributions. When pretraining general-domain models (target is Wikipedia and books), DSIR improves over random selection and heuristic filtering baselines by 2-2.5% on the GLUE benchmark. Code is available at https://github.com/p-lambda/dsir.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。