conv.

All stories
TechFading · day 2

Researcher demonstrates gzip as functional language model using compression

A programmer shows that the standard compression tool gzip can generate text by treating compression as prediction, without neural networks or learned parameters.

What to know

  • Nathan Pemberton published a technical demonstration that gzip, the standard compression utility, can generate text by exploiting the mathematical equivalence between compression and prediction, without using neural networks or learned parameters.
  • The approach uses beam search to score candidate text continuations by their compressed length when added to a primed context, with better compression indicating higher predicted probability.
  • Generated output shows the model captures patterns from training data but lacks the coherence of neural language models; commenters note technical limitations including incomplete search of the possibility space and that other compressors like bzip2 fail to produce readable text.

The dispute Whether the beam search approach explores sufficient possibility space to demonstrate gzip's true capacity as a language model, or whether results represent only a lower bound on performance. · positions read across 31 posts and comments

many voices

The compression-prediction equivalence is intellectually elegant but practically limited compared to neural models.

  • “This is fun, but historically people have gone a bit overboard with saying that models like this, or n-gram language models, are anywhere close to large neural network models.”

    montebicyclelo · Hacker News ↗
some voices

The compression principle opens interesting research directions beyond text generation, including classification and code generation.

  • “The prompt (or really, the tokens) would then be the compressed version of the codebase or the text.”

    berkes · Hacker News ↗

“every prediction model is inherently a compressor, and all compression algorithms are prediction models.”

Language Modeling is Compression paper · Blog article

Nathan Pemberton Researcher/author

How it unfolded 4 developments, newest first · click a bar or a number to jump articlespostscomments

Peak 6 pieces in one hour at Sep 22, 9 AM; 34 pieces over 2 days (2 articles · 4 posts · 28 comments) Sep 22, 1 AM — 3 pieces · 2 articles · 1 post — Newswires 2, Hacker News 1Sep 22, 2 AM — 2 pieces · 2 comments — Hacker News 2Sep 22, 3 AM — 3 pieces · 3 comments — Hacker News 3Sep 22, 4 AM — 5 pieces · 5 comments — Hacker News 5Sep 22, 5 AM — 4 pieces · 4 comments — Hacker News 4Sep 22, 6 AM — quietSep 22, 7 AM — 1 piece · 1 post — Mastodon 1Sep 22, 8 AM — 2 pieces · 1 post · 1 comment — Hacker News 1, Mastodon 1Sep 22, 9 AM — 6 pieces · 6 comments — Hacker News 6Sep 22, 10 AM — 2 pieces · 2 comments — Hacker News 2Sep 22, 11 AM — 1 piece · 1 comment — Hacker News 1Sep 22, 12 PM — quietSep 22, 1 PM — quietSep 22, 2 PM — 3 pieces · 3 comments — Hacker News 3Sep 22, 3 PM — quietSep 22, 4 PM — quietSep 22, 5 PM — quietSep 22, 6 PM — quietSep 22, 7 PM — quietSep 22, 8 PM — quietSep 22, 9 PM — quietSep 22, 10 PM — quietSep 22, 11 PM — quietYesterday, 12 AM — quietYesterday, 1 AM — quietYesterday, 2 AM — quietYesterday, 3 AM — quietYesterday, 4 AM — 1 piece · 1 post — Mastodon 1Yesterday, 5 AM — quietYesterday, 6 AM — quietYesterday, 7 AM — quietYesterday, 8 AM — quietYesterday, 9 AM — quietYesterday, 10 AM — quietYesterday, 11 AM — quietYesterday, 12 PM — quietYesterday, 1 PM — quietYesterday, 2 PM — quietYesterday, 3 PM — quietYesterday, 4 PM — quietYesterday, 5 PM — quietYesterday, 6 PM — 1 piece · 1 comment — Hacker News 1Yesterday, 7 PM — quietYesterday, 8 PM — quietYesterday, 9 PM — quietYesterday, 10 PM — quietYesterday, 11 PM — quietToday, 12 AM — quietToday, 1 AM — quiet 12–4
yesterdaynow · 2:56 AM ET
  1. background

    Nathan Pemberton publishes gzip language model experiment — A technical article demonstrates that gzip can perform language modeling by exploiting the compression-prediction equivalence: sequences that compress well are those the model predicts as likely. The author primes gzip with a Shakespeare corpus, uses beam search to score candidate continuations by their compressed length, and generates text without neural networks or learned weights.

  2. 4

    Commenter tests other compressors; bzip2 fails to generate coherent text

    A user reports attempting to adapt the gzipt code to use bzip2 and zstd compression algorithms with AI assistance, finding that bzip2 produces only nonsensical character sequences rather than text resembling language.

    • wim_v12e@scholar.social

      "Can gzip be a language model?" tl;dr: "It turns out, kind of? "

      wim_v12e@scholar.socialMastodon21h ago10▲view on Mastodon ↗
    2 more of the top 3 · 24 posts in this stretch
    • I think language itself is compression, so the arxiv paper tracks for me.Viz. if Language is compression (of thought / culture / the tacit je ne sait quois of being-to-being communication etc.), then definitionally, Language Modelling must also be Compression.Except, language is an arbitrarily lossy compressor, who's "compression-prediction…

      adityaathalyeHacker News1d agoview on Hacker News ↗
    • newsyc250@toot.community

      Can gzip be a language model?: https:// nathan.rs/posts/gzip-lm/ Discussion: http:// news.ycombinator.com/item?id=4 9797323

      newsyc250@toot.communityMastodon1d agoview on Mastodon ↗
    all of them →
  3. 3

    Commenter cites prior work on compression-based classification

    A commentator notes that gzip-based text classification (comparing compressed file sizes across topic domains) was explored by researchers at Waikato University and references the Hutter Prize competition focused on compression.

    • Yes: you can classify a test file by topic with gzip as follows: gzip -9 sports.txt testfile.txt gzip -9 politics.txt testfile.txt gzip -9 business.txt testfile.txt (ass. sports.txt politics.txt and business.txt are text docs pertaining from the sports, politics and business domains, respectively, and have equal size)The test file belongs to the…

      jll29Hacker News1d agoview on Hacker News ↗
  4. 2

    Commenter explores compression-as-prompt concept in reverse

    A Hacker News commenter extends the logic, proposing that reproducible language models could treat generated code or text as compressed versions of themselves, where the prompt (or tokens) becomes the compression.

    “The prompt (or really, the tokens) would then be the compressed version of the codebase or the text.”
    — berkes
    1. first by HN Best, 2d ago · also HN Frontpage

    • I've been pondering on something related: can an LLM be a chat?Some models are reproducible, in that the same prompt will generate the same output. Say that we could wire up such a model to generate some code.In that case, we could create a prompt that generates, say, an entire codebase, or a large piece of text. The prompt (or really, the tokens)…

      berkesHacker News1d agoview on Hacker News ↗
    2 more of the top 3 · 3 posts in this stretch
    • 3blue1brown did a series on this topic: https://www.youtube.com/watch?v=l6DKRf-fAAM https://www.youtube.com/watch?v=GlYgs6v2YfU (i think one more is yet to release)

      GodelNumberingHacker News1d agoview on Hacker News ↗
    • This is fun, but historically people have gone a bit overboard with saying that models like this, or n-gram language models, are anywhere close to large neural network models. There is certainly a connection though.

      montebicycleloHacker News1d agoview on Hacker News ↗
    all of them →
  5. 1

    Commenter questions search completeness of beam approach

    A Hacker News user raises a technical concern about whether the beam search explores enough of the possible sequence space to find truly optimal compressions, noting the search may only provide a lower bound on gzip's effectiveness as a plausibility tester.

    “It turns out, kind of? It's not exactly coherent text, but it clearly knows something about the text. Much more than I expected gzip to know.”
    — Nathan Pemberton · source
    • give it a normal text prompt, and it continues that prompt by searching for the byte sequences that compress best. One moment, how are we supposed to know how well that search was done? There is no way to search a meaningful part of the search space.So the result only gives us some lower bound of how well gzip works as a "plausibility tester" of a…

      mgHacker News1d agoview on Hacker News ↗
    2 more of the top 3 · 3 posts in this stretch
    • I'm more interested in the converse question: how well does an LLM perform as a compressor, compared to gzip (ignoring its insanely lower speed)?

      trompHacker News1d agoview on Hacker News ↗
    • This tracks perfectly with Winrar being more profitable than OpenAI... coincidence? I think not!

      CulonavirusHacker News1d agoview on Hacker News ↗
    all of them →

What people are saying 15 voices from 1 site · best of 31 · verbatim

Still unanswered
  • How does the performance of gzip compare to other compression algorithms like bzip2 or zstd for language modeling?
  • Could this approach work with video compression algorithms that encode semantic meaning like motion vectors?