Large Language Models for Lossless Image Compression: Next-Pixel Prediction in Language Space is All You Need
NeurIPS 2025

1 Department of Electrical Engineering and the CIMDA, City University of Hong Kong
2 Department of Computer Science, City University of Hong Kong
3 Mohamed bin Zayed University of Artificial Intelligence
Figure 1

Abstract

We have recently witnessed that "Intelligence" and "Compression" are the two sides of the same coin, where the language large model (LLM) with unprecedented intelligence is a general-purpose lossless compressor for various data modalities. This attribute particularly appeals to the lossless image compression community, given the increasing need to compress high-resolution images in the current streaming media era. Consequently, a spontaneous envision emerges: Can the compression performance of the LLM elevate lossless image compression to new heights? However, our findings indicate that the naive application of LLM-based lossless image compressors suffers from a considerable performance gap compared with existing state-of-the-art (SOTA) codecs on common benchmark datasets. In light of this, we are dedicated to fulfilling the unprecedented intelligence (compression) capacity of the LLM for lossless image compression tasks, thereby bridging the gap between theoretical and practical compression performance. Specifically, we propose P²-LLM, a next-pixel prediction-based LLM, which integrates various elaborated insights and methodologies, e.g., pixel-level priors, the in-context ability of LLM, and a pixel-level semantic preservation strategy, to enhance the understanding capacity of pixel sequences for better next-pixel predictions. Extensive experiments on benchmark datasets demonstrate that P²-LLM can beat SOTA classical and learned codecs.

Performance Comparison

Figure 2

Comparison of different lossless image compressors for bit-per-subpixel (bpsp↓) on CLIC.m dataset. Classical compressors include PNG, WebP, FLIF, and JPEG-XL. P²-LLM achieves 2.08 bpsp, outperforming SOTA classical and learned codecs.

BibTeX

@article{chen2025p2llm,
  title={Large Language Models for Lossless Image Compression: Next-Pixel Prediction in Language Space is All You Need},
  author={Kecheng Chen and Pingping Zhang and Hui Liu and Jie Liu and Yibing Liu and Jiaxin Huang and Shiqi Wang and Hong Yan and Haoliang Li},
  journal={NeurIPS},
  year={2025}
}