arXiv:2502.11525cs.CL2025-02NeurIPS被引 6

首个支持多任务长文本泛化的LLM训练框架,实现一次训练跨任务泛化。

Beyond Single-Task: Robust Multi-Task Length Generalization for LLMs

  • 构建包含86个任务的长文本泛化数据集,覆盖代码执行与逻辑推理等场景。
  • 在仅微调1-5位加法后,32B模型对30位加法达95%准确率,超越顶尖模型。
  • 无需为每任务重训,适合实际大模型后训练阶段应用。

长度泛化——即解决训练中未见长度问题的能力——仍是大型语言模型(LLMs)的关键挑战。先前工作通过修改位置编码和数据格式来提升特定符号任务(如加法、排序)的长度泛化性能,但这些方法局限于特定任务,常损害通用语言能力,且多在小规模Transformer上评估,难以应用于具备通用能力的实际大模型后训练阶段。Hu等(2024)提出规则遵循微调(RFFT),可在后训练阶段改善长度泛化,但仅适用于单任务,需为每任务重新训练并消耗大量示例。本文研究多任务设置下的长度泛化,提出首个实现鲁棒跨任务长度泛化的框架——元规则遵循微调(Meta-RFFT)。首先,我们构建一个包含86个任务的大规模长度泛化数据集,涵盖代码执行、数值处理、符号与逻辑推理任务,超出常见加法或乘法任务。其次,我们证明了跨任务长度泛化在Meta-RFFT下是可行的:在大量任务和实例上训练后,模型仅需极少微调或零样本提示即可在未见任务上表现优异。例如,32B模型经1至5位加法微调后,在30位加法任务上达到95%准确率,显著优于当前最先进模型(DeepSeek-R1-671B:72%),尽管该任务从未在预训练阶段出现。

原文摘要 · Abstract (English)

Length generalization, the ability to solve problems longer than those seen during training, remains a critical challenge for large language models (LLMs). Previous work modifies positional encodings (PEs) and data formats to improve length generalization on specific symbolic tasks such as addition and sorting. However, these approaches are fundamentally limited to special tasks, often degrading general language performance. Furthermore, they are typically evaluated on small transformers trained from scratch on single tasks and can cause performance drop when applied during post-training stage of practical LLMs with general capabilities. Hu et al., (2024) proposed Rule-Following Fine-Tuning (RFFT) to improve length generalization in the post-training stage of LLMs. Despite its compatibility with practical models and strong performance, RFFT is proposed for single tasks too, requiring re-training for each individual task with extensive examples. In this paper, we study length generalization in multi-task settings and propose Meta Rule-Following Fine-Tuning (Meta-RFFT), the first framework enabling robust cross-task length generalization. As our first contribution, we construct a large length generalization dataset containing 86 tasks spanning code execution, number processing, symbolic and logical reasoning tasks, beyond the common addition or multiplication tasks. Secondly, we show that cross-task length generalization is possible with Meta-RFFT. After training on a large number of tasks and instances, the models achieve remarkable length generalization ability on unseen tasks with minimal fine-tuning or one-shot prompting. For example, after fine-tuning on 1 to 5 digit addition, our 32B model achieves 95% accuracy on 30 digit addition, significantly outperforming the state-of-the-art reasoning models (DeepSeek-R1-671B: 72%), despite never seeing this task during RF-pretraining.

多任务学习长度泛化大模型微调元学习

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