Gzip beats BERT? Part 2: dataset issues, improved speed, and results
kenschutte.com
kenschutte.com
Bad numbers in the “gzip beats BERT” paper? - https://news.ycombinator.com/item?id=36758433 - July 2023 (128 comments)
Perhaps as a reminder, the issue is that the paper’s implementation of their 2-nearest neighbor secretly uses an oracle to break ties, which obviously inflates the accuracy compared to a real-world kNN classifier that has to choose heuristically. To be fair, this could be a weird implementation accident and not malice. But I think it does invalidate the results.
But rather than admit error, the author defends this choice, and does so using (in my opinion) dubious statistical arguments. Which leads me to believe that — at least at this point — they know they made a mistake and just won’t admit it.
They claim that instead of a real-world accuracy, they wanted to find the “max” accuracy that their classifier was statistically capable of. That is, the accuracy you get if the stars happen to align and you get the luckiest possible result. Well, not only is this creative new metric not described in the paper, it’s also not applied to the other algorithms. For example, I think a neural network is capable of achieving a “max” accuracy of 100%, if all the initial weights happen to perfectly encode both the training and test sets. But of course they just use standard training to give the numbers for those algorithms.
Publish or perish
After a while they noticed several disturbing things. One, that the winners had fewer gates than theory thought was necessary to solve the problem. Two, some days the winners didn't work, and three, sometimes the winners didn't work on a different FPGA.
After much study the answer was that the winning candidates were treating the gate logic as analog. Manufacturing flaws or PSU fluctuations would result in the analog aspects behaving differenty.
To fix this, they split the fitness test in two passes. All implementations that actually worked got re-run in an emulator, which of course treats the behavior as purely digital. Only if they worked with both did they avoid being culled.
Yeah, I read this on the GitHub issue a week ago and couldn't believe it. Ideally, their profile(1) should allow them to quickly admit they were wrong on such a simple issue. Pursuit of truth and knowledge, etc.
(1) a young PhD from a prestigious university
> For example, I think a neural network is capable of achieving a “max” accuracy of 100%
Why reach for such powerful tools? f(x) = random(num_classes), achieves 100% "upper bound" accuracy.
There's only two options here, deceptive or hopelessly incompetent.
Academia doesn't have a culture of admitting mistakes. Retracting a paper is typically seen as something shameful rather than progress (by scrutinizing results).
Combined with pressure to publish and sometimes limited engineering skills it leads to a volatile mix. There are a lot of published results that are not reproducible when you'd try (not saying anything new here, see replication crisis).
Aome contractors that were building NLP solutions for three-letter agencies told me the secret to hyper precise systems is to start with a classier that separates easy and hard cases and the create a series of classifiers that can solve the hard cases and fall back on an oracle for the really hard cases. That’s how the original IBM Watson worked.
I'll add that since I wrote these two blog posts, other people have sent me their other interesting work:
(1) I link to this at the end of the post (using zstd dictionaries): https://github.com/cyrilou242/ftcc
(2) today someone sent me this (bag-of-words better than gzip): https://arxiv.org/abs/2307.15002v1
Would you say this idea is interesting enough for you personally to research it further?
To be able to compress something, you need to understand it first
We use this everyday, we compress things by naming them
Once we name something, we don’t need to explain or describe, we can just use the name instead
That allows us to compress our communications and it directly affects the parties understanding of the information
That’s just conceptually. At a math/algorithm level I don’t really know the specifics of your research or the paper in question
The sentence was simply, (and in capitals in the original), "POETRY IS COMPRESSION."
The whole idea of an autoencoder is conceptual compression. You take a concept (say: human faces) and create a compressor that is so overfit to that concept that when given complete goobldygook (random seed data) it decompresses that to something with semantic meaning!
The really useful ones are based on SBERT, and measure the likelihood that the answer is contained in the text that was embedded.
ex. from my unit tests: "what is my safe passcode?" has a strong match with "my lockbox pin is 1234", but a very weak match to 'my jewelry is stored safely in the safe'
I learned this from https://news.ycombinator.com/item?id=35377935: thank you to whoever posted this, blew my mind and gave me a powerful differentiator
original : 1.000
precomputed : 0.644 (first improvement)
gziplength : 0.428 (+ 2nd improvement)I'm not trying to give them a pass, but we do need to discuss the perverse incentives we've set up that make these kinds of things prolific. The work should be good on its own, but good doesn't mean it'll get published in a journal. And frankly, it doesn't matter how many citations your arxiv paper has, people will still say "it isn't peer reviewed" and it won't help you get a job, graduate, or advance in academia. Which I think we should all agree is idiotic, since citations are indicating peer review too.
I blame them for giving obviously incorrect excuses on GitHub when such an obvious mistake is pointed out.
There is no way they could be at the stage they claim to be in their program (having just defended their thesis) and think the excuses they gave on GitHub are reasonable.
> There is no way they could be at the stage they claim to be in their program (having just defended their thesis) and think the excuses they gave on GitHub are reasonable.
Unfortunately it is a very noisy process. I know people from top 3 universities that have good publication records and don't know probabilities from likelihoods. I know students and professors at these universities that think autocasting your model to fp16 reduces your memory by half (from fp32) and are confused when you explain that that's a theoretical (and not practical) lower bound. Just the other day I had someone open an issue on my github (who has a PhD from one of these universities and is currently a professor!) who was expecting me to teach them how to load a pretrained model. This is not uncommon.
Goodhart's Law is a bitch.
And according to Ken Schutte:
> this method uses the test label as part of its decision process which is not the standard classification setting and can't be fairly compared to others that don't.
Can anyone make the case that these two descriptions don't overlap? Personally I can't see how the original author can be so blasé about this.
I'm really surprised HuggingFace isn't doing filtering/evaluation of the datasets they're presenting. This ought to be a simple check for them.
And to be clear, this is actually a common problem, not an uncommon one. Here's a bit more why. In general, can you tell me how I can identify duplicates in my dataset? Ken's methods only work under certain assumptions. The Filipino test only works because there is an exact match. It would not work if one was a subset of the other. Kinnews does a bit better, but also assumes precise matches. It's also important to remember that these are not very large datasets. Filipino is <1Mb and Kinnews is ~5M (the one used). MNIST is twice as large. The images also make it unhashable. So now we gotta do a double for loop. Each test image (10k) needs to be compared against each train image (60k). Granted, these are both trivially parallelizable loops, but I wanted to get an estimate and it too about 15 minutes (serially) to compute this and some 4GB. You can do much better, but that scale is going to eat you up. We're only talking about 784 dims. CIFAR-10, which is still small, is 3072 dims (almost 4x). ImageNet-1k ~= 200k (over a million train images and 100k test images), a 512x512 image is 786k, and 1024 is 3.1M.
So what do you do? Probabilistic method like a bloom filter? What about semantically similar data points? How do we define this? That's still an open problem[0]. Is this image[1] and this image[2] the same? What about this one?[3] I grabbed these with clip retrieval using "United Nations logo"[4] which is looking at the LAION 5B dataset. But you can also explore COCO[5], which mind you, people use COCO and ImageNet as a "zero-shot" classifier for models trained on LAION.
These images won't be exact matches and they aren't easy to filter out. Hell, matching images to pixel perfect values is a well known graphics problem and is how people do Canvas Fingerprinting. The silicon lottery plays a big role in this difference and so just using different machines to scrape the web can result in two people grabbing the exact same image with those images not matching.
I know that this problem looks easy at face value, but what I'm trying to tell you is that it is actually incredibly complex. The devil lives in the details. And like I said, they could do vetting for exact duplication and small datasets, but that only goes so far. This is a nasty problem and there's a reason people are so critical of LLMs. Because you bet there's test set spoilage. Anyone saying there isn't is either lying or ignorant.
Do not fool yourself into thinking a problem is easier than it is. You'll get burned.
[0] https://arxiv.org/abs/2303.09540
[1] https://vignette3.wikia.nocookie.net/overwatchfanon/images/b...
[2] https://nevensuboticstiftung.de/cms/wp-content/themes/nss-th...
[3] https://cmea-agmc.ca/sites/default/files/styles/150px_wide_x...
[4] https://rom1504.github.io/clip-retrieval/?back=https%3A%2F%2...
https://m.youtube.com/watch?v=jkdWzvMOPuo
He tests the algo without the flaw and is surprised it still works rather well.