arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2408.07055cs.CLcs.LG
收藏

LongWriter:释放长上下文大语言模型生成10000+词内容的能力

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

Zhipu AI(智谱AI);Tsinghua University(清华大学)

Yushi Bai, Jiajie Zhang, Xin Lv, Linzhi Zheng, Siqi Zhu, Lei Hou, Yuxiao Dong, Jie Tang, Juanzi Li

AI总结:

针对长上下文大语言模型输出长度受限的问题,提出AgentWrite智能体流水线构建长输出数据集LongWriter-6k,训练后模型可生成超10000词内容,还推出评测基准LongBench-Write,9B模型经DPO优化后性能超越更大的专有模型。

摘要:

当前的长上下文大语言模型(LLM)能够处理多达100000个token的输入,却连生成2000词的中等长度输出都存在困难。通过对照实验我们发现,模型的有效生成长度本质上受限于其在监督微调(SFT)阶段接触过的样本长度。换言之,这类模型的输出长度限制源于现有SFT数据集中长输出样本的稀缺。为解决这一问题,我们提出AgentWrite——一种基于智能体的流水线框架,它将超长生成任务拆解为多个子任务,让现成的LLM也能生成连贯的、长度超过20000词的输出。借助AgentWrite,我们构建了LongWriter-6k数据集,其中包含6000条SFT数据,输出长度范围为2000到32000词。将该数据集用于模型训练后,我们成功将现有模型的输出长度拓展至10000词以上,同时保持了输出质量。我们还开发了LongBench-Write,这是一个用于评估超长生成能力的综合基准。我们的9B参数模型经过DPO进一步优化后,在该基准上取得了最优性能,甚至超越了规模大得多的专有模型。总体而言,我们的研究表明,现有的长上下文LLM已经具备更大输出窗口的潜力——只需在模型对齐阶段使用长输出数据即可解锁这一能力。我们的代码和模型可访问:https://github.com/THUDM/LongWriter。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑