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

嵌入表被高估了?面向小型三值语言模型的16 MB冻结词汇表

Embeddings Are Overpriced? A Frozen 16 MB Vocabulary for Small and Ternary Language Models

QLNI

Sai Kiran Bathula

AI总结:

本文提出将小型语言模型的嵌入表替换为16 MB冻结词汇表,在Gemma和BitNet模型上验证其性能,该表在多数基准上表现相当,速度更快、内存占用更低,还能高效扩展新词。

摘要:

在小型语言模型中,词汇表是最大的组成部分。在Gemma 3 270M模型中,嵌入表包含2.68亿参数中的1.68亿个,由于量化方法会将嵌入部分保留为16位,因此在模型其余部分被压缩后,嵌入表也占据了文件的大部分空间。本文探究该嵌入表的实际作用:将其替换为一个由预训练嵌入表经主成分投影和符号二值化得到的、无训练参数的512位编码冻结表,大小为16 MB,并在相同的20.5亿token数据集上从头开始训练相同Gemma结构的主体,分别测试使用和不使用该冻结表的情况。学习得到的嵌入表可将验证损失降低0.20纳特,但会使可训练参数增加2.6倍;而在LAMBADA、HellaSwag和PIQA基准上,使用冻结表的模型表现更优或持平,仅ARC-Easy基准更偏好学习得到的嵌入表。当采用三值BitNet b1.58主体时,整个模型大小为46 MB,在LAMBADA和PIQA基准上仍与浮点模型持平,且在笔记本电脑CPU上以62 MB内存实现每秒615至740 token的生成速度,是该http URL中浮点模型的8位GGUF版本速度的5至6倍,内存仅为其七分之一。该冻结表在稀有词任务上的损失降低1.7至2.3纳特,训练后可接受10000个新词,仅产生3%的性能损失,而学习得到的嵌入表则会出现43%的性能崩溃,所有相关内容均随权重、数据及所有评估答案一同发布。

英文摘要:

In a small language model the vocabulary is the single largest part. In Gemma 3 270M the embedding table holds 168M of 268M parameters, and because quantisation methods leave the embedding in 16-bit, it is also most of the file once the rest of the model is compressed. We ask what that table actually buys. We replace it with one frozen table of 512-bit codes, 16 MB, with no trainable parameters, derived once from a pretrained embedding by principal-component projection and sign binarisation, and we train the same Gemma-shaped body from scratch on the same 2.05B tokens with and without it. The learned table buys 0.20 nats of validation loss for 2.6 times the trainable parameters, but on LAMBADA, HellaSwag and PIQA the frozen-table model is better or tied; only ARC-Easy favours the learned table. With a ternary BitNet b1.58 body the whole model is a 46 MB file, still ties the float model on LAMBADA and PIQA, and on a laptop CPU generates 615 to 740 tokens per second in 62 MB of memory, five to six times the speed of the float model's 8-bit GGUF in llama.cpp at a seventh of the memory. The frozen table wins by 1.7 to 2.3 nats on rare words, accepts 10,000 new words after training with a 3% cost where the learned table collapses by 43%, and all of it is released with the weights, the data and every evaluation answer.

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

↑