r/MachineLearning • u/Electrical_Ninja3805 • 3h ago
Project Ingot: exact (lossless) BF16 weight coding with cross-tensor prediction, 10.38-10.48 bits/weight on four LLMs, and what did not work [p]
Project post, code is open (AGPL-3.0). Lossless coding of BF16 checkpoints: decoded files are byte-identical to the Hugging Face originals.
Setup: each 2-D weight tensor is coded in 213-218 weight blocks with rANS. Format v4 adds a "match" mode: each unit (row/column) gets up to 8 partner units from earlier tensors, the same tensor's earlier rows, or earlier shards. The predictor is exact int64 arithmetic, so it is independent of order. Side info is charged in the file.
Whole-model results (bits/weight; every shard rebuilt and sha256 equal to the HF LFS hash): - Qwen3.8-27B 10.4305 (plain 10.5076) - Qwen3.6-27B 10.4328 (no-match 10.5084) - Qwen2.5-32B-Instruct 10.3820 (no-match 10.5735) - Qwen3.6-35B-A3B 10.4780 (no-match 10.4871) - Mistral-7B-v0.3 10.4309 (plain 10.5225); Phi-3-mini 10.4379 (plain 10.5159)
Baselines on the same Qwen3.8-27B files: zstd -3 12.4590, ZipNN 0.5.4 10.6155, DFloat11 scheme 10.6096.
Findings and limits: - Gain from matching grows with the model family (0.042 / 0.076 / 0.19 bits on Qwen3.8 / Qwen3.6-27B / Qwen2.5-32B), but only 0.009 on Qwen3.6-35B-A3B: 91.8% of its weights are fused 3-D expert tensors, which this mode did not accept as targets then. - Embeddings, norms and vision tower gain 0. - Roles matching helps Phi-3's fused layout, not Mistral (identical output sizes). - Encoding is slow (hours per model on CPU). Decode is also not free; this is for storage and distribution.
Code: https://github.com/dcherrera/Foundry/tree/main/ingot. I'm the author. Happy to share the per-tensor tables.
Paper: https://teamide.dev/research/papers/ingot.pdf (all TeamIDE Lab papers: https://teamide.dev/research/)