TL;DR
This paper introduces TRACE, a novel deep-learning-based lossless compressor that significantly speeds up compression by using a single-layer transformer and introducing compression-friendly architectural modifications. TRACE achieves a ~3x speedup over state-of-the-art methods while maintaining comparable compression ratios, making efficient deep learning compression a reality.
What Problem Does This Paper Address?
The ever-increasing volume of data necessitates efficient compression. While deep learning models have shown promise in achieving higher compression ratios than traditional methods, they often suffer from prohibitively long execution times. This is largely due to sequential processing in architectures like RNNs, which hinders parallelization and GPU utilization. Existing transformer models, while capable of parallel processing, are typically too large and computationally expensive for compression tasks. The challenge, therefore, is to develop a deep learning compressor that is both highly effective in compression ratio and remarkably fast.
Methods
The core of TRACE is a single-layer transformer architecture, chosen for its parallel processing capabilities, which is a significant departure from the sequential nature of RNNs. To adapt the transformer for compression, the authors introduce several key innovations:
- Latency-to-Compression Ratio (LCR) Metric: A new metric to guide architectural choices, balancing compression ratio and inference latency.
- Byte-grouping: This technique decouples the byte's embedding dimension from the transformer's hidden dimension, reducing redundancy and allowing for longer context modeling without increasing computational cost.
- Shared-FFN (Feed-Forward Network): Inspired by parameter sharing in models like ALBERT, this scheme reuses FFN layers within a single transformer layer, allowing for deeper effective models without a proportional increase in parameters or computation.
- Back-Prop (BP) Controller: An adaptive update scheme that intelligently decides when to perform backpropagation. By using a FIFO cache of historical cross-entropy values, it avoids unnecessary parameter updates during compression, further accelerating the process.
Datasets
The paper evaluates TRACE on a diverse set of datasets, including:
- Homogeneous Data: Enwik9, BookCorpus, Sound, Image, Floating Point.
- Heterogeneous Data: Silesia, Backup.
These datasets are described in detail in Table 5 and Appendix A, covering various data types to demonstrate the general-purpose nature of the compressor.
Key Insights and Ideas
- Transformer's Parallelism is Key: The paper strongly advocates for transformers over RNNs for compression due to their inherent ability to process history dependencies in parallel, leading to better GPU utilization.
- Single-Layer Transformer Sufficiency: Contrary to the multi-layer trend in NLP, the authors demonstrate that a single-layer transformer, with appropriate modifications, is sufficient for effective compression.
- LCR as a Guiding Star: The LCR metric proves crucial in identifying architectural trade-offs, showing that attention dimensions are more computationally expensive than FFN dimensions for compression.
- Compression-Friendly Modifications: Byte-grouping and Shared-FFN are not just minor tweaks; they are fundamental to making the transformer architecture efficient and effective for compression tasks.
- Adaptive Updates for Speed: The BP controller highlights that not all data points require full backpropagation, and intelligently skipping updates can yield significant speedups without substantial loss in compression ratio.
Key Results
- ~3x Speedup: TRACE achieves an overall speedup of approximately 3 times compared to state-of-the-art compressors.
- Comparable Compression Ratio: Despite the speed improvements, TRACE maintains a compression ratio comparable to existing methods. For instance, on Enwik9, it achieves a 5.29:1 compression ratio, significantly outperforming traditional methods and Dzip.
- Reduced Memory Footprint: TRACE exhibits a much lower peak GPU memory usage (e.g., 2.02GB for batch size 128) compared to other deep learning compressors like Tensorflow-compress (10.75GB) and NNCP (7.75GB), enabling larger batch sizes.
- Improved Throughput: The paper demonstrates TRACE's ability to achieve high throughput (e.g., 81594 bytes/s at batch size 4096), showcasing its efficiency at scale.
- Effectiveness of Techniques: Ablation studies confirm that Byte-grouping and Shared-FFN significantly improve compression ratios, while the BP controller provides a substantial speed boost (29%) with a minor compression ratio trade-off (1-2%).
Limitations and Future Work
- Text Data Performance: While TRACE excels on heterogeneous and non-text data, the paper notes that its compression ratio on text data is slightly worse than dictionary-based compressors like Cmix and NNCP. The authors suggest that improving text compression performance is a direction for future work.
- Silesia Dataset: The transformer's complex structure led to slower convergence on the smaller Silesia dataset, resulting in slightly worse performance compared to Dzip.
- BP Controller on Small Datasets: The BP controller's effectiveness can be hindered by limited data, as seen with the Silesia dataset, where it initially confused the controller. This suggests that more robust adaptive strategies might be needed for very small or highly varied datasets.
Summary updated