Compression Is Prediction: The AI Idea You Need to Understand
If you've ever wondered why generative AI feels both magical and slightly unhinged, this one concept will tie it all together. I stumbled across a brilliant piece on the [ngrok blog](https://ngrok.com/blog/compression-is-prediction) this week, and it reframed how I think about everything from file formats to ChatGPT. The title says it all: *Compression Is Prediction*.
At first glance, that sounds backward. Compression is about shrinking data—removing redundancy. Prediction is about guessing what comes next. What do those have in common? A lot, as it turns out. And once you see it, you'll never interact with AI the same way again. Let's break it down.
The Simple Idea That Started It All
Think about picking up a bottle of water. You know what it feels like, how much it weighs, where the cap is. Your brain doesn't re-examine the entire bottle every time you grab one—it predicts, based on decades of data, and skips the unnecessary details. That's compression. It's the process of dropping the parts of a signal that are redundant or predictable, leaving only the unexpected bits.
The classic example is a plain text file. The phrase `the quick brown fox jumps` is highly predictable if you know the English language. A compression algorithm like GZIP will encode that phrase using a shorter representation, partly because it can guess what likely comes next. So compression algorithms are, in a very real sense, prediction engines. They're constantly asking: "How much can I safely skip because the receiver can guess it?"
This idea isn't new—information theory has been dancing around it for decades. But the recent explosion of machine learning has turned it into a practical tool. Large language models (LLMs) are, at heart, prediction machines. They predict the next token (roughly a word or part of a word) given all the tokens before it. And here's the kicker: a model that predicts well is also a model that compresses well. If you can predict the next word of Shakespeare with high accuracy, you've effectively compressed the Bard's entire oeuvre into your model's weights. That's why some researchers call LLMs "universal compressors." They're not reciting from a database; they're generating the most likely sequence based on the compressed patterns of the entire internet.
Why This Matters for Your Daily Tech Life
Okay, so compression is prediction. Big deal. Why should you care? Because it rewires how you think about prompt engineering, AI reliability, and even the tools you use to save disk space.
Prompt Engineering Is Compression Engineering
When you write a prompt, you're telling the model which "compression context" to use. The more precise your instructions, the less the model has to guess. Think of it this way: a vague prompt is like handing someone a highly compressed file without a decompression key. The model still predicts, but it predicts from a mixture of every possible context, which leads to generic or weird outputs.
I've been experimenting with this for months. Here's an example. Instead of saying, "Write a blog post about productivity," I now say, "Write a 700-word blog post in the style of a friendly tech blogger, with humor, a few personal stories, and a punchy conclusion. Use short paragraphs." That's essentially me providing a better prediction context. The model compresses my intent into a high-quality output because I've reduced ambiguity. Every constraint you add is like giving the decompressor an extra clue.
Why AI Hallucinates (and How to Spot It Early)
If AI is a prediction engine, then a "hallucination" is just a confident prediction that turns out to be wrong. It's the model compressing a pattern that doesn't actually exist. That's why you should never treat AI outputs as ground truth. The model isn't reading a fact-checked encyclopedia; it's guessing what would sound most plausible based on its compressed training data.
Here's a practical tip: when you ask an AI to recall a specific stat or quote, ask it to show its work. For example, "Who said this, and in what year?" If the model has to predict too many details, it'll fill gaps with made-up numbers. I always ask for a source and then verify. Trust your gut: if it sounds too generic or too specific about something obscure, double-check.
The Hidden Cost of "Compression" in AI Tools
There's another angle: most AI chat apps use context windows that compress. When you're in a long conversation, the system doesn't remember every single word. It summarizes (compresses) earlier messages to fit within the window. That's why your ChatGPT thread sometimes seems to "forget" a detail from an hour ago. It's not deleting it—it's predicting a summary that loses some nuance.
This is a huge lesson for anyone writing complex prompts or relying on AI for project work. Don't assume the model remembers your first message when you're twenty turns deep. If it's crucial, restate it. You're doing the compression yourself, keeping the important part visible. That's not just good prompting; it's good communication.
Three Real-World Scenarios Where Compression Is Prediction Plays Out
Let's get concrete. Here are three ways I've seen this principle change everyday tech interactions.
Scenario 1: Summarizing a Long Article for a Client
I work with clients who send me 5,000-word industry reports. I used to paste a link into a chat tool and ask, "Summarize this." The output was often a generic list of bullet points that could apply to any article. Now I understand why: the model was predicting an "article summary" from its training data, not from *my* article's unique details.
The fix? I tell the model to focus on "the three most surprising claims" and to "include exact statistics." That forces it to compress *that specific text* rather than generic business writing. The result is much sharper, and my clients think I'm a faster reader than I actually am.
Scenario 2: Using File Compression to Free Up Space
This one is more literal. I have a friend who stores photos in HEIC format because it's smaller than JPEG. HEIC is a compression method, but it's also a prediction method. It predicts the color of each pixel based on surrounding pixels, only saving the differences. When you back up to your phone's cloud, the server re-compresses again. If you've ever noticed that an old photo looks slightly "smooth" or lacks grainy detail, that's lossy prediction at work. Your phone is literally guessing what the grainy texture should look like and dropping the rest.
Now, when I edit photos, I always work on the original file, never the compressed version. Why? Because the compressed version has already had its predictions baked in. If I try to adjust the exposure of a JPEG, I'm amplifying those predictions, which leads to weird artifacts. It's like trying to edit a rumor instead of the original story.
Scenario 3: AI-Powered Code Completion
I use [GitHub Copilot](https://github.com/features/copilot) for small scripts, and it's uncanny how well it predicts what I want. But now I know why: my comments and variable names are "compression hints." If I write a comment like `// calculate tax from subtotal and state code`, Copilot can predict the next few lines with high confidence because it sees the pattern everywhere on the internet. If I give a vague comment like `// do the thing`, it offers generic code that doesn't fit.
The lesson: be descriptive in your code comments not just for your future self, but for the AI that's helping you. You're literally giving it the context it needs to make a better prediction. That's compression in action.
How to Use This in Your Own Work and Life
Here's my no-nonsense advice for applying this principle.
1. Treat AI as an Ultralong Compression Engine
When you use an AI tool, think about what "training data" it drew from. It's not intelligence; it's a compressed archive of human writing. That means for creative tasks, AI is great at remixing patterns. For rare, highly specific knowledge, it will fail. So use AI for brainstorming, drafting, summarizing, and restructuring—not for authoritative facts.
2. Always Add "Compression Constraints"
Every extra detail in your prompt reduces the possible prediction space. Instead of "write an email to my landlord," say "write a polite but firm email to my landlord asking when the leak will be fixed, and include the previous correspondence date." You'd be amazed at how quickly the output becomes usable.
3. Learn to Read "Compression Artifacts"
In audio, artifacts are glitches from lossy compression. In AI, artifacts are confident false statements. Learn to spot them. Look for weasel words like "research shows" without a citation, or specific numbers that seem too round. When you see those, you're seeing the model's prediction drift from reality.
4. Actually Read the ngrok Article
I know this sounds like a plug, but the [original piece](https://ngrok.com/blog/compression-is-prediction) is worth your time because it connects this to networking and API design, which is eye-opening. Their core argument is that when a system can predict what you're going to send, it doesn't need to transmit the full message. That's how modern APIs are becoming so efficient. If you're a developer or even a power user who uses Zapier and automation tools, this will change how you design your workflows.
The Philosophical Twist
There's something almost poetic about this. Every time you send a text message with autocorrect, you're relying on prediction to compress your typing. Every time you watch a video on Netflix, the codec is predicting frames to save bandwidth. Every time you ask an AI for help, you're summoning a giant compression engine, one that has crammed the ideas and stories of millions of people into a few gigabytes of weights.
And that's the reason AI can feel so human—because human language itself is a compression system. We use analogies, metaphors, and shared context to convey a whole universe of meaning in a single sentence. So next time you struggle with a word that's on the tip of your tongue, don't be frustrated. You're just a lossy compressor that can't remember where the prediction went wrong.
FAQ
Q: Does "compression is prediction" mean AI is just autocomplete?
Technically, yes—modern LLMs are autocomplete on a massive scale. They predict the next token based on context. But because they've been trained on huge amounts of diverse data, they can autocomplete entire paragraphs, code, and even conversations. It's a mind-blowing autocomplete.
Q: How can I make my AI prompts less prone to hallucination?
Add constraints. Ask for sources, limit the scope, and request that the model say "I don't know" when it's uncertain. Also, break down your question into smaller steps so each prediction is simpler. More context usually means better compression.
Q: Is it better to use uncompressed files when working with AI-generated images?
Yes. If you plan to edit an AI-generated image, save it as PNG instead of JPEG. PNG is lossless, so it doesn't discard any pixel data. That means the AI's "predictions" are fully preserved, and you can edit without accidentally amplifying artifacts.
Q: Why do ChatGPT sessions seem to forget earlier messages?
Because they compress. To keep costs and token limits manageable, the model summarizes earlier messages. It's a lossy compression. If you need something remembered, paste the relevant part back into your latest message.
Q: Will understanding compression make me a better AI user?
Absolutely. It moves you from thinking of AI as magic to thinking of it as a prediction engine. Once you understand that, you stop fighting it and start working with it. You give it the context it needs, you verify its guesses, and you use it for what it's best at: recombining all the human knowledge it has compressed into something new.
---
Here's my final take: "Compression is prediction" isn't just a technical curiosity—it's the closest thing we have to a universal law of information. It explains everything from GZIP to GPT, from photo formats to prompt engineering. And it's a lens that will make you a smarter, more skeptical user of every tool you touch. Next time you hit "Send" on that AI-generated email, ask yourself: what did it predict, and what did it leave out? That awareness is worth more than any prompt hack.
Technology
Comments (0)
No comments yet. Be the first to comment!
Leave a Comment