arXiv:2604.03336cs.LGeess.SP2026-04

为三值神经网络权重设计了高效二进制编码格式,体积缩小4倍且开销极低。

NativeTernary: A Self-Delimiting Binary Encoding with Unary Run-Length Hierarchy Markers for Ternary Neural Network Weights, Structured Data, and General Computing Infrastructure

  • 采用自界定二进制编码+游程标记层级结构,实现精确2比特/权值存储
  • 相比GGUF减少460倍边界开销(91字节 vs ~42KB),压缩率提升4倍
  • 解码器仅10行代码,抗比特流损坏,适合部署在普通硬件上

BitNet b1.58(Ma et al., 2024)证明大型语言模型可在三值权重{-1, 0, +1}下运行,但缺乏原生二进制传输格式。NativeTernary填补此空白。在真实BitNet b1.58 2B4T架构(24层,约170个张量,20亿参数)上测试:该编码将三值权重压缩至精确2.000比特/权值,较GGUF Q2_K小1.31倍、较GGUF int8小4.0倍;同时将边界与帧开销降低460倍(91字节对比~42KB的GGUF张量头)。编码吞吐率47–69 MB/s,解码吞吐率35–45 MB/s,可在通用硬件上运行。解码器为10行无状态状态机,对比特流损坏具有鲁棒性。

原文摘要 · Abstract (English)

BitNet b1.58 (Ma et al., 2024) demonstrates that large language models can operate entirely on ternary weights {-1, 0, +1}, yet no native binary wire format exists for such models. NativeTernary closes this gap. Benchmarked against GGUF on the real BitNet b1.58 2B4T architecture (24 layers, ~170 tensors, 2B parameters): NativeTernary encodes ternary weights at exactly 2.000 bits per weight -- 1.31x smaller than GGUF Q2_K and 4.0x smaller than GGUF int8 -- while reducing boundary and framing overhead by 460x (91 bytes vs ~42KB of GGUF tensor headers). Encode throughput: 47--69 MB/s. Decode throughput: 35--45 MB/s on commodity hardware. The decoder is a 10-line stateless state machine resilient to bitstream corruption.

量化编码推理优化三值网络

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。