Top
Best
New

Posted by networked 8 hours ago

Can gzip be a language model?(nathan.rs)
268 points | 100 commentspage 2
Tornhoof 6 hours ago|
Previous discussions of that specific page https://news.ycombinator.com/item?id=48557691
tromp 6 hours ago||
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)?
gkbrk 6 hours ago|||
Top contestant in the Hutter Prize uses a neural network for compression. So fair to say, LLMs would perform pretty well compared to gzip.
computably 6 hours ago|||
Even ignoring speed per GP, the Hutter Prize's metric includes the size of the decompressor. LLMs would be disqualified for being larger than 1GB.
londons_explore 6 hours ago|||
And the hutter prize disallows GPU's. If you allow use of a powerful GPU, you can do quite a bit better.
anax32 6 hours ago|||
hallucinations are lossy compression artefacts
asdfsa32 6 hours ago||
lossless vs lossy is the question.
anon48293 6 hours ago||
How lossy? Because I can lossy compress anything into 0 bits.
sire-vc 5 hours ago||
0 bits is just a very small bloom filter.
modin 5 hours ago||
R. Hendricks, D. Chugtai, and J. Dunn, "Lossless compression via optimized middle-out bitstream processing," Pied Piper Inc., Palo Alto, CA, Tech. Rep. 42, Apr. 2014.
networked 5 hours ago||
I was curious to see how this would work with bzip2 and zstd. The source is public at https://github.com/nathanrs/gzipt, and I asked MiMo-V2.6-Flash to fork and modify it in a straightforward way. The answer is that bzip2 produces sequences that don't resemble human language:

  gzipt \
      --corpus data/tinyshakespeare.txt \  
      --prompt $'MENENIUS:\n' \
      --length 200 \
      ;
  
  MENENIUS:
  MtLUMSeptuttyyyxyxyxyxyvyyyxyxyxyxyvyyyxyxyxyxywyvzyxyxyx
  yyxyyyxyxyxyxyxPlyxyxyxyxyxyxyxyxyxtoxzfTUS.zxzzzyzzzvzzz
  vzzzxvzyvyxyxyxyvyxyxyxyvy--,Vdvyxyxyxyxyxyxyxyxyxxy!zFlx
  zzyyxyxyxyvyxyxyxyvyySPffuyuy
Line breaks added. This looks roughly optimized for the most repetitive Burrows-Wheeler transform (https://en.wikipedia.org/wiki/Burrows%E2%80%93Wheeler_transf...). Why are they runs of alternating symbols and not one symbol?

Zstandard produces whitespace with the occasional letter thrown in. To quote MiMo: "As you can see, zstd does not speak Shakespeare. ... zstd encodes a run of one repeated byte as a near-free run-length sequence, and space and newline are the cheapest literals in the corpus: ten newlines cost about the same to append ten bytes of genuine corpus text and less than nonsense does."

maxidog 4 hours ago||
Did you check MiMo correctly performed this unfamiliar task before posting this comment?
networked 4 hours ago||
I did. I read the code to make sure the quality of MiMo's work matched mine for a quick experiment, though not that the code was free from subtle bugs.

This was the main change for bzip2:

  @@ -33,19 +34,16 @@ def candidate_lengths(
       level: int = 9,
       pool: ThreadPoolExecutor | None = None,
   ) -> list[int]:
  -    """Compressed length of ``context + seq`` for each seq, sharing the context.
  +    """Compressed length of ``context + seq`` for each seq.
  
  -    Compresses ``context`` once into a ``compressobj``, then clones its encoder
  -    state per candidate and feeds only that candidate. Identical to
  -    ``len(zlib.compress(context + seq, level))`` for each seq, but the expensive
  -    match search over ``context`` happens a single time.
  +    Unlike ``zlib``'s ``compressobj``, Python's ``BZ2Compressor`` cannot be
  +    snapshotted mid-stream, and bzip2's move-to-front + Huffman stages see the
  +    whole block, so every candidate recompresses the full context. Threads
  +    still scale because ``bz2`` releases the GIL.
       """
  -    base = zlib.compressobj(level)
  -    head = len(base.compress(context))
  
       def length_for(seq: bytes) -> int:
  -        clone = base.copy()
  -        return head + len(clone.compress(seq) + clone.flush(zlib.Z_FINISH))
  +        return len(bz2.compress(context + seq, level))
  
       if pool is not None:
           return list(pool.map(length_for, sequences))
jrmg 1 hour ago||
Is the fact that the original did [compress base]+[compress seq] rather than [compress [bytes + seq]] not important?

(I honestly don’t know is gzip does something different when presented with two chunks as opposed to one, or, if it does, if bz2 has equivalent behaviour - but the difference in the code did stand out to me, and it does seem related to ‘extending the token sequence’)

jeremyjh 3 hours ago||
So, you had an AI write code you don't understand, then posted output you don't understand in a comment on the internet for other humans to read?
mentalgear 6 hours ago||
Interesting approach, I wonder how this could be used as a classifier. :)
networked 6 hours ago||
Check out "Text classification with Python 3.14's zstd module" (https://maxhalford.github.io/blog/text-classification-zstd/, https://news.ycombinator.com/item?id=46942864). I wanted to link it somewhere in the comments. :-)
Sesse__ 6 hours ago||
I've used LZO as a spam classifier on chat. Spam tends to be very content-less and repetitive...
elendilm 5 hours ago||
Good article.

Compression is a property of language.

A seemingly simple sentence like "I had lunch" has enormous amount of information compressed inside it.

The word lunch is a compressed form of "having food at noon" while "noon" in turn is a compressed form of "Sun's position against Earth's rotation" and so on and so forth.

Every sentence has layers of compressed sentences. How many layers one chooses to decompress is up to the person.

relevant_stats 5 hours ago||
Yay, another mostly AI authored piece with vibe-coded aesthetics.

Some will say that I should 'judge the idea, not the form'.

But if the author didn't find enough strength to write alone a short ~700 words summary about his work, it means he himself isn't that interested or enthusiastic about it. Why should others bother then? Particularly since low-effort like that signals possibility the whole work is superficial and derivative.

marand23 5 hours ago||
I thought it was interesting.
relevant_stats 1 hour ago||
so did I, that's why I clicked.
DonHopkins 2 hours ago||
I'm judging the ideas in your post, not its form.

Your claim that suspected AI assistance proves the author isn't interested -- and therefore that the work is probably superficial -- is unsupported.

The article presents a working experiment, explains why naive decoding fails, describes the beam-search fix, and links the code.

Dismissing all that with presumptuous personal speculation and banal boilerplate drive-by anti-AI snark adds absolutely nothing to the conversation -- and that is intrinsically poor form.

You couldn't even find enough strength to criticize anything beyond the form, while your own form is lackluster.

Ironically, an LLM could have written your comment and improved its form without losing anything distinctive.

relevant_stats 1 hour ago||
> I'm judging the ideas in your post, not its form.

and simultaneously you write that 'my form is lackluster' and that 'an LLM could have written your comment and improved its form without losing anything distinctive'. We are having ourselves a small contradiction, aren't we.

Be my guest, enjoy chatbot writing and drowning in slop. But don't encroach upon my freedom to protest it.

DonHopkins 1 hour ago||
Ironic, isn't it? Yet you continue your lackluster form devoid any criticism of ideas. All you can criticise is form, yet my criticism of your ideas still stands:

Your claim that suspected AI assistance proves the author isn't interested -- and therefore that the work is probably superficial -- is unsupported.

So I'm encroaching but you're only protesting, huh? I also have the freedom to ironically protest the poor form of your inability to criticize ideas, as well as your poorly formulated unsupportable ideas.

relevant_stats 56 minutes ago||
> Ironic, isn't it? Yet you continue your lackluster form devoid any criticism of ideas.

Pointing out someone's contradiction is now being 'critical of form'? And someone's contradicting themselves is 'ironic'?

Now I'm not even sure you know the meaning of words you use. EOT from me.

nelox 5 hours ago||
Only if it can run DOOM.
DonHopkins 2 hours ago|
Will Wright once described the same connection from the opposite direction: compression as procedural content generation.

In the 2023 discussion of "Demoscene accepted as UNESCO cultural heritage in The Netherlands" I posted a transcript from a video of Will Wright discussing the demo scene:

https://news.ycombinator.com/item?id=36599415

Will Wright Discusses the Demoscene:

https://www.youtube.com/watch?v=m7iuFVmTJus

>You can take any piece of content in the game, and imagine an algorithmic solution to it. Or also, you know, a way that the player could customize that object of thing.

>There's this group in Europe called the Demoscene that make these very elaborate demos for a computer that fit into very tiny little memory blocks, you know like 64K of memory, and you run the thing, and in fact it algorithmically generates about 100 megabytes worth of data, you know these rich 3D environment, generated music, generated wave files, generated animation.

>And they're developing techniques to generate, you know, huge amounts of interesting data, with very very simple, elegant, compression algorithms.

>And this is a skill that game developers used to have, back in the 8-bit days. That was the only ways to do a game like Karateka(?), was to find all these little tips and tricks to compress things and generate them algorithmically.

>But since the CD-ROM came out, and very cheap hard drives, storage is cheap, so basically we've lost that skill set, and now we attack all those problems with brute force. I think we've lost something by dropping that skill set.

[...]

https://news.ycombinator.com/item?id=36613058

[...] Here's a simple low-tech pre-LLM example that shows the equivalence of compression and procedural content generation:

Take a huge text file of HN postings, and compress it with gzip or compress or some other robust compression algorithm. The better the algorithm, the more the output will look like random noise. Then slice the compressed file in half, and replace the second half with random numbers. Then uncompress it. You'll find that at the point you sliced it, it keeps on writing out almost plausible text for a while, consisting of highly probably snippets of commonly encountered words and phrases, then goes downhill towards incoherence. It's not as coherent or confident as an LLM, but the point is to show how low the bar is for using compression for procedural content generation.

LLMs are essentially a form of compression of the world's knowledge or whatever they're trained on, not just word frequencies or pixel patterns, but also concepts and ideas. [...]

More comments...