News for hackers. Stuff that matters.
Re:Short Message Compression Using LLMs by astrange on Tuesday December 31, 2024 @08:45AM (#42558662)
Arithmetic coding is better than Huffman coding because it can use a fractional number of bits per code, while Huffman has to use a whole number of bits.

IIRC the only reason it wasn't always used for everything is patents. A secondary reason being that it can be slow if you design it without thinking about performance, eg if you use divisions.

Re:Short Message Compression Using LLMs by gliptic on Tuesday December 31, 2024 @10:15AM (#42559161)
Huffman still has a performance edge for static distributions. ANS bridges some of the performance gap between arithmetic coding and huffman.
Re:Short Message Compression Using LLMs by astrange on Thursday January 02, 2025 @11:59PM (#42582606)
But there's no such thing as a static distribution :)