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

面向长程语言建模的令牌加权方法

Token Weighting for Long-Range Language Modeling

Technical University of Darmstadt(达姆施塔特工业大学);Hessian Center for AI(黑森州人工智能中心);Ubiquitous Knowledge Processing Lab(普适知识处理实验室)

Falko Helm, Nico Daheim, Iryna Gurevych

AI总结:

本文针对大语言模型长上下文理解能力不足的问题,提出多种基于长短期模型置信度比较的令牌加权方案,通过非均匀损失权重训练提升模型长程建模能力,并给出实证指导。

摘要:

大语言模型(LLMs)的许多应用需要长上下文理解能力,但现有模型在此类任务上仍然表现不佳。我们假设传统的下一令牌预测训练方式可能是原因之一,因为每个令牌被赋予了相等的权重。然而,从直觉上看,准确预测下一个令牌所需的上下文量在不同数据之间差异很大。为了反映这一点,我们提出了多种新颖的令牌加权方案,在损失函数中为每个训练令牌分配不同的权重,从而对现有工作进行了推广。为此,我们采用一个两步框架对令牌加权方法进行分类,该框架通过比较长上下文模型和短上下文模型的置信度来为令牌打分。我们在多个长上下文理解任务上评估了所有方法,并表明非均匀的损失权重有助于提升大语言模型的长上下文能力。不同的短上下文模型都可以有效地用于令牌打分,包括比被训练的长上下文模型小得多的模型。总而言之,这项工作有助于更好地理解长程语言建模所面临的权衡,并基于实证证据为通过损失加权进行模型引导提供了指导。代码可在 Github 上找到。

英文摘要:

Many applications of large language models (LLMs) require long-context understanding, but models continue to struggle with such tasks. We hypothesize that conventional next-token prediction training could contribute to this, because each token is assigned equal weight. Yet, intuitively, the amount of context needed to predict the next token accurately varies greatly across different data. To reflect this, we propose various novel token-weighting schemes that assign different weights to each training token in the loss, thereby generalizing existing works. For this, we categorize token-weighting methods using a two-step framework which compares the confidences of a long-context and short-context model to score tokens. We evaluate all methods on multiple long-context understanding tasks and show that non-uniform loss weights are helpful to improve the long-context abilities of LLMs. Different short-context models can be used effectively for token scoring, including models that are much smaller than the long-context model that is trained. All in all, this work contributes to a better understanding of the trade-offs long-context language modeling faces and provides guidelines for model steering via loss-weighting based on empirical evidence. The code can be found on Github.

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

↑