Training and serving Large Language Models (LLMs) relies heavily on parallelization and collective operations, which are frequently bottlenecked by network bandwidth. Lossless compression using e.g., Huffman codes can alleviate the issue, however, Huffman codes suffer from slow, bit-sequential decoding and high hardware complexity due to deep tree traversals. Universal codes e.g., Exponential-Golomb codes are faster to decode but do not exploit the symbol frequency distributions. To address these limitations, this paper introduces Dual Length Codes, a hybrid approach designed to balance compression efficiency with decoding speed. Analyzing BFloat16 tensors from the Gemma model, we observed that the top 8 most frequent symbols account for approximately 50% of the cumulative probability. These 8 symbols are assigned a short 4 bit code. The remaining 248 symbols are assigned a longer 9 bit code. The coding scheme uses a single prefix bit to distinguish between the two code lengths. The scheme uses a small Look Up Table with only 8 entries for encoding and decoding. The scheme achieves a compressibility of 18.6% in comparison to 21.3% achieved by Huffman codes, but it significantly speeds up the decoding and simplifies the hardware complexity.


翻译:大型语言模型(LLM)的训练与部署高度依赖并行化与集体操作,这些操作常受网络带宽瓶颈制约。采用霍夫曼码等无损压缩方法可缓解此问题,但霍夫曼码因深度树遍历导致解码速度慢(需按位串行处理)且硬件复杂度高。指数哥伦布码等通用码解码速度更快,但无法利用符号频率分布特性。为克服这些局限,本文提出双长度码——一种兼顾压缩效率与解码速度的混合方法。通过分析Gemma模型的BFloat16张量,我们发现前8个最高频符号约占累积概率的50%。这8个符号被分配4位短码,其余248个符号则分配9位长码。该编码方案使用单个前缀位区分两种码长,并采用仅含8个表项的小型查找表进行编解码。相较于霍夫曼码实现的21.3%压缩率,本方案达到18.6%的压缩率,同时显著提升了解码速度并降低了硬件复杂度。

0
下载
关闭预览

相关内容

大型语言模型的规模效应局限
专知会员服务
14+阅读 · 2025年11月18日
TransMLA:多头潜在注意力(MLA)即为所需
专知会员服务
23+阅读 · 2025年2月13日
大型语言模型对齐技术综述:RLHF、RLAIF、PPO、DPO 等
专知会员服务
55+阅读 · 2024年7月24日
放弃 RNN/LSTM 吧,因为真的不好用!望周知~
人工智能头条
19+阅读 · 2018年4月24日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
VIP会员
最新内容
美军MAVEN项目全面解析:算法战架构
专知会员服务
8+阅读 · 今天8:36
从俄乌战场看“马赛克战”(万字长文)
专知会员服务
6+阅读 · 今天8:19
最新“指挥控制”领域出版物合集(16份)
专知会员服务
13+阅读 · 4月12日
面向军事作战需求开发的人工智能(RAIMOND)
专知会员服务
19+阅读 · 4月12日
远程空中优势:新一代超视距导弹的兴起
专知会员服务
4+阅读 · 4月12日
大语言模型溯因推理的统一分类学与综述
专知会员服务
5+阅读 · 4月12日
相关基金
国家自然科学基金
0+阅读 · 2016年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
Top
微信扫码咨询专知VIP会员