Research map / Large language models / Language, safety and interpretability
Large Language Models for Lossless Image Compression: Next-Pixel Prediction in Language Space is All You Need
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Proposes P²-LLM, a fine-tuned Llama 3 8B that losslessly compresses RGB images by next-subpixel prediction in language space using a chat-style task prompt, numerical digit tokens, and sampled predictive logits for arithmetic coding.
Problem
Existing LLM-based lossless compressors work on grayscale images and lag far behind SOTA codecs on RGB benchmarks because of channel-independent modeling, proxy ASCII tokens that break pixel-value semantics, and lack of domain adaptation.
Approach
Treat each RGB pixel as a channel-joint sequence with a pixel prediction chat template, map each subpixel value 0-255 to its own numerical token (one-to-one), sample the 256 pixel-value logits before softmax as the coding distribution, and LoRA-fine-tune the LLM on DIV2K.
Key results
- P²-LLM reaches 2.08 bpsp on CLIC.m and 2.83 bpsp on Kodak, beating the best LIC baseline DLPR (2.16 and 2.86).
- On DIV2K validation P²-LLM achieves 2.51 bpsp versus 2.88 for JPEG-XL (best classical) and 4.17 for the prior LLM-based compressor.
- Ablation: numerical tokens with channel-joint prediction and task prompt plus fine-tuning reach 2.83 bpsp on Kodak, versus 4.55 for the channel-independent baseline without fine-tuning; patch size 16x16 is best.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| replace DLPR with P²-LLM | Lossless image compression · CLIC.m | bpsp: 2.16 -> 2.08 | Helped |
| replace DLPR with P²-LLM | Lossless image compression · Kodak | bpsp: 2.86 -> 2.83 | Helped |
| add channel-joint prediction instead of channel-independent prediction (ablation) | P²-LLM without fine-tuning or task prompt · Kodak | bpsp: 4.55 -> 3.96 | Helped |
| add the task prompt (ablation) | P²-LLM with channel-joint prediction, without fine-tuning · Kodak | bpsp: 3.96 -> 3.83 | Helped |
| add fine-tuning (ablation) | P²-LLM with channel-independent prediction and no task prompt · Kodak | bpsp: 4.55 -> 3.95 | Helped |
| add fine-tuning (ablation) | P²-LLM with channel-independent prediction and task prompt · Kodak | bpsp: 4.46 -> 3.76 | Helped |
| add fine-tuning (ablation) | P²-LLM with channel-joint prediction and no task prompt · Kodak | bpsp: 3.96 -> 2.99 | Helped |
| add fine-tuning (ablation) | P²-LLM with channel-joint prediction and task prompt · Kodak | bpsp: 3.83 -> 2.83 | Helped |
| add the task prompt (ablation) | P²-LLM with channel-independent prediction, without fine-tuning · Kodak | bpsp: 4.55 -> 4.46 | Helped |
| add the task prompt (ablation) | P²-LLM with channel-independent prediction and fine-tuning · Kodak | bpsp: 3.95 -> 3.76 | Helped |
| use patch size 16×16 instead of 8×8×3 (ablation) | P²-LLM · Kodak | bpsp: 3.10 -> 2.83 | Helped |
| use patch size 16×16 instead of 12×12×3 (ablation) | P²-LLM · Kodak | bpsp: 2.95 -> 2.83 | Helped |
Surprising findings
- Fine-tuning alone does not let the LLM reach SOTA; channel-joint modeling and tokenization drive most of the gain.
- Decoding is very slow (about 273 s per Kodak image for P²-LLM), much slower than classical and learned codecs.
Limitations
- Decoding time is far slower than classical and learned codecs due to autoregressive inference.
- Results rely on a large 8B LLM, so compute cost is high.
- Gains depend on patch size; long contexts degrade performance.
Experimental setup
Datasets: DIV2K-Training
Benchmarks: DIV2K-Validation Kodak CLIC.p CLIC.m SCID BRACS24
Metrics: bpsp encoding time decoding time
Baselines: PNG JPEG-LS CALIC JPEG2000 WebP BPG FLIF JPEG-XL L3C RC iVPF iFlow
Builds on: LLM-based lossless compression (LLMZip-style / Language modeling is compression) LoRA Llama 3 DLPR
Closest papers by meaning
- LLMC+: Benchmarking Vision-Language Model Compression with a plug-and-play Toolkit (AAAI 2026 · similarity 0.90)
- Language Modeling Is Compression (ICLR 2024 · similarity 0.88)
- Benchmarking and Enhancing VLM for Compressed Image Understanding (ICML 2026 · similarity 0.88)
- When MLLMs Meets Compression Distortion: A Coding Paradigm Tailored to MLLMs (ICLR 2026 · similarity 0.88)
- Compressing LLMs: The Truth is Rarely Pure and Never Simple (ICLR 2024 · similarity 0.88)
- One Token per Highly Selective Frame: Towards Extreme Compression for Long Video Understanding (NeurIPS 2025 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
