« All posts

llama.cpp Adds Lossless F32 Compression via QFX32/QFX16

llama.cpp PR adds QFX32/QFX16 GGUF formats that losslessly compress F32 models by 2.05x with bit-identical weight reconstruction.

A newly submitted PR (#26136) to llama.cpp introduces two GGUF tensor types, QFX32 and QFX16, that losslessly compress F32 and BF16 model weights. The approach splits float bytes into separate planes (sign/exponent vs. mantissa bytes), exposing strong byte-level correlation between adjacent weights, then applies a reversible Haar-lifting transform followed by run-length encoding. Because the transform is fully bijective, decompressed weights are bit-identical to the originals, so perplexity matches the f32 baseline exactly.

Compression reaches 2.05x for F32 (down to 15.64 bits per weight) and 1.14x for BF16 (14.07 bpw). QFX32 offers two runtime modes: a memory-efficient streaming mode with a modest inference slowdown, and a dequant mode that expands weights to full f32 on load, which can actually be faster overall since the smaller file loads off disk quicker. QFX16 uses a 256KB lookup table in the inner compute loop, making decode effectively free in terms of compute overhead.

Unlike lossy quantization schemes such as Q4 or Q8, this offers a way to shrink storage and transfer footprint for full-precision checkpoints without sacrificing numerical accuracy — useful for research, verification, and fine-tuning workflows where exact reproducibility matters.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work