Make this twitter thread into a linkeding post. Use a personal humoristic tone, with…
- User
Make this twitter thread into a linkeding post. Use a personal humoristic tone, with concise, clear and style:
LLM, VLMs, ... can compress data 3x over JPEG\PNG etc. 6x Zlib, gzip etc. (for paper link ask in comments) How? We all know they provide a probability over data, which is all classical compression needs (arithmetic coding, see below) Understanding is compressing, but this time not by the weights themselves Arithmetic coding works by sequentially cutting the number space between 0-1. Consider compressing "I am". The model says the probability to start a sentence with the token "a" is 30% "the" 20% "I" 5% ... So any sentence I + ... Falls in 0.50-0.55
Then we have different probabilities splitting 0.5-0.55 more, and perhaps setting every starting "I am..." to 0.512-0.5124. The probabilities you get from you favorite LLM. The result is a single number for your sentence. And if the model was good, this number will be short.
So we get on average short numbers to represent sentences. and to decode them we run the model again, get probabilities and decide with those what next word to give to the model.
They did it for images, video, text and it all compresses really, really well.
One thing I couldn't find is speed. Compression ratio is usually a speed vs. performance issue. This seems like a massively slow process, so wonder (even with SLMs) when it is justified, and how well other methods would do given so much more compute.
- Assistant
Here’s a LinkedIn-style rewrite of that thread — clear, witty, and professional, with a personal tone that fits the platform’s vibe:
🚀 LLMs and Compression — the weird overlap nobody asked for (but I can’t stop thinking about). Turns out, large language models (and their visual cousins, VLMs) can compress data — like, really compress: 👉 ~3× better than JPEG/PNG 👉 ~6× better than gzip or zlib (If you want the paper link, drop a comment 👇) Now, how’s that even possible? Well, compression is basically about knowing how likely something is. And that’s exactly what an LLM does — it assigns probabilities to the next token, pixel, or frame. So if your model thinks there’s a 30% chance of “a”, 20% of “the”, and 5% of “I”… it’s basically already doing what classical arithmetic coding does — cutting the number space between 0 and 1 into tiny probability slices. Every sentence, image, or video becomes a single (small) number that represents it. The better the model “understands” the data, the shorter that number gets. In other words: 🧠 Understanding = Compression And yes — they’ve now done this for text, images, and even video. It works ridiculously well. The only thing I haven’t seen clearly reported? Speed. Compression has always been a trade-off between ratio and runtime — and this feels like the Ferrari of compressors: beautiful ratios, but maybe not your everyday ZIP tool. Still, it’s wild to think that our models’ “understanding” can literally shrink the world into smaller numbers.
- User
explain a bit more on how arithmetic coding works. Note that the LLM doesn't replace arithmetic coding. Arithmetic coding requires a probability model and that is the LLM
- Assistant
Perfect — you’re absolutely right: the LLM doesn’t replace arithmetic coding, it powers it by providing the probability distribution. Here’s a refined LinkedIn post that keeps the humor and flow, but adds clarity on how arithmetic coding works and where the LLM fits in 👇
🤯 LLMs as compression engines — the most mind-bending crossover since AI wrote poems. Here’s something wild: LLMs (and VLMs) can compress data — like, really compress it. 🗜️ ~3× better than JPEG/PNG 🗜️ ~6× better than gzip or zlib (If you want the paper link, ask in the comments 👇) Now, before your inner skeptic screams “Wait, what?”, here’s the trick: Compression is basically about predicting the future. If you can accurately guess what comes next, you can encode data more efficiently. That’s where arithmetic coding comes in — it’s a classical compression method that turns a stream of symbols (like text) into a single number between 0 and 1. Here’s the gist: 1️⃣ You start with the full range [0,1). 2️⃣ For each symbol (say, a word or a pixel), you split that range based on its probability. 3️⃣ If your model says there’s a 30% chance of “a”, 20% of “the”, and 5% of “I”, you carve up the range accordingly. 4️⃣ When you see “I”, you zoom into that slice — say, [0.50, 0.55). 5️⃣ Then you repeat for the next token, further narrowing the interval. At the end, you get one tiny number that uniquely represents the entire message. To decompress it, you just run the same process in reverse using the same probability model. Here’s the key insight: 🧠 The LLM isn’t the compressor — it’s the probability oracle that feeds arithmetic coding. And because LLMs (and VLMs) have learned such rich statistical structure in data, the ranges they carve up are much tighter — meaning: ✨ shorter numbers, smaller files, better compression. Researchers have shown this works across text, images, and video. The only big question left: speed. Arithmetic coding with LLMs sounds incredible — but also incredibly slow. Still, the fact that “understanding” itself can be measured in compression ratios? That’s… kind of poetic.