Compression is prediction

(ngrok.com)

261 points | by nikolay 6 hours ago

41 comments

  • farfatched 5 hours ago
    This is the thesis behind the "Information Theory, Inference, and Learning Algorithms" course that was taught at Cambridge University.

    > Why unify information theory and machine learning? Because they are two sides of the same coin. In the 1960s, a single field, cybernetics, was populated by information theorists, computer scientists, and neuroscientists, all studying common problems. Information theory and machine learning still belong together. Brains are the ultimate compression and communication systems. And the state-of-the-art algorithms for both data compression and error-correcting codes use the same tools as machine learning.

    Book (creative commons): https://www.inference.org.uk/mackay/itila/book.html

    Lectures: https://m.youtube.com/playlist?list=PLruBu5BI5n4aFpG32iMbdWo...

    • chermi 4 hours ago
      I had a long ranting comment I deleted. I just don't like this trend of people presenting work in a way that makes you think some combo of 1) they discovered from scratch themselves 2) it's new 3) they didn't try to cite or acknowledge where they learned it/point to good sources 4) they don't really care about trying to teach something deeply, they want shiny stuff that makes them seem deep.

      This post references specific parts/calculations, but you'd never know it was not news if you didn't know better.

      • farfatched 2 hours ago
        I don't think this is a fair critique.

        The author of the post uses standard terminology like entropy coding and arithmetic coding, and cited a paper "in 2023, Google DeepMind released a paper arguing that language modeling and compression are two views of the same thing" which discusses it further.

        This blog post is great. Well explained, and clearly took a lot of effort.

        I don't interpret it as them claiming to have to discovered it independently.

        • bonoboTP 1 hour ago
          Citing 2023 makes it seem like this is newer than it is. Compression, prediction and intelligence have long been known to be deeply connected.
      • teekert 35 minutes ago
        The post says this is all part of gzip and LLMs, what are you saying? I’ve been using gzip my entire life. I read between the lines “this is common knowledge” throughout the piece. Throwing in some names and dates only makes this super clear story harder to read (and more like studying then the playful exploration this post was intended as).
      • hellohello2 37 minutes ago
        You're reading this the wrong way I think, citations aren't given because its obviously a pedagogical article about well established stuff. Much like you wouldn't give citations in a blog post explaining calculus.
      • bonoboTP 1 hour ago
        I'm of two minds here. The pro is that the "you could have invented this" walkthrough from first principles is more engaging than "and then so and so introduced this term in 1972 and the definition is such and such". This style is a reaction to that boring and dry teaching style and tries to push towards what eg Feynman pointed at in the Brazil critique.

        The con is that you don't get to understand and see any of the history of the ideas or even the ballpark when it was discovered, you attribute it to the blog mentally and you don't know what is how new or old and can't reference it properly when talking to others.

      • mpalmer 3 hours ago
        I'm glad to see someone feels similarly. There is nothing wrong with ignorance, but there's no excuse mistaking learning for invention. Especially from someone bearing the title "Developer Educator"

        I don't think it's the case here, but worth noting too that LLM-written blog posts adopt this tone seemingly by default.

        Never the least bit of surprise, wonder, doubt, or frustration to get in the way of the steady staccato beat of metaphors, conclusions... and three-item lists.

        • bch 2 hours ago
          > I'm glad to see someone feels similarly. There is nothing wrong with ignorance, but there's no excuse mistaking learning for invention. Especially from someone bearing the title "Developer Educator"

          >> a Developer Educator at ngrok with a passion for nerd-sniping developers.

          Maybe more the latter than former...

      • exe34 3 hours ago
        Reminds me of Stephen Wolfram "discovering" things in the sense that other people would say "today I learnt".
        • jagged-chisel 2 hours ago
          I find it bothersome that language works this way. You can spend your whole life discovering things that are well known by the rest of the world. But the minute that you mention to a large group that you “discovered” it, suddenly you’re taking credit for discovering it for all of mankind.
        • chermi 2 hours ago
          Wolfram was my example in my original rant!
      • TeMPOraL 3 hours ago
        And yet to this day, in AI threads, so many people act shocked and surprised if you dare follow the obvious implication and claim that understanding is a form of lossy compression.
        • bonoboTP 1 hour ago
          Of course it is but again "X is just Y" is often used to mislead. A brain is just neurons! A computer is just transistors! An LLM just predicts the next token! It's just like a parrot! It's just like a blurry jpeg of the internet! Kinda yes, but what do you use this for? It's a bad intuition pump is it leads people to conclude demonstrably false things about capabilities.
        • kazinator 3 hours ago
          Shorter description isn't understanding, let alone of it is lossy.

          When you shorten a description in a lossy way, you are deciding a priori that some differences in the object don't matter, and it's not because you understand the object, but because it serves your goal of shortening the description.

          • Dylan16807 2 hours ago
            Or you actually do understand it.

            You can't just assume smaller is better but it often is. And very often it's more information-dense.

            • kazinator 23 minutes ago
              You can compress syntax, losslessly even, with zero understanding of its semantics. Zero understanding not only imbued into the compressor/decompressor, but even the designer of the compressor doesn't require understanding the semantics. Actually, even of the syntax.

              A compression program can compress a book written in a language that the author of the program doesn't understand, on a topic he knows little about.

        • ablob 3 hours ago
          If you can predict other things by understanding something, is it truly lossy compression?
    • smath 2 hours ago
      Ah Sir David MacKay. I so respect him. Great explainer and speaker. He had built this text entry tool called Dasher [0] - that I'd heard him introduce at Princeton around 2006. It was basically an early language model that predicted which characters are more likely than others, given what you've already types and it would adjust the sizes of the available next characters based on their probabilities.

      [0] https://dasher.at/about/

      • farfatched 2 hours ago
        He really was fantastic, and prolific in multiple fields.

        He wrote https://www.withouthotair.org/ (creative commons) and was the Chief Scientific Advisor to the UK Department of Energy and Climate Change.

        Dedicated to "to those who will not have the benefit of two billion years' accumulated energy reserves".

      • TacticalCoder 1 hour ago
        > It was basically an early language model that predicted which characters are more likely than others, given what you've already types and it would adjust the sizes of the available next characters based on their probabilities.

        "adjust the sizes of the available next characters": you mean assigning less bits to characters the most likely to come next, and more bits to the least likely characters to come next?

        So it's not totally unlike adaptive Huffman coding but instead of updating the tree on already visited characters, here the tree with the weights of the possible following character is predictive?

    • blahblahson 39 minutes ago
      Better prediction being better compression is Shannon 1948, and the link to machine learning is MacKay 2003 at Cambridge.
    • melenaboija 4 hours ago
      This is basically a thesis supported by Shannon’s information theory.

      Any rigorous CS program should cover this in depth.

  • walrus01 3 minutes ago
    On a slightly related topic, static on disk files of LLMs are not incompressible, I have a number of "archived, maybe I'll use it later" Q8 quantized GGUF files that are about 90% of their original file size when run through xz with default options. It's not a ton of disk space savings, but disk space also isn't as cheap as it used to be. BF16 GGUFs will compress a lot.
  • sheeeeesh 5 hours ago
    Grant Sanderson has an excellent video on the same topic [0]. It's part of a series that is ongoing.

    [0] Compression is Intelligence Part 1 - https://youtu.be/l6DKRf-fAAM?si=yyLWq8x4sSRkWd98

    • zahrevsky 5 hours ago
      I wonder if the author of the article knew about the series, or do they both just independently came across this topic to talk about it.
      • epistasis 4 hours ago
        Anybody working in the field will be very familiar with these concepts.
      • internetter 2 hours ago
        common theory. see https://prize.hutter1.net/
        • AnotherGoodName 40 minutes ago
          And the Hutter Prize for AI which measures how good AI is by measuring how well it compresses data is over 20 years old now just to really drive the point home.
      • soulofmischief 4 hours ago
        It's basic information theory, which has been around since the end of WWII. It's a common topic today because some of its subtle insights are becoming increasingly relevant in our current era of AI, as we learn to understand these black boxes.
      • cyanydeez 5 hours ago
        it was vaguely in my understanding of information & intelligence with compression; it was also brought up in several of the initial trials against AI companies where they discussed how the AI is akin to compression.

        So they're both sourcing a bit broader zeitgeist.

  • ssivark 5 hours ago
    Nope; there is a bit more nuance and the distinction is important.

    Compression is functionally equivalent to prediction when the data distribution is exactly representative of all future problems. The story changes drastically if you want generalization -- because the test distribution could be arbitrarily different, even if it had the same support! Eg: you observe a rare edge case in your training data and (lossy) compression could simply ignore it. But if you wanted generalization in that particular part of the space -- either because an adversary was testing you, or for design freedom where you choose to build in that specific corner -- then you don't just want data compression, but good prediction performance on a test distribution which peaks in that corner.

    Assuming that the training data distribution is exactly the distribution you will ever care for is implicitly doing a lot of the heavy lifting in the claim that compression = prediction, and I'm peeved at how much this statement is unthinkingly repeated like a manifesto.

    There is nothing natural about the training data distribution, especially if the data generation process is exploratory while the downstream usage will be exploitative.

    • porphyra 4 hours ago
      How does that invalidate the "compression is prediction"? If the future data is different and you failed to generalize, then the failure to predict means you got worse at compressing and have to spend more bits storing the new information. Conversely, if the future data is the same as that you've seen previously, you could predict it very well, and compress better as a result.
      • gr_norm 4 hours ago
        A maximally efficient compressor for the existing data distribution is not in general (and often will not be) maximally efficient for future data. The former may only be enabled by convenient local optima of the input distribution that a compressor accounting for the latter could not take advantage of.

        For instance, consider the distribution of strings drawn from the language '0+'. Now consider the same for the language '[01]+'. A compressor looking at only the strings of the first language within those of the second can do a much better job if it does not have to account for future data.

        This also relates distantly to the idea of overfitting in machine learning.

        • AlotOfReading 4 hours ago
          It might not be optimal, but it's not wrong to call it the best available guess. That's basically assuming Occam's razor / Solomonoff induction. Hutter published a bunch of work about what it means to have an "optimal" compressor and famously spent the past couple decades running a compression contest on the idea that it'd lead to insights in AI.
          • versteegen 31 minutes ago
            There is a distinction between a compressor for a fixed dataset and one for an unknown population from which we have a sample. The optimal compressor for the sample may be the single best guess for the population, but that's not what Solomonoff induction does. It begins with a prior that allows all possible programs, and it never assigns all probability to the single optimal compressor, so it has no problem with the all-zeroes example.

            But the Hutter prize (of which I'm a big fan) is for ever-more-optimal compressors, and in fact many of the solutions don't generalise to other input data without stripping out various tricks.

            • AlotOfReading 14 minutes ago
              I think it's better to think of the hutter prize as a challenge to see how close people can get to efficiently approximating AIXI without the exponential cost of AIXItl. The fact that winners don't generalize well is just that they're not great approximations, because the behavior is different in the limit.
          • iwontberude 2 hours ago
            [dead]
      • tcgv 4 hours ago
        "Compression can be prediction" would be more accurate.
      • GornRok 4 hours ago
        [dead]
    • AnotherGoodName 19 minutes ago
      The record setting file compressors are all very generalizable. This comes about because you score compression by adding the program size (including any training data or dictionary) to the compressed data. If they didn't score it this way you could just ship a dictionary of the test data and your program just prints that. So of course they combine it and effectively measure the Kolmorogov complexity.

      This means that training data isn't that helpful to top of the line compressors. eg. Fabrice Bellards nncp that's currently the record holding compressor for enwik9 is an LLM that learns on the fly. It's 628KB as shipped (LLM code complexity is high) and it wins on data sets gigabytes in size due to it's ability to create the training data on the fly. No pre-trained LLM comes close when you measure it as above (program size + compressed result).

      So it's really not worth that much concern. There's a reason we all say AI is compression and we dismiss comments like the above. They don't pan out. No one's shipping significant dictionaries or pre-trained data. You want to win competitive compression? You'd better have raw code that learns on the fly and is naturally generalizable.

    • bjt 23 minutes ago
      The point you make is observed in compression too, though, once you start optimizing for certain use cases. When LAME encodes sound into an mp3 it doesn't give equal weight to all frequencies. It throws away data outside the range of human hearing to leave more room for what's in-range.
    • variadix 4 hours ago
      I’m not exactly sure what distinction you are trying to make, but a compressor that generalizes from currently observed day to potential future data _is_ a better compressor, as it will have better predictions as it observes more of the source data distribution. Maybe you are making a point about whether compressors can “learn” after compressing the input data, but this also isn’t a fundamental property of compressors. Also compressors do have to deal with non-stationary data sources, so it also isn’t correct to say a compressor only models stationary distributions.
    • pornel 3 hours ago
      You're just assuming a flawed implementation of a predictor and complain that it's flawed. That doesn't invalidate the general premise that predictors are compressors.

      Predictors don't have to give you some corpus-average probability. They can give probabilities adjusted per symbol. The probability could even be exactly 1 for some symbol when the predictor is absolutely certain (and then it costs 0 bits to encode).

      If you had a magic oracle predictor that already knew all the data you wanted to send, you'd have perfect compression.

    • altcognito 3 hours ago
      > Compression is functionally equivalent to prediction when the data distribution is exactly representative of all future problems.

      At some level, nothing is representative of all future "problems".

      I think as far as corner cases is concerned, people can optimize for what they think matters. Larger models, higher sensitivities, better filtering.

      Beyond this, I don't know what you're peeved by. There's no manifesto, there's no claiming that any particular method to prediction is perfect yet.

    • canjobear 3 hours ago
      Compression is still prediction, the predictions just might not be good.
    • omneity 2 hours ago
      I'd approach this distinction differently. Prediction from compression is valid within the distribution of the compressed data. Which brings it much closer to LLMs in this case (can an LLM talk about a topic it has never seen in training? unlikely if it cannot be derived from other training data)
      • monkeydreams 2 hours ago
        > Which brings it much closer to LLMs in this case (can an LLM talk about a topic it has never seen in training? unlikely if it cannot be derived from other training data)

        This is a great experiment. Do some world building offline about Smergle the Keen finding the Hoopla of Kynashiusous. Then ask ChatGPT what reagents would have been more effective in breaking through the borantiastic door than squeeble stomach juices.

        Of course we know the answer - it will either drop into a 'I have only been trained on data before blah blah blah' or 'I cannot talk about current world leaders' or 'I have not been trained on your hackneyed and unpublished romantasy saga, why don't you tell me about it?'

        On the other hand, if it is aware of the general concepts of your concept, and has bridging concepts for related topics it has been trained upon, it might try to apply the general concepts to a specific but different scenario.

    • usernametaken29 2 hours ago
      I think Hutter would vehemently disagree with you on that one ;)
    • jbs789 5 hours ago
      That’s interesting.

      Also sparked the thought that the assumption only holds if the future looks like the present.

      • vanviegen 4 hours ago
        If your compression algrotihm is deep enough (think LLM), it will capture a lot of abstraction, making it compress well even in future cases that differ from the passed but fit the scheme in some other way.
        • goatlover 4 hours ago
          But not cases that don't fit the scheme, and the future always has some of those. We are continually surprised by what comes next, and have been notoriously bad at predictions that aren't clear trends (until those trends change).
    • schopra909 5 hours ago
      100% agreed.
  • woliveirajr 5 hours ago
    There is Compression done by Prediction by partial matching [0]

    There is the Kolmogorov Complexity [1], Normalized Information Distance [2] and Normalized compression distance [3] that correlates those.

    Finally, there's the Pre-Big Bang Informational Compression and the Delayed Release of Antimatter [4]

    All big {rabbit/black} holes to lose some time, if you have any.

    [0] https://en.wikipedia.org/wiki/Prediction_by_partial_matching

    [1] https://en.wikipedia.org/wiki/Kolmogorov_complexity

    [2] https://homepages.cwi.nl/~paulv/papers/chapter08.pdf

    [3] https://en.wikipedia.org/wiki/Normalized_compression_distanc...

    [4] https://philarchive.org/rec/GREPBI

  • saltcured 1 hour ago
    I think a better headline would be something like: Compression is Abstraction and Decompression is Extrapolation.

    Many of the debates in the comments seem to come down to whether people believe prediction and extrapolation are synonymous.

  • zhxiaoliang 12 minutes ago
    Compression is prediction. LLM is also about prediction. But that doesn't make them the same.

    In LLM, the important thing is the trajectory of transformation, not some compressible static inventory of predictions. A ZIP file is compressed because its contents contain redundancy. An LLM, however, can predict because training has shaped a dynamical system such that particular inputs cause particular transformations. IMO, Those are not the same phenomenon, even though probability theory connects them at the output.

    Basically, Compression exploits predictability. Intelligence though, creates useful prediction.

  • throwaway_7274 5 hours ago
    This perspective is a useful source of intuition against the “LLMs can’t have new ideas, they’re just next-token-predictors” style arguments. What if you shift your perspective to thinking of training as optimization over a vast parametrized family of compression algorithms? Well, it suddenly looks a lot more plausible that “new” “ideas” can emerge from that process!
    • AnotherGoodName 6 minutes ago
      Prediction is literally what's allowed computers to make amazingly creative chess and go moves that a human would never have thought of.

      More generally prediction allows you to path find towards a solution to reach some goal that no human might ever see.

      If someone states "LLMs can't have new ideas because they only predict" you have to laugh. Prediction literally enables new ideas as you use those predictions to path find to a goal.

    • glial 5 hours ago
      > it suddenly looks a lot more plausible that “new” “ideas” can emerge from that process

      This is not intuitive to me. It seems like a "new idea" is something that (almost by definition) isn't in the training set. Can you elaborate a bit?

      Edit: but perhaps a good model could arise from training, which would be a good idea in the sense that parsimonious ideas are good scientific ideas.

      • redhed 5 hours ago
        How I see it, is if the human brain does lossy compression/prediction of the natural world that learns from its "training set" (sensory inputs) and we have been able to come up with new ideas, then it seems like AI would be able to as well.
      • throwaway_7274 4 hours ago
        Wow, I didn’t even notice how badly I underexplained that! Yeah, thanks, your edit is what I had in mind. jbay808 explains it well, too.
      • AnthonBerg 4 hours ago
        An idea is a construction on existing concepts, a newer idea links more previously unlinked concepts.
      • jbay808 5 hours ago
        Imagine you're curve-fitting a bunch of data points on, say, the orbital motion of planets and asteroids. You get tons and tons of data on these orbital motions, and then put it into a huge black-box optimization algorithm that compresses the heck out of it. It compresess and compresses until it can't find a more compact representation, no matter how much more effort it applies. The output is a function, where you can provide an initial condition, and it gives you the predicted future orbital position at any requested time.

        Of course, one thing you get out of this is a great curve-fit for your existing data, which you can interpolate to find the position of any observed planet at any desired time.

        But could this function also succeed in predicting the orbital motion of objects that aren't in the dataset? If I spot a new comet, and put it into the compressed function, would I get an accurate prediction of its orbital motion, even though that object wasn't in the training data?

        The answer is "it depends, but probably yes". Newton's laws of orbital motion turn out to be simple compared to the size of the training data. So if the black-box compression has done a good job, it might output that function, or a close approximation of it. With a sufficient quantity of sufficiently accurate data, it might even improve on it; random errors can't be compressed, but where the deviations between observations and Newton's law turn out not to be random but rather the influence of an unobserved gravity source, or general relativity, the black-box algorithm will likely capture that as well.

        A lot of people seem to think of the training process as curve-fitting data (the "stochastic parrot" model), but I think of it more as "solving an inverse problem to approximate the unknown source that generated the training data". Machine learning has proven to be quite good at solving inverse problems, and this is just a very abstract one of them.

        (A forward-problem is something like solving for the electric fields from a set of charged particles; an inverse problem, https://en.wikipedia.org/wiki/Inverse_problem, is one where you have data on the electric fields at various points and want to reconstruct the arrangement of charged particles that produced it. Or more generally, you have sampled data on the output of an unknown process, and want to reconstruct the process that produced the data).

        The inverse-problem-solving happens at the ML training step. The language model itself, that comes out of that, is solving the forward-problem: it has a generative-process baked in and now it's generating new data from it. But if the training process has done a good job of compression, it will certainly be able to generate valid new ideas that aren't in the training set, because the inverse model has solved for the underlying features of the real process that generated the training data, and those features can generate additional valid outputs that it wasn't trained on.

        • SgtBastard 3 hours ago
          > A lot of people seem to think of the training process as curve-fitting data (the "stochastic parrot" model), but I think of it more as "solving an inverse problem to approximate the unknown source that generated the training data"

          I just wanted to confirm your underlying point here: training a model isn’t about finding a function that fits the observed data (even though that’s the outcome) but instead finding an approximation of the unknown source that generated the source data in the first place.

          In the case of LLMs an approximation not of a human but of the sum of humanity that produced the training copora?

          • jbay808 1 minute ago
            Yes, exactly. And it's the compression that makes this happen. If it was just curve-fitting then the LLM really would act like a stochastic parrot, and it wouldn't generalize; also the model would also need to be much much bigger. As it is, the models are very big but they're still tiny compared to the dataset that they compress, so the compression process forces them to approximate a solution to the inverse problem.

            And yeah, that means the base model training process is solving the inverse problem of finding an approximation for the processes that generate all human records and also anything else in the dataset with a compressible pattern to discover (weather data, etc). So it's not surprisng that some kind of world model emerges out of this.

      • cyanydeez 5 hours ago
        Once MP3s were invented, I had the idea for the Apple IPOD; but obviously I didn't have a giant manufacturing wing, the ability to make small hard drives, or anything else.

        I don't think Apple invented the ipod anymore than I invented it; LLMs likely would have also come to the same conclusion about an ipod like device.

        Original ideas either dont exist or have a functionally irrelevent definition in comparison with inputing tokens to LLMs to get novel ideas out.

    • throwaway_7274 5 hours ago
      Incidentally, the relationship is bidirectional. You can try it out just for fun. zstd is a pretty crappy language model :)
    • nonameiguess 4 hours ago
      There's another element to this that I almost never see discussed. Ideas are not facts. Neither LLMs nor humans can generate new knowledge, as opposed to ideas, by thinking alone. Physical investigation and experimentation is necessary.

      The exception being pure mathematics since it exists solely in the realm of ideas. I'm willing to call that knowledge, but it's still a distinction, the old analytic/synthetic dichotomy of Kant.

      • versteegen 14 minutes ago
        That conception of knowledge is interesting, but I think using the label 'knowledge' for it is very problematic, it's too far from common definitions. The fact that you have to carve out an exception for mathematics already shows there's a problem. Because if maths, shouldn't thought experiments also produce new knowledge? You're excluding special and general relativity. It seems to me that what the concept actually describes is "information about the world".
  • avyfain 14 minutes ago
    Recently I wrote a blog post[0] expanding on a similar idea from the angle of ancient Greek philosophy, particularly Parmenides: to think is to compress.

    [0]: https://faingezicht.com/articles/2026/05/28/shape-of-what-we...

  • variadix 5 hours ago
    This is a lot less surprising when you learn how non-LZ compressors work, that is, by modeling a probability distribution and using those probabilities to encode information in the minimum number of bits required to transmit the data. A less obvious conclusion is that LZ compressors do this to implicitly, the length of each symbol they could emit (literal or match, etc.) can be converted to the probability distribution the LZ compressor induces, since the number of bits to encode the symbol is related to its probability by the information content.
    • duskwuff 5 hours ago
      A common design in compressors is to use LZ as a first step, but to then represent the constant data and/or offset-length pairs from LZ using an entropy coder.

      Deflate (as used in gzip) uses a Huffman coder. LZMA (as used by xz) uses a predictive range coder. Zstandard can use either Huffman or FSE. Some high-speed compressors like LZ4 skip the entropy coding stage entirely at the expense of compression ratio.

      Bzip2 is an interesting aversion of this pattern - it uses the Burrows-Wheeler transform as a first pass instead of LZ. Unfortunately, this is one of the major reasons why it's so slow.

      • sgsjchs 2 hours ago
        The first LZ-step pretty much directly maps to BPE tokenization in LLMs.
        • versteegen 12 minutes ago
          If doesn't correspond cleanly. I can see why you draw the link, because LZ compression will replace words with symbols but BPE is a non-contextual entropy encoding while LZ is contextual and adaptive and that makes it very different. I think BPE actually has more in common with Huffman encoding.
  • baron3dl 5 hours ago
    I stumbled across a connection between LLMs and compression when researching N-dim polytope emergence in neural networks. Toy Models of Superposition (Anthropic, 2022) suggests that gradient descent can independently discover efficient geometric packing arrangements for sparse features. LVQ compression uses regular lattice structures, including some based on 4D lattices.

    I found this interesting and wonder whether LLMs have a higher density ceiling, since training and inference don't rely on a fixed lattice and can instead learn their own representational geometry.

  • QuadrupleA 3 hours ago
    Ted Chiang made a similar point in his article "ChatGPT is a blurry JPEG of the web" a few years ago:

    https://www.newyorker.com/tech/annals-of-technology/chatgpt-...

    • tptacek 2 hours ago
      It's a great line, but that's obviously not all it is. You don't get new results in e.g. mathematics by looking carefully at the pixels of a JPEG.
  • jparishy 5 hours ago
    Cool visuals and breakdown. I wrote something in early 2025 about how LLMs seem to be an emergent behavior of lossy compression, but did not have the knowledge or verbiage at the time to get this detailed. In retrospect my writing seems naive and I'm happy to have found this and the Google paper linked inside. To be a fly on the wall in some of the labs, man.

    Another thought that came from the same post is that, insofar as we see LLMs as human-style intelligence, they're more like stream of consciousness devices. Essentially incessant talking and buying enough time until you get to a usable answer. I think I associate some subset of intelligence with what you don't say, which is impossible with the SOC-style outputs, so this is something I think about a fair bit.

    What could maybe differentiate current gen models from next gen is the ability to call tools modeled within the layers themselves, not externally. I think as far as I understand it, model trainers expect the model to do this itself in a way we don't understand or control, like a version of the bitter lesson. But I posit we can model many determinate tools as NNs themselves and figure out how to get the internal states of the LLM to make use of them during inference, e.g. calculators, indexes, citations. Just an enthusiast though, so grain of salt and all.

  • bergwerf 2 hours ago
    The comparison can be carried on to another even crazier level: Evolution is compression. All the complexity of biology is executed at the highest possible efficiency.
  • pjankiewicz 5 hours ago
    I was thinking about the same topic and the conclusion can be wrong. LLMs are compressors, but compressors are not LLMs. Mixing this can let you believe that you can use a compressor to do the same thing as LLMs, which you cannot.

    Specifically I was thinking about a way to inject knowledge into LLMs training by using statistical properties of text in such a way that you don't have to train the LLM to achieve some level of predictions. There are actually some papers that inject n-grams statistics as a part of the neural network weights.

    • davmre 5 hours ago
      Any compressor actually can be used, trivially, as an autoregressive language model.

      Given a context (for LLMs, this would include the entire pretraining dataset, plus the prompt), you compress `context + next_token` for every possible next token. The tokens that co-compress best with the existing context are the 'least surprising' continuations. Choose one of them and iterate.

      You can easily generate text with gzip this way. It won't be very good text, because gzip compression is not as sophisticated as a transformer + SGD, but the principle is the same.

    • Legend2440 5 hours ago
      >Mixing this can let you believe that you can use a compressor to do the same thing as LLMs, which you cannot.

      You can, actually! Any compressor can be losslessly converted into a generator, and vice versa.

      Traditional compressors like gzip are of course very simple and can only replicate rough patterns from the input. But they are technically doing the same thing.

      • pjankiewicz 5 hours ago
        I agree that technically they are doing the same thing but in practice LLMs are better compressors than PNGs (learned this while I was researching this topic). That was quite surprising to me.
    • aaroninsf 5 hours ago
      That sounds like boostrapping the weights involved in early layers, to obviate the need for those layers to learn (optimize) for the distribution in the training set.

      Makes me wonder idly, - is this conceptually akin in some sense to a "universal grammar," and if so - with a broad enough training set, is there a latent durable universal grammar that might be similarly recovered and injected to the benefit of all training, - does that grammar go beyond morphological/syntactical/grammatical features, into e.g. semantics and pragmatics

      • pjankiewicz 5 hours ago
        That was my thinking as well mainly to increase the speed of training. But it may turn out that the simple statistics that you can capture like this may account for 1% of the training and are likely to be captured as the first thing during the training.

        But actually these techniques are used but they are hidden as speculative decoding with increasing complexity of approximations. For example you can have a part of the network that predicts the next word based on the markov chain, the next approximation is more complex etc.

        This paper proposes something similar where you can inject memory without training https://arxiv.org/abs/2605.16893

  • adamgordonbell 5 hours ago
    Small world. I just did a podcast on this same topic, but coming at it from a different direction, ie. me and my neighbor trying to beat the hutter prize for compression.

    Hutter Prize being where you are paid if you can compress wikipedia small enough. LLMs do very well at that, if, big if, you ignore the cost of initial weights.

    A cool Claude Shannon story:

        Shannon wanted to measure how much information is actually contained in ordinary
      English text. His 1948 theory said such a number must exist, but he had no way to
      calculate it, because the patterns in English reach across dozens of letters and no
      equation or frequency table captures all of them at once.
    
      So instead of calculating it, he ran an experiment on a person.
    
      He took a passage from a novel that the subject had not read, and covered it with a
      card so only the text already guessed was visible. He asked the subject to name
      the first letter. If the guess was wrong, he asked again, and kept asking until the
      subject named the correct letter. He wrote down how many guesses it had taken,
      revealed the letter, and moved the card one position to the right. Then he repeated
      the process for the next letter, and the next, through the whole passage.
    
      What this produced was not a sequence of letters but a sequence of numbers — one
      number per letter, recording how many guesses that letter required. Most of the
      numbers were 1, because someone fluent in English, seeing the preceding text,
      usually names the next letter correctly on the first attempt.
    
      Shannon then argued that this sequence of numbers contains exactly as much
      information as the original passage.
    
    Sounds a lot like next token prediction to me.

    https://corecursive.com/the-hutter-prize/

    http://prize.hutter1.net/

    https://github.com/hkust-nlp/llm-compression-intelligence

    https://www.princeton.edu/~wbialek/rome/refs/shannon_51.pdf

  • caust1c 4 hours ago
    Compression is not prediction, it is recall. Can we make predictions based on compression? Absolutely. Is memory encoded into physical neurons technically compression? I would argue also yes.

    However, going from compression to prediction is a large jump that is unsubstantiated by this article and based on the claim that probabilistic recall is also prediction.

    Two perfect counterpoints to this are markets and weather patterns. One cannot predict future events based on past performance or behavior. Change is the only thing that's constant, and chaos/entropy is everywhere we look.

    For simple problems like programming, sure predictive recall works amazingly well, but let's not pretend LLMs are actually predicting something. This is exactly why LLMs suck at doing anything novel; they lack imagination and creativity.

    • msteffen 4 hours ago
      I know less about this than every other commenter here, but both weather patterns and market performance do seem predictable based on past behavior when modeled at the right level of abstraction. “Sunshine on Monday” does not imply “rain on Tuesday”, but “cold front moving in Monday night” does. (Likewise “stock up Monday” doesn’t imply “stock down Tuesday” but “CEO arrested for fraud on Monday” does.)

      I think this is relevant to the discourse on LLMs/programming because for months, people said “they’re just regurgitating their training set,” but now I think people are seeing (I am seeing) that they do learn more abstract models of the world than that. I don’t really know how, but it’s why they can generalize from other codebases and tools and so on.

      • TeMPOraL 3 hours ago
        > Likewise “stock up Monday” doesn’t imply “stock down Tuesday” but “CEO arrested for fraud on Monday” does

        Stock market is even more pathological than weather here. Most statistical tools have baked-in assumptions about some degree of independence between factors under analysis. In weather, things are hard, because everything affects everything but in some random sense. With stock market, it's worse, because some things affect others in an adversarial way. A pattern discovered is not merely drowned in noise, but rather actively canceled out as other people discover and act on it. The way to describe this in formal terms is, I believe, that the stock market is "anti-inductive".

        Fortunately, most things we deal with life are much friendlier to predictions than weather or stock prices.

        > I think people are seeing

        Better late than never, given that this has been empirically demonstrated two years ago by Anthropic. I actually don't understand why people don't make a bigger deal out of it - maybe it's because the AI hype/hate fight is sucking all attention from the room. But the point is: we not only have a thing that can learn concepts we recognize and build abstract world model, but also we have a degree of visibility and control of it we never had before. We can't see, much less suppress or stimulate individual concepts or concept groups in a human brain directly, but we can with LLMs.

      • caust1c 3 hours ago
        Good points. I looked up the definition for prediction and I suppose I'm stretching what I view as prediction.

        > A prediction is a statement about what you think will happen in the future, often based on experience or knowledge. It can also be referred to as a forecast or an informed guess

        Based on my reading of this definition, compression may inform prediction but it is not itself prediction. The examples cited in the blog post are examples of probabilistic recall based on past events or instances. More context means a higher chance that the recall is more likely to be aligned.

        But it's hard for me to accept the leap to compression == prediction because in my mind a prediction is an informed guess about something that hasn't yet come to pass. But thinking more about it, time is a human concept and so who's to say the temporal reference means anything at all here. Maybe probabilistic recall is the same as predictive forecasting if time is an invented concept and essentially means nothing?

        Is everything fundamentally deterministic if you know everything in the universe or does free will exist?

        IDK to be honest, I'm just more frequently surprised by new things that happen every day than I am at things that stay the same, even if mostly things stay the same. Maybe I just don't notice them and nothing actually ever happens.

        Side note: the inevitable consequence of this line of reasoning will eventually become that LLMs given enough power are in fact intelligent and sentient, and I'm worried about how that affects humanity as a whole. Are we about to subjugate the most intelligent thing humanity has ever created, or is it about to subjugate us?

        The rabbit hole gets deep quick when making the leap between a fancy recall mechanism and novel prediction, but I agree they're not that different in the end. I just believe it's important to be nuanced or else we'll miss when AGI actually happens (maybe it's already here).

  • kazinator 3 hours ago
    It's more or less obvious that the LLM is a lossy-compressed version of the training data; it reproduces sequences of tokens that are the sort of thing that could plausibly occur in the training data, and avoids sequences that are implausible.

    Because most of the training data has good grammar, the LLM is strongly trained on grammar; it will rarely predict ungrammatical gibberish. Even if there are grammar mistakes in the data, they are not systematic and so don't reinforce each other.

  • rrherr 2 hours ago
    Schmidhuber did it first:

    Driven by Compression Progress: A Simple Principle Explains Essential Aspects of Subjective Beauty, Novelty, Surprise, Interestingness, Attention, Curiosity, Creativity, Art, Science, Music, Jokes

    https://arxiv.org/abs/0812.4360

  • transitivebs 1 hour ago
    great talk by ilya sutskever on how this https://www.youtube.com/watch?v=AKMuA_TVz3A&t=2121s
  • j-pb 5 hours ago
    I always feel like people leave out the third case of the analogy: indexing

    The article itself has decision trees for the compression explanation, which is also a lookup index.

    In each case you try to recognise (re)usable structure.

    Self-indexing succinct data-structures are a good example of the third side of the coin.

    So it's a trinity: compression, prediction, indexing

  • deepsun 5 hours ago
    > compressors and LLMs

    Why only LLMs? All statistical models are compressor. You can say "model" and "compressor" are synonyms.

    Article does not mention "embeddings" at all, even though it's commonly viewed as a compression method. Also "encoder" part on "auto-encoders".

    • hmokiguess 5 hours ago
      I often wonder how would language fare if we didn't have redundancy in abstractions, why do things get different terms, and if there is such a smaller set that contains everything in a lossless way (english-wise)
  • sethev 5 hours ago
    This immediately reminded me of the Hutter Prize (http://prize.hutter1.net/) - a contest that has run since 2005(?) based on the premise that compression is closely related to intelligence.
  • kailanb 5 hours ago
    Unrelated to the content: I was really pleased to see that this site defaults to the bare minimum for cookie consent. I reflexively clicked "Reject all" only to see that it was already the default, which threw me off.
  • SpyCoder77 2 hours ago
    Something Ngrok is doing is working, because first they manage to get Sam Rose of samwho.com and now this? At this point I care more about their blog than their products
  • sigbottle 4 hours ago
    I keep on seeing this claim, especially from popular creators such as 3Blue1Brown. How is this not borderline vacuous?

    I'm not a LessWrong^TM rationalist guy, but one really good thought experiment I always keep in the back of my mind from them is Solomonoff induction. AIT people take it as a framework to work with - it's pretty cool, I agree. But I (and some other people, such as certain AI execs at Amazon - according to my interpretation of their public interviews) think it just highlights the trap - given an arbitrarily powerful oracle, you can get compression down pat. Like, if you assume the source is generatable with a turing machine, and you write a function to brute force over all turing machines, then whoa, your compression works. You will necessarily find the optimal compression at some point because your search function is literally searching over all possible turing machines that could've generated the input sequence, anyways (because the input sequence was generated by a turing machine)

    These are the kinds of results you can get if you don't have any actual constraints on what the compressor can do.

    (Of course, again - this is not the point of solomonoff induction - it's to use this as a base truth, to then layer parsimony on top of that. There are infinite number of turing machines that could match your prefix, parsimony filters, throw some bayesian inference on top of that, and you get Solomonoff induction. They constrain it afterwards. But I think to that intuition as a base whenever people claim new results.).

    But I see in casual conversation, people constantly making claims like, "LLM's are so good because they compress a model of the world". What is that model then? Scott Aaronson has made points like this before - your "model" could just be a massive lookup table, so you can't just claim "compression" and win - the compressor must be reasonably small, too.

    I don't object to the notion that LLM's have some notion of world models more sophisticated than memorization. That's proven by actual interventional experiments, such as the ones that actual interperability researchers do. But mere compression is vacuously powerful. "Vacuous" not in the sense that "oh, you might be suboptimal and be a little more complex", vacuous as in "the philosophical point you were trying to make is vacuous because you make a vacuously powerful statement".

    (I'm not a total fan of intervention either, as an end-all gospel as some people use, but it's far, far better than not having it).

    • soulofmischief 4 hours ago
      The key principle is simple.

      If you want to best predict what state comes next from a space of possibilities, you have to figure out how probable each next state is and pick the most probable one.

      If you want to compress something, you have to figure out how probable each next next state is and assign the smallest code to the most probable state.

      These two processes are essentially the same, and the resulting structure of a system which regulates either process will be similar, approaching the same structure at high confidence.

  • throw290483 3 hours ago
    I see it that prediction is a form of compression.

    Say you have a computer file composed of two parts, the first represents the setup of an experiment, and the second is the data produced by the experiment.

    If you have a good theory relating to this type of experiment, then you can predict much of the second part of the file. So you only need to store the first part and possibly some corrections to the least significant bits of some of the parts of the second part of the file.

    Thus with good prediction, you can compress this type of file.

    • pornel 3 hours ago
      Another example is encrypted data. Statistically, encrypted data is indistinguishable from random. Truly random data is impossible to compress losslessly.

      But if you had a predictor so smart that it could crack the encryption key, it could start predicting the rest of the encrypted stream, and therefore compress it.

  • bob1029 3 hours ago
    How about dictionary based compression as a counter example? Or the zig zag encoding scheme used in JPEG? I find it difficult to cast some of the things that effectively compress data as prediction.
    • pornel 2 hours ago
      Dictionary-based compression is based on prediction that recently seen words will be used again. That happens to be generally true for lots of datasets, including human languages (zipf distribution).

      JPEG's zig-zag is a primitive for quantization, throwing data away based on rough approximation of human perception and biology. That isn't compression itself. However, the rounded and zeroed-out data is then compressed using a combination of RLE and Huffman, set up to predict the data will have lots of zeroes and few other distinct values (which the earlier step forces to be true). Or if you think about the system as a whole, you could say that JPEG predicts images will be blocky low-frequency patterns of DCT.

    • sgsjchs 1 hour ago
      > dictionary based compression

      That corresponds to PCFG models.

  • md- 3 hours ago
    i do agree with that point of view. I often referred to models as 'modern mp3s' storing a lossfull but lookalike version of information in order to counter that 'AI is totally new and not violating copyright by storing information in a magic fashion' argument.
  • zephen 48 minutes ago
    This is simply wrong.

    Compression requires prediction.

    The better the prediction, the better the compression, whether you are measuring fidelity or result size.

    This doesn't mean that compression is prediction.

  • Razengan 4 hours ago
    3Blue1Brown - "Compression is Intelligence": https://www.youtube.com/watch?v=l6DKRf-fAAM
  • d_burfoot 4 hours ago
    Author's bio:

    > Annie Sexton is a Developer Educator at ngrok with a passion for nerd-sniping developers.

  • orangemoonx 3 hours ago
    The prediction happens when it is uncompressed right?

    LLM embeddings are compressed training data.

    To decompress that is to make a prediction (in this case to convert the embedding into readable text)

  • andai 5 hours ago
    See also: Bellard's Lossless Data Compression With Neural Networks

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

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

  • whimsicalism 3 hours ago
    did the SSL cert expire? i'm getting a big scary warning about this blog
    • EndEntire 1 hour ago
      Joel from ngrok here, certs are all good! You're likely seeing some corp-level block, which does happen to us on occasion. Hope you'll check it out again from the relative freedom of your home network.
  • bergwerf 2 hours ago
    There
  • casey2 21 minutes ago
    Not really, compression doesn't require a world model, it's mathematically pure. Any AGI system must periodically reset it's prediction since the world is inherently stochastic. When we look at prediction markets they only seem to work in the long term because human language is abstracted away from the real world, again it's mathematically pure. That's why we get bugs in code and disputes with prediction outcomes.

    A better title, you can improve your compression if you make an accurate prediction. Much like how a branch predictor can make a CPU do the same work in less time. Or when your symbols are true uncompressable rules of reality (which is probably meaningless both semantically and physically again due to inherent randomness)

    The main difference between minimalist and maximalists are how much that set of uncompressable rules gives you. I suspect the search space is too large. What we see in practice is that lossy rules let you cover more ground but eventually you hit a wall and have to move to a lower level of abstraction to make progress. There are 10^360 paths in a go tree, but something like 10^300,000 for molecular chemistry and that's not even all the way up (or down, say 10^3000 for the standard model of physics that's 10^900,000,000 if you want to do chemistry without chemistry abstractions.). Just semiconductor fab is 10^(10^11) so 10^(10^16) with molecular chemistry (think finding an implementation for some sort of desired self assembly outcome). AI can be way way way smarter than humans and there just not be enough energy in the universe to find these needles. So we definitely need abstractions, but those are at odds with predictions and the choice of symbols often introduces abstractions that the designer didn't consider.

  • Muhammad523 5 hours ago
    I was rushing to post this and then found out somebody had already
  • westurner 4 hours ago
    Perhaps a similar observation; https://news.ycombinator.com/item?id=48703636 :

    > Compression, Predictive modeling, or Complexity?

    Perhaps a bad example: https://news.ycombinator.com/item?id=38400380 :

    > "78% MNIST accuracy using GZIP in under 10 lines of code" (2023) https://news.ycombinator.com/item?id=37583593