arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.16860cs.CL
收藏

LongAttn:通过Token级注意力选择长上下文训练数据

LongAttn: Selecting Long-context Training Data via Token-level Attention

Peking University(北京大学);Qiyuan Tech(奇安信科技)

Longyun Wu, Dawei Zhu, Guangxiang Zhao, Zhuocheng Yu, Junfeng Ran, Xiangyu Wong, Lin Sun, Sujian Li

AI总结:

提出LongAttn框架,利用LLM的自注意力机制在Token级量化长距离依赖,实现更准确高效的长上下文训练数据选择,并构建了高质量数据集LongABC-32K。

摘要:

随着大型语言模型(LLMs)的发展,在处理长上下文方面取得显著进展的需求日益增长。为了增强长上下文能力,构建具有长距离依赖关系的高质量训练数据至关重要。现有的长上下文数据选择方法通常依赖于句子级分析,这在性能和效率上都有很大的优化空间。在本文中,我们提出了一种新颖的Token级框架LongAttn,它利用LLMs的自注意力机制来衡量数据的长距离依赖关系。通过计算Token级依赖强度以及Token分数的分布均匀性,LongAttn有效地量化了长距离依赖关系,从而实现更准确、更高效的数据选择。我们从开源长上下文数据集(ArXiv、Book和Code)中筛选出LongABC-32K。通过全面的实验,LongAttn展示了其卓越的有效性、可扩展性和效率。为了促进未来长上下文数据的研究,我们发布了我们的代码以及高质量的长上下文训练数据LongABC-32K。

英文摘要:

With the development of large language models (LLMs), there has been an increasing need for significant advancements in handling long contexts. To enhance long-context capabilities, constructing high-quality training data with long-range dependencies is crucial. Existing methods to select long-context data often rely on sentence-level analysis, which can be greatly optimized in both performance and efficiency. In this paper, we propose a novel token-level framework, LongAttn, which leverages the self-attention mechanism of LLMs to measure the long-range dependencies for the data. By calculating token-level dependency strength and distribution uniformity of token scores, LongAttn effectively quantifies long-range dependencies, enabling more accurate and efficient data selection. We filter LongABC-32K from open-source long-context datasets (ArXiv, Book, and Code). Through our comprehensive experiments, LongAttn has demonstrated its excellent effectiveness, scalability, and efficiency. To facilitate future research in long-context data, we released our code and the high-quality long-context training data LongABC-32K.

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

↑