The Intricate Link Between Compression and Prediction
You can beat deep learning for text classification with gzip + a short Python script, according to this paper.1 The idea: Use k-nearest neighbors based on compressed documents. Thanks for reading Mindful Modeler! Subscribe for free to receive new posts and support my work. Subscribe Here’s how it works: Compress (zip) the new, unlabeled document and measure file size (= C(x)). Compress 1 training document and measure file size (= C(y)). Concatenate the new document and the training document, compress the resulting doc, and measure file size (= C(xy)). Compute the normalized compression distance: Repeat this procedure for all documents in training data. This gives you the distances between your new document and all training docs. Pick the k documents with the smallest NCD and classify the new document according to the majority class of the k documents. But why does this work at all? If you haven't heard about the amazing connection between compression and prediction — you're in for a tr
The Intricate Link Between Compression and Prediction How Gzip and K-Nearest Neighbors Can Outperform Deep Learning Models Christoph Molnar Oct 24, 2023 22 3 1 Share You can beat deep learning for text classification with gzip + a short Python script, according to this paper . 1 The idea: Use k-nearest neighbors based on compressed documents. Thanks for reading Mindful Modeler! Subscribe for free to receive new posts and support my work. Subscribe Here’s how it works: Compress (zip) the new, unlabeled document and measure file size (= C(x)). Compress 1 training document and measure file size (
Explore this link on the map →related reading
- Can gzip be a language model?nathan.rs
- [2309.10668] Language Modeling Is Compressionarxiv.org
- Data Compression Explainedmattmahoney.net
- LLMs can invent their own compression - Rajan Agarwalrajan.sh
- ChatGPT Is a Blurry JPEG of the Web | The New Yorkernewyorker.com
- Aman's AI Journal • Primers • Ilya Sutskever's Top 30aman.ai
- 0812.4360arxiv.org
- 500'000€ Prize for Compressing Human Knowledgeprize.hutter1.net
- LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Modelsarxiv.org
- The Little Book of Deep Learningfleuret.org
- [1503.02531] Distilling the Knowledge in a Neural Networkarxiv.org
- Machine Learning, Kolmogorov Complexity, and Squishy Bunniestheorangeduck.com