用嵌入空间的杠杆分数动态调整数据混合比例,提升大模型训练效率。
Chameleon: A Flexible Data-mixing Framework for Language Model Pretraining and Finetuning
- 基于领域嵌入计算杠杆分数,自动识别重要领域
- 仅需计算新领域嵌入即可适配新数据,无需重训
- 在预训练和微调中均提升性能,适合快速迭代场景
训练数据混合方式显著影响大语言模型的泛化能力。现有领域重加权方法通常依赖高成本权重计算,且引入新数据时需重新训练。为此,我们提出灵活高效的框架Chameleon,通过学习到的嵌入空间中的杠杆分数量化领域重要性。首先构建领域嵌入间的领域亲和矩阵,诱导出的杠杆分数决定混合比例,优先加权嵌入空间中具有共同表示的领域。该形式可直接迁移至新数据,仅需计算新领域嵌入。实验表明,在三个关键场景中均取得改进:(i) 所得权重在预训练领域上提升性能,计算量仅为现有方法的几分之一;(ii) Chameleon可无需代理重训即适应数据变化,在迁移到新数据时提升少样本推理准确率;(iii) 该方法实现高效微调阶段领域重加权,在所有微调领域上一致降低测试困惑度。代码已开源。
原文摘要 · Abstract (English)
Training data mixtures greatly impact the generalization performance of large language models. Existing domain reweighting methods often rely on costly weight computations and require retraining when new data is introduced. To this end, we introduce a flexible and efficient data mixing framework, Chameleon, that employs leverage scores to quantify domain importance within a learned embedding space. We first construct a domain affinity matrix over domain embeddings. The induced leverage scores determine a mixture that upweights domains sharing common representations in embedding space. This formulation allows direct transfer to new data by computing the new domain embeddings. In experiments, we demonstrate improvements over three key scenarios: (i) our computed weights improve performance on pretraining domains with a fraction of the compute of existing methods; (ii) Chameleon can adapt to data changes without proxy retraining, boosting few-shot reasoning accuracies when transferred to new data; (iii) our method enables efficient domain reweighting in finetuning, consistently improving test perplexity on all finetuning domains over uniform mixture. Our code is available at https://github.com/LIONS-EPFL/Chameleon.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。