Flora:轻松构建任意长度和规模的上下文
Flora: Effortless Context Construction to Arbitrary Length and Scale
AI总结:
本文提出Flora,一种无需人工或LLM干预的长上下文构建策略,通过按类别组合短指令并利用元指令生成响应,显著提升长上下文性能,同时保持短上下文能力。
摘要:
有效处理长上下文对大型语言模型(LLMs)来说具有挑战性,因为长文本稀缺、计算需求高,且会显著遗忘短上下文能力。近期方法尝试为指令微调构建长上下文,但这些方法通常需要LLMs或人工干预,成本高昂且长度和多样性受限。此外,现有长上下文LLMs在短上下文性能上的下降仍然显著。本文中,我们介绍了Flora,一种无需人工或LLM干预的轻松长上下文构建策略。Flora通过基于类别任意组合短指令,并指导LLMs根据长上下文元指令生成响应,显著增强LLMs的长上下文性能。这使得Flora能够生成任意长度和规模且具有丰富多样性的上下文,同时仅轻微牺牲短上下文性能。在Llama3-8B-Instruct和QwQ-32B上的实验表明,经Flora增强的LLMs在三个长上下文基准上表现出色,同时在短上下文任务中保持强劲性能。我们的数据构建代码可在https://github.com/txchen-USTC/Flora获取。
英文摘要:
Effectively handling long contexts is challenging for Large Language Models (LLMs) due to the rarity of long texts, high computational demands, and substantial forgetting of short-context abilities. Recent approaches have attempted to construct long contexts for instruction tuning, but these methods often require LLMs or human interventions, which are both costly and limited in length and diversity. Also, the drop in short-context performances of present long-context LLMs remains significant. In this paper, we introduce Flora, an effortless (human/LLM-free) long-context construction strategy. Flora can markedly enhance the long-context performance of LLMs by arbitrarily assembling short instructions based on categories and instructing LLMs to generate responses based on long-context meta-instructions. This enables Flora to produce contexts of arbitrary length and scale with rich diversity, while only slightly compromising short-context performance. Experiments on Llama3-8B-Instruct and QwQ-32B show that LLMs enhanced by Flora excel in three long-context benchmarks while maintaining strong performances in short-context tasks. Our data-construction code is available at \href{https://github.com/txchen-USTC/Flora}{https://github.com/txchen-USTC/Flora}.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。