Abstract
The recently proposed Neural Local Lossless Compression (NeLLoC), which is based on a local autoregressive model, has achieved state-of-the-art (SOTA) out-of-distribution (OOD) generalization performance in the image compression task. In addition to the encouragement of OOD generalization, the local model also allows parallel inference in the decoding stage. In this paper, we propose two parallelization schemes for local autoregressive models. We discuss the practicalities of implementing the schemes and provide experimental evidence of significant gains in compression runtime compared to the previous, non-parallel implementation.
Introduction
Autoregressive models, such as PixelCNN, are highly effective for lossless image compression. However, they suffer from a major practical bottleneck during decompression: they generate images sequentially, pixel-by-pixel. For an image of size $D \times D$, this results in a slow $O(D^2)$ runtime.
Recently, the Neural Local Lossless Compression (NeLLoC) model was introduced to address out-of-distribution (OOD) generalization by restricting the model to local features. This paper tackles the computational bottleneck of such models by asking: If a model only relies on local neighborhoods, can we decode distant pixels simultaneously?
Methods
The authors propose two parallel decoding schemes that exploit the local autoregressive structure of NeLLoC.
Parallel Decoding (pNeLLoC)
In a local autoregressive model with a dependency "horizon" of $h$, a pixel only depends on a small local window of previously decoded pixels. Because of this, many pixels across the image are conditionally independent and can be decoded at the same time. The authors pre-compute a topological ordering of the image, allowing them to decode independent pixels in parallel batches.
This reduces the theoretical decoding time from $O(D^2)$ to $O(D)$.
Sheared Local Autoregressive Model (ShearLoC)
While pNeLLoC is theoretically faster, it can suffer from hardware inefficiencies because conditionally independent pixels are often scattered in memory. To optimize this, the authors introduce ShearLoC, which applies a "shear" transformation to both the image and the model's first convolutional kernel. This geometric shift aligns the independent pixels into straight, contiguous columns in memory, drastically optimizing parallel processing on modern hardware.
Experimental Results
The models were pre-trained on CIFAR10 and evaluated on ImageNet images resized to various dimensions. The key findings include:
- Linear Complexity: Decoding time scales linearly with the image dimension $O(D)$ rather than quadratically $O(D^2)$.
- Significant Speedups: On $32 \times 32$ images, ShearLoC achieved up to a 3.16x speedup. For high-resolution $1024 \times 1024$ images, the benefits of $O(D)$ scaling resulted in a 6.52x speedup, reducing decoding time from ~476 seconds to just 73 seconds.
- Identical Compression Performance: Because the parallelization schemes are exact inference mechanisms, they yield the exact same predictive distributions and Bits Per Dimension (BPD) as the sequential baseline.
Discussion and Future Work
The jump from pNeLLoC to ShearLoC highlights a critical systems-engineering truth: memory alignment is as important as theoretical complexity. By shearing the data structure, the authors bridge the gap between mathematical theory and hardware efficiency.
While the current work focuses on lossless compression, these parallelization schemes could be extended to latent variable models to improve sampling efficiency in generative AI tasks. The minor overhead of the shearing transformation is vastly outweighed by the massive gains in decoding speed, making it a viable approach for high-resolution image processing.
Summary updated