arXiv:2510.14459cs.LGcs.AI2025-10被引 1

用上下文模拟损失,高效筛选大模型微调中的优质数据

Holdout-Loss-Based Data Selection for LLM Finetuning via In-Context Learning

  • 通过上下文提示估算样本的潜在损失,无需额外训练
  • 在多种微调方法中提升对齐效果,且计算开销极低
  • 适合需要高质量数据但资源有限的研究者使用

微调大型预训练语言模型是使其符合人类偏好的常用方法,但噪声或偏离目标的样本会削弱监督信号。尽管小而精选的数据集常能达到远大于其规模的数据集的效果,但系统且高效的高质量数据识别方法仍缺乏探索。现有方法多依赖启发式规则或昂贵的重新训练。本文提出一种原理清晰、资源高效的數據选择与重加权框架。核心是上下文近似(ICA),通过在上下文中小规模精炼的保留集来估计模型在训练某个候选样本后可能产生的保留损失。ICA无需参考模型,也无需额外微调。我们定义该估计值为ICA分数,并推导出随模型参数演变动态调整梯度更新的样本权重。在SFT、DPO和SimPO等多种方法及多种骨干模型与数据集上,基于ICA的重加权始终显著提升模型对齐性能,且开销极小。我们分析了分数更新频率和上下文保留样本数量的敏感性。同时指出在快速变化的在线策略设置下的局限性,为未来工作提供方向。代码与提示将公开。

原文摘要 · Abstract (English)

Fine-tuning large pretrained language models is a common approach for aligning them with human preferences, but noisy or off-target examples can dilute supervision. While small, well-chosen datasets often match the performance of much larger ones, systematic and efficient ways to identify high-value training data remain underexplored. Many current methods rely on heuristics or expensive retraining. We present a principled, resource-efficient framework for data selection and reweighting. At its core is an In-Context Approximation (ICA) that estimates the holdout loss a model would incur after training on a candidate example by conditioning on a small, curated holdout set in context. ICA requires no reference model and no additional finetuning. We define the resulting estimate as the ICA score, and derive per-example weights that dynamically reweight gradient updates as model parameters evolve. Across SFT, DPO, and SimPO, and over diverse backbones and datasets, ICA-based reweighting consistently improves model alignment with minimal overhead. We analyze sensitivity to score update frequency and the number of in-context holdout examples. We also discuss limitations in rapidly drifting on-policy settings, highlighting directions for future work. Code and prompts will be released.

大模型微调数据筛选上下文学习损失估计

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。