Skip to content
Trending storyPast story

Can gzip be a language model? Author uses DEFLATE compressor for text generation

1 report1 sourceupdated 8 days ago

What happened

Summary

Nathan Barry 把 gzip 背后的 DEFLATE 压缩算法改成了一个语言模型,完全不依赖神经网络。核心逻辑是:压缩就是预测——一段文本如果能被压得更小,说明模型“更预期”它出现。他让 gzip 在字节序列上做 beam search,找出最容易被压缩的续写,结果生成了看起来像莎士比亚、但语义不通的文本。代码只有纯 Python,依赖 zl...

Coverage

Follow the reports to see the story from different sides.

Sep 22
  1. Hacker News front page
    Can gzip be a language model? Author uses DEFLATE compressor for text generation

    Nathan Barry turns gzip's DEFLATE into a language model—no neural network, just compression. The idea: compression is prediction. A continuation that compresses smaller is more 'expected.' He uses beam search over byte sequences to find the most compressible continuation, producing Shakespeare-like output. It's not coherent, but clearly captures corpus structure. Code is pure Python with zlib. The post doesn't disclose specific hyperparameters or evaluation metrics, but shows sample outputs.