arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.20456cs.CLcs.LG
收藏

COUNT:N元语法计数解锁主机内存扩展与无训练适配

The COUNT: Counting N-grams Unlocks Scaling on Host Memory and Training-Free Adaptation

University of Washington(华盛顿大学);Allen Institute for AI(艾伦人工智能研究所)

Ian Magnusson, Noah A. Smith, Pang Wei Koh

AI总结:

COUNT通过在主机存储预计算N元语法计数构建嵌入,可在固定计算预算下提升1B参数LM性能,GPU内存有限时表现优于拆分内存的方法,还能无训练适配新任务。

摘要:

语言模型(LMs)的计算量与性能之间的缩放关系已被广泛研究;近来,模型设计也开始扩展内存使用。特别地,为N元语法添加嵌入会使内存与计算量分开缩放,因为每次仅处理单个嵌入行,其远小于整个嵌入表的存储量。然而,现有方法从头训练嵌入,需要昂贵的GPU内存用于快速读写,而主机系统的普通内存价格低廉且未被这些训练方法充分利用。为在主机内存上进行缩放,我们提出COUNT(Counting Offline Unlocks N-gram Transformers,计数离线解锁N元语法Transformer),该方法通过在主机上存储预计算的N元语法计数来构建N元语法嵌入,无需添加可学习参数。我们利用语料库频率对当前N元语法历史后最常出现的下一个标记的LM自身的未嵌入结果进行加权。在固定计算预算下,将COUNT作为额外输入嵌入添加到预训练10亿参数的LMs中,可将验证损失改善幅度相当于计算量增加57%的LM。若GPU内存有限,使用COUNT让主干参数填满GPU内存,其性能优于将内存与额外可学习N元语法嵌入拆分的情况。除效率外,COUNT还允许在推理时切换来自特定领域语料库的不同N元语法计数表,以适配新任务而无需任何训练。

英文摘要:

The scaling relationship of compute and performance for language models (LMs) has been extensively studied; more recently, models are being designed to scale memory use, as well. In particular, adding embeddings for n-grams scales memory separately from compute use, because each pass only processes individual embedding rows, which are much smaller than the storage used for the whole embedding table. However, existing methods train embeddings from scratch, which needs expensive GPU memory for fast reading and writing. Meanwhile, the ordinary memory of the host system is cheap and underutilized by these training methods. To scale on host memory, we introduce COUNT (Counting Offline Unlocks N-gram Transformers), which builds n-gram embeddings without adding learned parameters by storing precomputed n-gram counts on host. We use the corpus frequencies to weight together the LM's own unembeddings of the next tokens most often following the current n-gram history. At a fixed compute budget, COUNT can be added as an additional input embedding for pretraining 1B-parameter LMs to improve validation loss as much as an LM with 57% more compute. If GPU memory is limited, using COUNT to let backbone parameters fill GPU memory gives better performance than splitting memory with additional learned n-gram embeddings. Beyond efficiency, COUNT allows switching in a different table of n-gram counts from a domain-specific corpus at inference time to adapt to a new task without any training.

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

↑