arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.11880cs.LGcs.AIcs.CLcs.DC
收藏

Bitnet.cpp:面向三值大语言模型的高效边缘推理

Bitnet.cpp: Efficient Edge Inference for Ternary LLMs

Peking University(北京大学);University of Science and Technology of China(中国科学技术大学);University of Chinese Academy of Sciences(中国科学院大学);Microsoft Research(微软研究院)

Jinheng Wang, Hansong Zhou, Ting Song, Shijie Cao, Yan Xia, Ting Cao, Jianyu Wei, Shuming Ma, Hongyu Wang, Furu Wei

AI总结:

本文提出 Bitnet.cpp 推理系统,通过新型 mpGEMM 库及 TL、I2_S 方案实现三值 LLM 的无损高速边缘推理,速度显著优于全精度与低比特基线。

摘要:

以 BitNet b1.58 为代表的 1 比特大语言模型(LLM)的出现,激发了人们对三值 LLM 的兴趣。尽管如此,聚焦于三值 LLM 高效边缘推理的研究与实际应用仍然稀缺。为弥合这一差距,我们提出 Bitnet.cpp,这是一个为 BitNet b1.58 和三值 LLM 优化的推理系统。鉴于混合精度矩阵乘法(mpGEMM)构成三值 LLM 推理时间的主要部分,Bitnet.cpp 纳入了一个新颖的 mpGEMM 库,以实现每权重低于 2 比特、高效且无损的推理。该库具有两项核心方案:Ternary Lookup Table(TL,三值查找表),用于解决以往按位方法在空间效率方面的不足;以及 Int2 with a Scale(I2_S),用于确保无损边缘推理;二者共同支持高速推理。实验表明,Bitnet.cpp 相比全精度基线最高实现 6.25 倍的速度提升,相比低比特基线最高实现 2.32 倍的速度提升,在该领域树立了新的基准。此外,我们在附录中将 TL 扩展为面向低比特 LLM 的 element-wise lookup table(ELUT,逐元素查找表),并给出理论与实证证据,表明其具有相当大的潜力。Bitnet.cpp 已公开发布于 https://github.com/microsoft/BitNet/tree/paper ,为边缘 LLM 的高效、实际部署提供了成熟方案。

英文摘要:

The advent of 1-bit large language models (LLMs), led by BitNet b1.58, has spurred interest in ternary LLMs. Despite this, research and practical applications focusing on efficient edge inference for ternary LLMs remain scarce. To bridge this gap, we introduce Bitnet.cpp, an inference system optimized for BitNet b1.58 and ternary LLMs. Given that mixed-precision matrix multiplication (mpGEMM) constitutes the bulk of inference time in ternary LLMs, Bitnet.cpp incorporates a novel mpGEMM library to facilitate sub-2-bits-per-weight, efficient and lossless inference. The library features two core solutions: Ternary Lookup Table (TL), which addresses spatial inefficiencies of previous bit-wise methods, and Int2 with a Scale (I2_S), which ensures lossless edge inference, both enabling high-speed inference. Our experiments show that Bitnet.cpp achieves up to a 6.25x increase in speed over full-precision baselines and up to 2.32x over low-bit baselines, setting new benchmarks in the field. Additionally, we expand TL to element-wise lookup table (ELUT) for low-bit LLMs in the appendix, presenting both theoretical and empirical evidence of its considerable potential. Bitnet.cpp is publicly available at https://github.com/microsoft/BitNet/tree/paper , offering a sophisticated solution for the efficient and practical deployment of edge LLMs.

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

↑