DZip: improved general-purpose loss less compression based on novel neural network modeling

Mohit Goyal, Kedar Tatwawadi, Shubham Chandak, Idoia OchoaDCC (Data Compression Conference) 2025

TL;DR

This paper introduces DZip, a novel general-purpose lossless compressor that leverages a hybrid neural network approach for data modeling and prediction. DZip achieves state-of-the-art compression ratios, outperforming traditional compressors like Gzip and 7zip, while also being significantly faster than existing neural network-based compressors.

What Problem Does This Paper Address?

The ever-increasing volume of data across various domains (genomics, 3D, point clouds, etc.) necessitates efficient data compression. Traditional compressors often rely on statistical models that struggle with the complex, long-range dependencies found in modern datasets. While neural networks (NNs) excel at modeling such patterns, existing NN-based compressors are often specialized for specific data types or require extensive, separate training data, making them impractical for general-purpose use. This paper addresses the need for a general-purpose, data-type-agnostic lossless compressor that can effectively leverage the power of NNs without the typical drawbacks of specialization and large training overhead.

Methods

DZip employs a hybrid training scheme combining semi-adaptive and adaptive approaches using two neural network models: a bootstrap model and a supporter model.

  • Bootstrap Model: This is a parameter-efficient RNN (specifically, biGRU layers) trained in a semi-adaptive fashion. It involves multiple passes over the input sequence to learn general patterns. This model is trained once and its parameters are saved as part of the compressed file.
  • Supporter Model: This is a larger, randomly initialized NN that is updated adaptively during encoding (and symmetrically during decoding). It takes inputs from the bootstrap model and learns to refine predictions. Crucially, its parameters are not stored in the compressed file, as they are updated on-the-fly.
  • Combined Model: The predictions from both models are combined using a convex sum, allowing the system to weigh their contributions. This combined prediction is then fed into an arithmetic coder for the final compression.

The training process involves an initial stage of training the bootstrap model on the input sequence, followed by the adaptive updates of the supporter model during compression. DZip offers two modes: "Combined mode (hybrid)" (the default) and "Bootstrap only mode," allowing a trade-off between compression ratio and speed.

Datasets

The paper evaluates DZip on a diverse set of real-world datasets, including:

  • Text: webster, text8, enwiki9
  • Genomic: h. chr1, h. chr20, c.e. genome, np-bases, np-quality
  • Executable: mozilla
  • Scientific Floating Point: num-control, obs-spitzer, msg-bt
  • Audio: audio

They also use synthetic datasets with known entropy rates (XOR-k and HMM-k) to evaluate the model's ability to capture long-term dependencies. The authors provide links to these datasets and the source code for DZip.

Key Insights and Ideas

  • Hybrid NN Architecture: The combination of a pre-trained, parameter-efficient bootstrap model with an adaptively updated supporter model is key to achieving both good compression and practical performance.
  • General-Purpose NN Compression: DZip demonstrates that NN-based compression can be made truly general-purpose, not requiring data-type-specific training or knowledge.
  • Adaptive Updates Without Storage: The supporter model's adaptive updates during encoding/decoding, without needing to store its parameters, is a clever way to improve prediction accuracy without increasing the compressed file size.
  • Speed vs. Compression Trade-off: The paper highlights that while NN-based compression is inherently slower than traditional methods, DZip's architecture and GPU utilization allow it to be significantly faster than other NN compressors while maintaining competitive compression ratios.
  • Alphabet Size and Sequence Length Impact: The performance of DZip, like other compressors, is sensitive to alphabet size and sequence length, particularly due to the overhead of storing the bootstrap model. This overhead becomes less significant for longer sequences.

Key Results

  • Outperforms Traditional Compressors: DZip achieves an average of 29% size reduction over Gzip and 12% over 7zip on real datasets.
  • Competitive with NN Compressors: DZip outperforms LSTM-Compress by 33% and is comparable to state-of-the-art NN compressors like CMIX and NNCP on many datasets, especially for longer sequences.
  • Significantly Faster: DZip is 3-4 times faster than CMIX and 4 times faster than NNCP in encoding speed, while still achieving similar or better compression.
  • Near-Optimal on Synthetic Data: For synthetic datasets with known entropy, DZip achieves compression close to the theoretical entropy rate, especially for sequences with dependencies within its context window (k < 70).
  • Bootstrap Model Overhead: For small, large-alphabet sequences (e.g., webster, mozilla), the bootstrap model can account for 25-31% of the compressed size, impacting overall compression. This overhead is amortized for longer sequences.

Limitations and Future Work

  • Reproducibility: The current implementation's reliance on GPU for encoding/decoding limits reproducibility across different hardware setups (a limitation of the PyTorch library at the time of writing). The authors note that adapting to a different deep learning framework or waiting for better GPU reproducibility could address this.
  • Encoding/Decoding Speed: While DZip is faster than other NN compressors, its encoding/decoding times are still slower than traditional compressors. The authors believe the framework and experiments can inspire further research into optimizing NN models for compression.
  • Context Length: DZip's prediction is limited by its context window (K=64). For sequences with dependencies beyond this range, performance can degrade. The authors suggest that increasing K would improve compression but at the cost of increased encoding/decoding runtime.
  • Model Size Overhead: The bootstrap model's size can be a significant overhead for short sequences with large alphabets. Future work could explore more efficient ways to represent or compress the bootstrap model itself.

Summary updated

BibTeX
@inproceedings{goyal2025dzip,
  author = {Mohit Goyal and Kedar Tatwawadi and Shubham Chandak and Idoia Ochoa},
  title = {{DZip: improved general-purpose loss less compression based on novel neural network modeling}},
  booktitle = {DCC (Data Compression Conference)},
  year = {2025},
  url = {https://openreview.net/forum?id=aEX8DQSmZ9},
}
Figure