arXiv:2502.15592cs.CLcs.AI2025-02被引 8

用合成数据让短上下文模型学会处理长文档,效果接近人工标注。

Generalizing From Short to Long: Effective Data Synthesis for Long-Context Instruction Tuning

  • 用现成大模型生成扩展背景,自动构造高质量长上下文指令数据
  • 短上下文训练模型可有效泛化到更长输入,提升效率
  • 适合做长文本理解、文档推理任务的研究与应用

长上下文建模是大语言模型的重要研究方向,因实际应用常需处理长文档。现有研究多关注位置建模,对指令微调等关键环节关注不足。长上下文训练数据难产且成本高。本文针对长上下文预训练模型的后训练阶段,探究了最优指令数据所需上下文长度、类型及复杂度。控制实验发现,短上下文指令微调的模型能有效泛化至更长输入,同时识别出指令难度与上下文构成的关键影响。基于此,提出一种新的数据合成框架——上下文合成(context synthesis),利用现成LLM生成高质量指令-答案对的扩展背景。在LongBench文档级基准测试中,该方法优于已有合成方法,性能接近人工标注数据。项目代码已开源:https://github.com/NJUNLP/context-synthesis。

原文摘要 · Abstract (English)

Long-context modelling for large language models (LLMs) has been a key area of recent research because many real world use cases require reasoning over longer inputs such as documents. The focus of research into modelling long context has been on how to model position and there has been little investigation into other important aspects of language modelling such as instruction tuning. Long context training examples are challenging and expensive to create and use. In this paper, we investigate how to design instruction data for the post-training phase of a long context pre-trained model: how much and what type of context is needed for optimal and efficient post-training. Our controlled study reveals that models instruction-tuned on short contexts can effectively generalize to longer ones, while also identifying other critical factors such as instruction difficulty and context composition. Based on these findings, we propose context synthesis, a novel data synthesis framework that leverages off-the-shelf LLMs to generate extended background contexts for high-quality instruction-answer pairs. Experiment results on the document-level benchmark (LongBench) demonstrate that our proposed approach outperforms previous instruction synthesis approaches and comes close to the performance of human-annotated long-context instruction data. The project will be available at: https://github.com/NJUNLP/context-synthesis.

长上下文指令微调数据合成LLM

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