Quad Length Codes for Lossless Compression of e4m3
Abstract
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 Quad Length Codes, a hybrid approach designed to balance compression efficiency with decoding speed. The coding scheme uses 3 prefix bits to divide the 256 symbols into 8 areas. Each area has a different code length and encodes a different number of symbols. The scheme uses a Look Up Table with 256 entries, significantly simplifying the hardware implementation compared to Huffman trees. The coding scheme can be adapted for different distributions. For the e4m3 data type, the scheme achieves a compressibility of 13.9% in comparison to 15.9% achieved by Huffman codes, but it significantly speeds up the decoding and simplifies the hardware complexity.
Keywords
Cite
@article{arxiv.2602.17849,
title = {Quad Length Codes for Lossless Compression of e4m3},
author = {Aditya Agrawal and Albert Magyar and Hiteshwar Eswaraiah and Patrick Sheridan and Pradeep Janedula and Ravi Krishnan Venkatesan and Krishna Nair and Ravi Iyer},
journal= {arXiv preprint arXiv:2602.17849},
year = {2026}
}
Comments
The first version proposed lossless compression of BFloat16 using dual length codes. This version proposes lossless compression of e4m3 using quad length codes. The versions will be merged later