r/AskComputerScience • u/[deleted] • May 09 '22
"AI is just compression" ?
Hi. I came across an AI engineer mentioning in an interview that "AI is just compression". I was struggling to understand what this means. I figured he was talking about the link of information theory to AI but not sure. He also mentioned the hutter prize which led him to this epiphany of "AI is just compression". It seems like a gross oversimplification but maybe there is some logic in there that I am unable to understand.
Also, can you guys point me towards some resources on this topic. I would love to learn more about "AI is just compression"
Edit: I am talking about these 2 things
16
u/ghjm MSCS, CS Pro (20+) May 09 '22
Are you sure he said AI and not machine learning?
Machine learning can be seen as function estimation. For a given ML problem, there is some true function which is either intractable or unknown, and the task of ML is to come up with a good guess of a function that gets the right answers most of the time (or perhaps we make the stronger claim of getting right answers to within a formally bounded degree of correctness).
This can be seen as a form of compression. The mapping of problem cases to answers is the uncompressed data, the true function is the output of lossless compression (assuming no noise in the data set), and the ML-discovered function is the output of lossy compression.
It seems like overstating the case to say that ML is compression, though. And certainly there's more to AI than just ML, and a lot of the non-ML parts of AI don't seem to be about compression. (Except in the trivial sense that all cognition is kinda-sorta about compression: when we come up with a category like "tree" or "dog" and classify certain objects into it, we are using "compression" to avoid the mental effort that would otherwise be required to know the properties of every individual object.)
8
u/onemanandhishat May 09 '22
Why is this answer downvoted? Are people not aware that ML is only a subset of AI and not its sum total?
As this and the current top comment point out, ML can be considered a glorified version of drawing a line of best fit, compressing data points into a single model. However, ML is a sub-field of AI, they are often conflated because ML is the most popular and widely used, but AI is also concerned with action not just thought and the "compression" remark doesn't really apply to the actions of agents.
1
u/hey_look_its_shiny May 10 '22
In my experience here, yes. The majority of community members do not seem to be well-acquainted with the distinction.
1
u/Cybyss May 10 '22
I took an advanced undergraduate AI course back in 2006 for computer science majors.
There was nothing in it about neural networks.
It was almost entirely about resolution algorithms for knowledge bases expressed in first order logic (think Prolog). There was a section on "machine learning", and it did use some statistics, but it was to create some sort of decision tree structure for classifying data, like a glorified binary search tree.
There were also bits about A* search and the Minimax algorithm.
The field really turned topsy-turvy. Now it's all about deep learning. Do AI researchers fiddle with first order logic resolution algorithms anymore?
3
u/ghjm MSCS, CS Pro (20+) May 10 '22
Yes. Decision trees are still an active area of research. My search shows 447 peer reviewed journal articles published within the last year with the exact phrase "decision tree" in the title. (Though admittedly this is vs. 14,000 for the same search on "neural network.")
2
u/ischickenafruit May 09 '22
How do you define the difference between AI and ML? You seem to draw a strong line there.
6
u/ghjm MSCS, CS Pro (20+) May 10 '22
Machine learning, which I have a master's degree in, is what I described: the use of training data to "learn" (ie, approximate) a function or policy that makes good predictions about non-training data.
Artificial intelligence is a broad field which includes ML, but also includes natural language processing, robotics, knowledge-based AI, game AI, and various other things. There are also related interdisciplinary fields such as cognitive science, philosophy of mind and so on.
For a concrete example of AI that is not ML, consider chess-playing programs. These generally perform min-max searches of the state space of the game, based on rules and heuristics codified by the programmer. There are many well-known AI techniques relevant to this - static evaluation, alpha-beta pruning with or without the null move heuristic, fixed databases of opening moves, and so on. You can do quite a lot of complex work on making a better chess playing agent without ever doing anything related to machine learning, but all this work is still considered AI.
Of course, you can write a chess-playing program that uses genetic algorithms, neural networks or what have you to look at a board position and "learn" things about it - and then you are using ML. The fact that you can already be working on an AI problem for months or years, and then say "hey, let's try using ML for this," should be sufficient to show that the two things are not the same.
If I had to try to nail down the definitions a little better, I would say that AI is a particular subset of those problems whose solution is an algorithm, and ML is the technique of solving these problems by mechanically searching an algorithmic space rather than having a programmer write the algorithm.
0
u/ischickenafruit May 10 '22
OK. That makes sense. Thank you.
FWIW - I think you’re taking a rigorous academic differentiation which is perfectly justified (and I agree with you) but which is not reflected in the common usage. In common usage AI means neural nets. Given the question that OP is asking, it suggests the common usage than the academic one.
6
u/ghjm MSCS, CS Pro (20+) May 10 '22 edited May 10 '22
Sure, I understand there are people who confuse the two terms. But I would suggest that:
Someone applying for an AI Engineer job ought to be held to a higher standard than just knowing the popular use of the words;
This also applies to a hiring manager in this field;
The popular usage of AI to mean ML isn't consistent - nobody would say "the Age of Empires AI is too repetitive" and be taken to be saying something about neural nets; and
Neural nets aren't the totality of, or even the most interesting recent development in, machine learning, let alone AI.
4
u/hey_look_its_shiny May 10 '22
You're not wrong about the cultural shift (which has only been true over the past decade), but these comments are in response to technical questions in a computer science sub asking about the definition of AI. So it's precisely the right place to be rigorous :)
5
u/onemanandhishat May 09 '22
I think they're correctly pointing out that ML is only a subset of AI.
2
u/ischickenafruit May 09 '22
How so? I’m genuinely curious. How do you define the difference between the two?
2
u/onemanandhishat May 10 '22 edited May 10 '22
There are 4 areas of interest in Ai: Thinking 'humanly', Acting 'humanly', Thinking 'rationally', and Acting 'rationally'.
Machine learning is concerned with the 'thinking' part of AI, particularly the rational thinking part. The goal is not to model human thought (the kind of AI most popular in scifi but of less direct practical use) but to reason towards a "correct" answer. ML takes data, constructs some sort of prediction or classification model, and then applies the same reasoning to either predict or classify new data. This is extremely useful for performing tasks at scale, but it doesn't tell you anything about what to do with the information.
ML therefore does not cover the 'acting' part of AI. To give an example, even if you have an ML model that can perfectly predict the time and location of crimes in a city, it will not tell you the best way to deploy your manpower to be able to respond efficiently. For that you need to draw on other tools such as planning and scheduling, game theory, search, multi-agent systems etc. There are other fields such as computer vision and language processing that also may draw on ML but do more than simply construct an ML model.
ML is probably the part of AI that is most immediately accessible and useful to businesses as many models are packaged neatly into libraries that can be used as-is but that has led a lot of people, even with the AI community to think that AI is ML, which is not correct. I wouldnt draw a strict line in the sand as often in AI you want to draw on different tools to solve a problem, so many projects include a bit of ML but that's just one way to do it.
1
u/ghjm MSCS, CS Pro (20+) May 10 '22
Interestingly, the movie Ex Machina proposes a counterexample to this. Eve, the AI character who the protagonist and audience are meant to think has achieved sentience, has an entire data set of an imagined privacy-invading search engine that combines the worst aspects of Google and Facebook. Through snooping on people by leaving their cameras on, this provides a huge data set of actual human behaviors under every conceivable circumstance. One can imagine a machine learning agent not even needing to use neural networks, but just using KNN on some appropriately defined feature space of this data. The robot then just "acts out" the scene, averaged in some way across the selected neighbor instances.
1
u/bijinregipanicker Jan 14 '24
I created a document embedding dataset using ZStandard based on this paper(I am not the author). GZip is used in the paper
Here is the Embedding Dataset.
Documents used for generating embedding
1
2
u/claytonkb May 10 '22
He's skipping many steps in his explanation.
You can (over) simplify ML into (a) curve-fitting and (b) classification (pattern-recognition, discrimination).
Curve-fitting (learning a function) is a kind of generalization. Stated another way, the whole point of fitting data to a curve is to either interpolate or extend the curve in some way that "makes sense". Algorithmic information theory gives us a completely rigorous framework in which to state precisely what we mean by "makes sense". Search minimum description length and its applications to generalization in AI/ML to start pulling on that thread. While MDL might not seem to be compression, under the hood, it's just compression.
Classification (pattern-recognition) is about sorting or categorizing things based on features. It should be obvious how this is a compression task. A neural net that recognizes images of dogs is a compressed form of all of those images of dogs because you could, in principle, simply iterate through all possible images (in binary sequence), feed them into the neural net, and throw out all images that the neural net does not recognize as dogs. Granted, that would be a pretty silly thing to do, but it illustrates the point.
Much more can be said about the generality of compression and its applications to reasoning and AI. Eventually, compression will take center-stage as applied AI research catches up to the theory.
2
u/og_m4 May 10 '22
What they mean is that in terms of Kolmogorov complexity, AI and compression are very similar pursuits. You’re trying to write the smallest program that can generate a certain desired series of bits. A Gpt3 based text generator with a prompt and a Huffman tree with a set of encoded bits are very similar.
3
u/-Aras May 09 '22
Your brain doesn't actually store data but it learns how to reproduce by conditioning your neurones. Instead of storing big amounts of data, you can train a set of neurones, which will consume less space compared to the data itself, hence compression.
It won't be bit perfect though. Using AI for real compression is not a good solution.
1
u/Ok_Nobody_9659 Jun 17 '24
I could see intelligence arising from compression or things that have been compressed . It be super easy to visualize a llm with access to a giant data lake of task experience of " memories" With the ability to up date these memories on a hourly daily weekly basis. And use them as one shot examples or vector searches for task alignment. To have a human level of intelligence
1
u/vladusatii Nov 24 '23
You're talking about George Hotz. His second interview with Lex. He meant a few things:
Many hand-chosen branches of AI can be used to feature extract or feature estimate, which is what lossless compression does when compressing and decompressing information. If we can advance AI to the point where we've compressed something that is 100 GB to 1 GB in a lossless format, we've engineered the most dense form of intelligence we can given some organized data. Density implies speed and efficiency. If we can store a lot of information in a smaller amount of space, its analogous to being able to communicate faster if a piece of hardware is denser. It's also analogous to some famous mathematical equations, like the Fourier Transform or the matrix form for functions and relations. These equations represent intelligent organization and accessibility of information.
The Hutter Prize is really asking the question: How dense can we pack information such that it holds its original contents? The smaller we can pack data, the more intelligence we are capable of storing.
1
u/lambdawaves Jan 26 '24 edited Jan 26 '24
It goes deeper than that
Our mind is actually performing compression all the time. Hofstadter touches upon this: Analogy as the core of cognition. He doesn’t call it compression, but once you see how abstractions allow you to compress data, it all comes together.
-7
u/OldGameGuy45 May 09 '22
Huh? AI is a GREAT WAY of advancing compression. Just meaning if it could decipher the information with less data stored, then yes. But that requires AI, not what is is. Imagine just saying 5 story building, classic greco roman style, new york, 1950s, decayed to 1980...
...Instead of a picture. You can picture it, correct? It could just build, rust and add overgrowth to a city building after an apocalypse.
Google is already doing those weird AI things. They're not compression, but at some point they will make compression much better.
Think procedural algorithms. I started developing a space ship game in the 90s. ALL the ships, planets, textures, etc were 100% procedural. No two people had the same universe. The entire game was under 10Mb. It's long lost, but it was a cool idea.
So yeah "AI is just compression" is dumb, but developing a useful AI that can create more compressed, lossless files is definitely awesome.
Just look up neural nets- they're not super complex.
48
u/ischickenafruit May 09 '22 edited May 10 '22
EDIT: There's some criticism of my use of the term "AI" versus "ML". I'm answering the question as I think OP intended it, which is covering the subset of AI which is popular today, which is really ML. So if you read this, and it bugs you that I use AI, please read ML instead, it's what I really mean. If it's not immediately obvious to you why there's a difference or distinction between AI and ML, then there are some interesting discussion in this thread about it.
It’s probably better to start by saying “AI is just statistics”.
Most AI techniques boil down to curve fitting (effectively). You take a bunch of data points and try to come up with a function which would generate those same data points given the same inputs (for input/output pairs you already know) and the “right” output for inputs where you don’t already know the answer.
The big difference with AI is how many data points you feed in to your fitting process, and how many dimensions your curve function has. Dimensions means the number of inputs and outputs.
You might have trillions of data points you’re fitting and and your curve might have thousands of dimensions.
Taking a huge amount of data and finding a way to represent that data as a (relatively) simple curve or function is “just compression”. So it’s ok to say that “AI is just compression”
You won’t really find a book or text on this topic. It’s just a cute observation by someone who knows the subject matter really well. It’s kind of an oversimplification, but it’s a good one.