通过离线筛选与在线自修正生成,提升大模型微调数据质量。
Bilevel Data Curation for LLM Fine-tuning: Offline Selection and Online Self-Refining Generation
- 离线用双层优化筛选高质量问答对,提升验证性能。
- 在线自修正生成恢复被丢弃的有害问题,保持多样性。
- 提出响应级加权方法,自动适配重生成内容,效果更优。
监督微调(SFT)数据集对大语言模型下游性能至关重要,但常包含低质量或有害的问答对。本文提出统一的双层框架,结合离线数据筛选与在线自修正生成。离线阶段,双层数据筛选(BDS)从原始SFT数据集中选择问答对以最大化验证性能。理论上证明,BDS所得最优模型优于直接混合数据的方法,在有效数据覆盖上表现更优。同时,针对梯度法的单层Transformer BDS,给出全局收敛性分析,证明ε-全局最优解可在有限时间内达到。尽管高效,离线BDS会连同有害问题一并丢弃,降低问题多样性。为此,引入在线自修正生成框架,对选定问题重新生成响应。然而,当响应在线重生成时,BDS难以更新响应权重。为此,提出双层多目标优化(BMO),其可恢复与BDS一致的验证对齐解,并提供闭式重要性权重,能自适应新生成响应。在大模型质量提升与安全微调实验中,该框架持续提升数据质量与下游微调性能。
原文摘要 · Abstract (English)
Supervised fine-tuning (SFT) datasets are critical to the downstream performance of large language models, yet they often contain low-quality or harmful question-response pairs. To improve SFT data quality, we develop a unified bilevel framework that combines offline data selection with the online self-refining generation. In the offline setting, bilevel data selection (BDS) selects question-response pairs from the offline SFT dataset to maximize the validation performance. We theoretically show that the optimal model given by BDS outperforms direct data mixing approach in useful data coverage. Moreover, we provide a global convergence analysis for gradient-based BDS approach for one-layer Transformer, showing that the epsilon-global optimum of offline BDS is achievable in finite time. Although efficient, offline BDS discards potentially harmful questions together with responses, thereby reducing question diversity. We address this limitation by refining the responses to selected questions using online self-refining generation framework. However, BDS is inefficient to update the response weights when responses are regenerated online. To address this issue, we introduce bilevel multi-objective optimization (BMO) for response-level weighting. We show that BMO recovers the same validation-aligned solution as BDS, but admits a closed-form importance-ratio weight that adapts to regenerated responses. Experiments on LLM quality enhancement and safety-aware fine-tuning demonstrate that the proposed framework consistently improves both data quality and downstream fine-tuning performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。