Lossless Tensor Compression as Program Synthesis
2026-08-03 • Software Engineering
Software EngineeringArtificial IntelligenceProgramming Languages
AI summaryⓘ
The authors present Brevis, a new way to shrink large model checkpoint files without losing any information. Instead of using standard compressors that don't consider the internal structure of the data, Brevis breaks down tensors (multidimensional arrays) into small parts using a special language and then finds the best way to store them compactly. This approach leads to significant storage savings compared to common compression tools, while still allowing exact restoration of the original data. Brevis is also fast enough to be practical for real-world use.
model checkpointstensor compressionlossless compressiondomain-specific languageprogram synthesisA* searchfloating-point representationstorage reductionbit-exact decompressiongeneral-purpose compressors
Authors
Jieke Shi, Junda He, Wenjia Jiang, Weifeng Sun, Shidong Pan, Zhensu Sun, Chengran Yang, Peixin Zhang, Yifan Jia, Zhou Yang, Thong Hoang, Xiwei Xu, Zhenchang Xing, David Lo
Abstract
Model checkpoints are growing in both number and size, which makes archival, transfer, and deployment increasingly costly. General-purpose compressors can reduce storage requirements but ignore tensor structure, whereas existing tensor-specific compressors rely on fixed and format-specific pipelines. We present Brevis, which formulates lossless tensor compression as program synthesis. We design a typed domain-specific language (DSL) that captures recurring tensor structures, such as repeated regions and floating-point fields, through a set of reversible operators. Given a tensor, Brevis synthesizes a self-contained DSL program that reconstructs it bit-exactly. A checkpoint-specific production prior, learned from a small representative sample of tensors, guides a bounded A* search to synthesize compact programs, which can later be executed directly for bit-exact decompression. On 10 public checkpoints spanning language, audio, and image generation models, Brevis reduces 2.13 TB of checkpoint data to 1.41 TB, a 33.93% storage reduction. It produces archives up to 30.87% smaller than those of four general-purpose compressors, including zstd and gzip, and smaller archives than the tensor-specific compressors ZipNN and DFloat11. Under a practical concurrency configuration, Brevis achieves 3.60 GB/s compression and 6.61 GB/s decompression while preserving every source byte.