ChatPaper.aiChatPaper

LongWriter: 長文脈LLMによる10,000語以上の生成を実現

LongWriter: Unleashing 10,000+ Word Generation from Long Context LLMs

August 13, 2024
著者: Yushi Bai, Jiajie Zhang, Xin Lv, Linzhi Zheng, Siqi Zhu, Lei Hou, Yuxiao Dong, Jie Tang, Juanzi Li
cs.AI

要旨

現在の長文脈対応大規模言語モデル(LLM)は最大10万トークンの入力を処理できますが、2,000語という控えめな長さの出力を超える生成には苦戦しています。制御実験を通じて、モデルの有効な生成長は、教師ありファインチューニング(SFT)中に見たサンプルによって本質的に制限されていることがわかりました。言い換えれば、既存のSFTデータセットにおける長い出力の例の不足が、出力制限の原因となっています。この問題に対処するため、我々はAgentWriteを導入しました。これは、超長文生成タスクをサブタスクに分解し、既存のLLMが20,000語を超える一貫性のある出力を生成できるようにするエージェントベースのパイプラインです。AgentWriteを活用して、出力長が2,000語から32,000語までの6,000件のSFTデータを含むLongWriter-6kデータセットを構築しました。このデータセットをモデルトレーニングに組み込むことで、既存モデルの出力長を10,000語以上に拡張しつつ、出力品質を維持することに成功しました。また、超長文生成能力を評価するための包括的なベンチマークであるLongBench-Writeを開発しました。DPOを通じてさらに改善された9Bパラメータモデルは、このベンチマークにおいて最先端の性能を達成し、はるかに大規模なプロプライエタリモデルさえも凌駕しました。一般的に、我々の研究は、既存の長文脈LLMが既により大きな出力ウィンドウの可能性を秘めていることを示しています。モデルアラインメント中に拡張された出力を持つデータがあれば、この能力を引き出すことができるのです。我々のコードとモデルは、https://github.com/THUDM/LongWriter にあります。
English
Current long context large language models (LLMs) can process inputs up to 100,000 tokens, yet struggle to generate outputs exceeding even a modest length of 2,000 words. Through controlled experiments, we find that the model's effective generation length is inherently bounded by the sample it has seen during supervised fine-tuning (SFT). In other words, their output limitation is due to the scarcity of long-output examples in existing SFT datasets. To address this, we introduce AgentWrite, an agent-based pipeline that decomposes ultra-long generation tasks into subtasks, enabling off-the-shelf LLMs to generate coherent outputs exceeding 20,000 words. Leveraging AgentWrite, we construct LongWriter-6k, a dataset containing 6,000 SFT data with output lengths ranging from 2k to 32k words. By incorporating this dataset into model training, we successfully scale the output length of existing models to over 10,000 words while maintaining output quality. We also develop LongBench-Write, a comprehensive benchmark for evaluating ultra-long generation capabilities. Our 9B parameter model, further improved through DPO, achieves state-of-the-art performance on this benchmark, surpassing even much larger proprietary models. In general, our work demonstrates that existing long context LLM already possesses the potential for a larger output window--all you need is data with extended output during model alignment to unlock this capability. Our code & models are at: https://github.com/THUDM/LongWriter.

Summary

AI-Generated Summary

PDF676November 28, 2024