Arithmetic Variable LogLog: Advancing the Memory-Variance Frontier
This paper introduces Arithmetic Variable LogLog (AVLL), a new cardinality estimation algorithm that surpasses the state-of-the-art ExaLogLog in both accuracy and speed by utilizing arithmetic encoding and an early-exit mechanism to achieve a superior memory-variance product across all tested sizes.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are running a massive party where millions of guests are streaming through the door, but you only have a tiny notebook to keep track of who is there. You can't write down every single name—that would fill up your notebook instantly. Instead, you need a clever trick to guess how many unique people have shown up without counting them one by one. This is the problem of "cardinality estimation," a puzzle that has fascinated computer scientists for decades. The goal is to squeeze the most accurate guess out of the smallest amount of memory possible.
For a long time, the best way to do this was like having a row of lockers, each with a specific size. You'd toss a guest's name into a locker based on a random code, and if the locker was empty, you'd mark it. If it was already full, you'd check if the new guest was "more unique" than the one already inside. The more lockers you had, the better your guess. But there was a catch: to get a super-accurate guess, you needed either more lockers (which took up more space) or bigger lockers that could hold more detailed information about each guest. For years, the debate was: is it better to have a few giant, super-detailed lockers, or a huge crowd of tiny, simple ones?
Enter a new contender called Arithmetic Variable LogLog (AVLL). Think of it as a magician who realized that the old way of packing lockers was wasteful. Instead of using rigid, pre-sized slots, AVLL uses a flexible, "arithmetic" packing method that fits way more tiny lockers into the same amount of space. The paper suggests that by squeezing in 5.5 times more of these tiny lockers, the system can make a much better guess than the previous champions, even though each individual locker holds less information. It's like realizing that having 1,000 tiny, quick-peek cameras gives you a better picture of a crowd than having just 200 giant, slow-motion cameras.
The Paper's Big Discovery
The author, Brian Bushnell, presents AVLL as a new way to count unique items in a data stream. They found that by using a clever math trick called "base-56 arithmetic encoding," they could pack 11 registers (the digital lockers) into a single 64-bit word of computer memory. In the past, standard methods would waste bits trying to fit these registers into fixed slots, but AVLL uses every single bit, leaving zero waste.
This packing trick gives AVLL a massive advantage: at a memory size of 1 KB (which is tiny in computer terms), AVLL can store 1,408 registers, whereas the previous state-of-the-art method, called ExaLogLog, could only fit 256 registers in the same space. That's a 5.5× advantage in the number of observations the system can make.
The paper shows that this "more is better" approach works incredibly well. In tests using 128,000 independent simulations, AVLL achieved a width-weighted mean absolute error of 1.63% at 1 KB. In comparison, ExaLogLog had an error of 1.71%. While that difference might sound small, in the world of high-precision counting, it's a significant win. The author calculated a "memory-variance product" (a score for how efficiently memory is used) of approximately 3.4 for AVLL, which is lower (and therefore better) than ExaLogLog's practical score of 3.78 and even beats its theoretical best of 3.67.
Speeding Up the Count
But AVLL isn't just more accurate; it's also surprisingly fast, especially when the computer is busy. The paper describes a mechanism called "early exit." Imagine a bouncer at the party door who can instantly tell if a guest is someone they've already seen, without even looking at the guest list. AVLL does this by comparing a guest's code to a global "floor" value. If the code is below the floor, the guest is ignored immediately, and the system doesn't even touch the memory where the lockers are stored.
In tests where thousands of these counting systems were running at once (simulating a crowded computer cache), AVLL was 2.7 to 4.5 times faster than ExaLogLog. This is because ExaLogLog has to check its memory for every single item, even if it's a duplicate, while AVLL filters out the vast majority of duplicates before they ever reach the memory. At high numbers of unique items, AVLL rejects about 96% of incoming data without touching the registers, keeping the system running smoothly.
What This Means (and What It Doesn't)
The paper explicitly rules out the idea that "richer" registers (like ExaLogLog's huge 32-bit lockers that store detailed history) are always better. The results suggest that for this specific type of counting problem, having more independent observations (more registers) is more valuable than having richer data per observation.
However, the author is careful to note that AVLL is not "idempotent" in the strictest sense. This means that if you feed the exact same duplicate data into the system twice, it might behave slightly differently than if you fed it once, though the paper shows that in practical tests with heavy duplication, the accuracy didn't drop at all. They also admit that their "HLDLC" estimator is a clever blend of different math formulas found through massive simulation, rather than a mathematically proven "perfect" solution like ExaLogLog's maximum likelihood estimator.
The paper concludes that AVLL is a self-contained tool (written as a single Java class) that is ready to use. It handles massive amounts of data without running out of memory space for the counter itself, and it works just as well whether the data is a chaotic mix of unique items or a repetitive stream of duplicates. The core message is a shift in philosophy: in the battle for memory efficiency, density beats richness. By packing more simple, independent counters into the same space, we can get a clearer, faster, and more accurate picture of the data stream.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.