2025-02-20 · 专家 · 自然语言处理 · 机器学习

LongPO: Long Context Self-Evolution of Large Language Models through Short-to-Long Preference Optimization

LongPO通过短到长偏好优化,使大型语言模型能够在长上下文中自我进化,同时保持其在短上下文中的性能。

更新于 2025-02-20。作者:Guanzheng Chen、Xin Li、Michael Qizhe Shieh、Lidong Bing。

中文摘要

大型语言模型(LLMs)通过预训练和对齐展现了卓越的能力。然而,由于长上下文对齐不足,卓越的短上下文LLMs可能在长上下文场景中表现不佳。由于人类对长上下文的标注不切实际以及平衡短上下文和长上下文性能的难度,这种对齐过程仍然具有挑战性。为了应对这些挑战,我们提出了LongPO,它使短上下文LLMs能够通过内部迁移短上下文能力自我进化,以在长上下文任务上表现出色。LongPO利用LLMs学习自生成的短至长偏好数据,包括为相同指令生成的具有长上下文输入及其对应的压缩短上下文配对响应。这种偏好揭示了LLMs在短上下文对齐过程中培养出的能力和潜力,这些能力和潜力在长上下文对齐不足的场景中可能会减弱。此外,LongPO还包含一个短至长的KL约束,以减轻长上下文对齐期间短上下文性能的下降。当将Mistral-7B-Instruct-v0.2从128K上下文长度扩展到512K时,LongPO完全保留了短上下文性能,并在长上下文和短上下文任务中都大幅超越了简单的SFT和DPO。具体来说,我们的方法训练的模型在长上下文基准测试中可以达到的结果与,甚至超越那些涉及广泛长上下文标注和更大参数规模的顶级LLMs(如GPT-4-128K)相当。

英文摘要

Large Language Models (LLMs) have demonstrated remarkable capabilities through pretraining and alignment. However, superior short-context LLMs may underperform in long-context scenarios due to insufficient long-context alignment. This alignment process remains challenging due to the impracticality of human annotation for extended contexts and the difficulty in balancing short- and long-context performance. To address these challenges, we introduce LongPO, that enables short-context LLMs to self-evolve to excel on long-context tasks by internally transferring short-context capabilities. LongPO harnesses LLMs to learn from self-generated short-to-long preference data, comprising paired responses generated for identical instructions with long-context inputs and their compressed short-context counterparts, respectively. This preference reveals capabilities and potentials of LLMs cultivated during short-context alignment that may be diminished in under-aligned long-context scenarios. Additionally, LongPO incorporates a short-to-long KL constraint to mitigate short-context performance decline during long-context alignment. When applied to Mistral-7B-Instruct-v0.2 from 128K to 512K context lengths, LongPO fully retains short-context performance and largely outperforms naive SFT and DPO in both long- and short-context tasks. Specifically, \ourMethod-trained models can achieve results on long-context benchmarks comparable to, or even surpassing, those of superior LLMs (e.g., GPT-4-128K) that involve extensive long-context annotation and larger parameter scales.

解读

一句话总结

LongPO通过短到长偏好优化,使大型语言模型能够在长上下文中自我进化,同时保持其在短上下文中的性能。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt