微调者的谬误:何时应使用微调数据进行预训练
The Finetuner's Fallacy: When to Pretrain with Your Finetuning Data
AI总结:
本文研究了一种简单策略,即专门预训练(SPT),通过在预训练阶段重复使用小领域数据集,以提升领域性能并保留通用能力。实验显示,SPT能减少预训练token数量,提升领域表现,同时降低过拟合风险。
摘要:
现实中的模型部署需要在数据稀缺的狭窄领域中表现出色。通常,从业者会通过微调来专门化模型,但这可能导致过拟合领域并遗忘通用知识。我们研究了一种简单策略,即专门预训练(SPT),其中一个小领域数据集通常用于微调,会被重复使用,从预训练开始作为总token数的分数。在三个专门领域(ChemPile、MusicPile和ProofPile)中,SPT在微调后比标准预训练提高了领域性能并保留了通用能力。在我们的实验中,SPT将达到给定领域性能所需的预训练token数量减少了高达1.75倍。这些收益在目标领域在预训练语料库中代表性不足时增长:在远离网络文本的领域,一个1B SPT模型在性能上优于3B标准预训练模型。除了这些经验性收益,我们还推导出过拟合扩展定律,以指导从业者在给定预训练计算预算下选择最优的领域数据重复率。我们的观察揭示了微调者的谬误:虽然微调可能看起来是领域适应的最便宜途径,但在预训练中引入专门的领域数据会延长其效用。SPT在减少过拟合(通过减少重复暴露中的过拟合)和保留通用领域性能(通过减少微调中的遗忘)方面表现更好,最终在参数数量和总计算量上实现更强的结果。为了充分利用领域数据,应尽可能早地将其纳入训练过程中。
英文摘要:
Real-world model deployments demand strong performance on narrow domains where data is often scarce. Typically, practitioners finetune models to specialize them, but this risks overfitting to the domain and forgetting general knowledge. We study a simple strategy, specialized pretraining (SPT), where a small domain dataset, typically reserved for finetuning, is repeated starting from pretraining as a fraction of the total tokens. Across three specialized domains (ChemPile, MusicPile, and ProofPile), SPT improves domain performance and preserves general capabilities after finetuning compared to standard pretraining. In our experiments, SPT reduces the pretraining tokens needed to reach a given domain performance by up to 1.75x. These gains grow when the target domain is underrepresented in the pretraining corpus: on domains far from web text, a 1B SPT model outperforms a 3B standard pretrained model. Beyond these empirical gains, we derive overfitting scaling laws to guide practitioners in selecting the optimal domain-data repetition for a given pretraining compute budget. Our observations reveal the finetuner's fallacy: while finetuning may appear to be the cheapest path to domain adaptation, introducing specialized domain data during pretraining stretches its utility. SPT yields better specialized domain performance (via reduced overfitting across repeated exposures) and better general domain performance (via reduced forgetting during finetuning), ultimately achieving stronger results with fewer parameters and less total compute when amortized over inference. To get the most out of domain data, incorporate it as early in training as possible.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。