在线微调中动态选数据并加权,提升大模型训练效率
Filter-then-Weight: Online Data Selection and Reweighting for LLM Fine-Tuning
- 根据优化器状态动态筛选有用样本,避免静态排序偏差
- 在相同数据量下,收敛更快,下游任务性能提升显著
- 适合持续学习、数据流场景,尤其对长文本更高效
基于梯度的数据选择为大语言模型微调提供了合理的样本效用估计框架,但现有方法多针对离线设置,难以适应数据按序到达的在线微调场景。在线场景中,样本效用随训练步骤变化,且自适应优化器影响有效更新几何结构。本文提出一种考虑优化器状态的在线数据选择与重加权框架,将在线选择视为在当前优化器状态下生成目标导向更新的过程。通过建立该问题与二阶目标效用的关系,证明子集构建必须考虑样本间的相互作用与冗余性。据此设计两阶段算法 Filter-then-Weight:先几何筛选候选样本,再优化其权重系数。为适配大模型,引入分解外积梯度表示和优化矩阵计算,以处理长上下文数据。实验表明,在相同数据预算下,本方法在多个任务上均优于现有在线数据选择基线,实现更快收敛与更好性能。
原文摘要 · Abstract (English)
Gradient-based data selection offers a principled framework for estimating sample utility in large language model (LLM) fine-tuning, but existing methods are mostly designed for offline settings. They are therefore less suited to online fine-tuning, where data arrives sequentially, sample utility is step-dependent, and the effective update geometry is shaped by adaptive optimizers. We propose an optimizer-aware framework for gradient-based online data selection and reweighting in LLM fine-tuning. Our key idea is to view online selection not as static sample ranking, but as shaping the next target-oriented update under the current optimizer state. We formulate this as an optimizer-aware update-matching problem, establish its connection to second-order target utility, and show why subset-level construction must account for interactions and redundancy among selected samples. Based on this view, we develop a two-stage Filter-then-Weight algorithm that first filters geometrically useful candidates and then optimizes their coefficients. To make the framework practical for LLMs, we introduce a factorized outer-product gradient representation and optimized matrix computations for long-context data. Experiments show that our method consistently improves convergence and downstream performance over existing online data selection baselines under the same data budget.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。