LongPO: 大規模言語モデルの長文脈自己進化を実現するための短文から長文への選好最適化
LongPO: Long Context Self-Evolution of Large Language Models through Short-to-Long Preference Optimization
February 19, 2025
著者: Guanzheng Chen, Xin Li, Michael Qizhe Shieh, Lidong Bing
cs.AI
要旨
大規模言語モデル(LLMs)は、事前学習とアラインメントを通じて顕著な能力を発揮してきた。しかし、短いコンテキストにおいて優れた性能を示すLLMsは、長いコンテキストのシナリオでは十分な長文アラインメントが不足しているため、性能が低下する可能性がある。このアラインメントプロセスは、長いコンテキストに対する人間のアノテーションが非現実的であることや、短いコンテキストと長いコンテキストの性能のバランスを取ることが難しいことから、依然として課題となっている。これらの課題に対処するため、我々はLongPOを提案する。LongPOは、短いコンテキストのLLMsが内部で短いコンテキストの能力を転移させることで、長いコンテキストのタスクにおいて優れた性能を発揮するように自己進化することを可能にする。LongPOは、LLMsが自己生成した短いコンテキストから長いコンテキストへの選好データから学習することを活用する。この選好データは、同じ指示に対して長いコンテキストの入力とその圧縮された短いコンテキストの入力に対して生成された応答のペアで構成される。この選好は、短いコンテキストのアラインメント中に培われたLLMsの能力と潜在能力を示し、アラインメントが不十分な長いコンテキストのシナリオではその能力が低下する可能性があることを明らかにする。さらに、LongPOは、長いコンテキストのアラインメント中に短いコンテキストの性能が低下するのを防ぐために、短いコンテキストから長いコンテキストへのKL制約を組み込んでいる。Mistral-7B-Instruct-v0.2に128Kから512Kのコンテキスト長で適用した場合、LongPOは短いコンテキストの性能を完全に保持し、長いコンテキストと短いコンテキストの両方のタスクにおいて、単純なSFTやDPOを大きく上回る性能を示す。具体的には、\ourMethodでトレーニングされたモデルは、広範な長文アラインメントとより大きなパラメータスケールを必要とする優れたLLMs(例:GPT-4-128K)と同等かそれ以上の結果を長文ベンチマークで達成することができる。
English
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.Summary
AI-Generated Summary