arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.27405cs.DS
收藏

DynamicLogLog: 更快、更小、更准确的基数估计

DynamicLogLog: Faster, Smaller, and More Accurate Cardinality Estimation

DOE Joint Genome Institute, Lawrence Berkeley National Laboratory(美国能源部联合基因组研究所,劳伦斯伯克利国家实验室)

Brian Bushnell

AI总结:

本文提出DynamicLogLog算法,通过共享指数和相对前导零计数实现更小的内存占用、更快的处理速度和更平的误差分布,对比实验显示其在精度和效率上优于传统HyperLogLog方法。

摘要:

基数估计——计算数据流中不同元素的数量——是一个长期存在的问题,应用于网络到生物信息学等多个领域。HyperLogLog(HLL)是主流标准,但其在转换区域存在已知的误差尖峰,并且需要每个桶6位,数据结构大小随B*log(log(cardinality))增长。我们提出DynamicLogLog(DLL),通过所有桶共享指数,仅存储相对前导零计数。这带来了三个优势:(1)每个桶仅需4位(内存减少33%),(2)一个提前退出掩码在高基数时拒绝超过99.9%的元素在任何桶访问之前(在带宽受限情况下比HLL快10倍以上),(3)通过动态线性计数(DLC)和对数混合融合消除HLL的转换伪影。将最大可表示基数平方仅需要额外的一位全局状态。在2048个桶和512k次模拟中,DLL4的混合估计在1024字节下实现1.830%的均值误差和1.834%的峰值绝对误差,相比HLL在1536字节下的1.84%均值误差和34.1%峰值误差。DLC在无修正因子时实现1.90%的均值误差。动态UltraLogLog(UDLL6),DLL和UltraLogLog的融合,在75%的内存下达到ULL级别的精度。历史校正变体(Hybrid+n)和分层DLC(LDLC)通过每状态校正表和反相误差消除进一步改进。

英文摘要:

Cardinality estimation - calculating the number of distinct elements in a stream - is a longstanding problem with applications from networking to bioinformatics. HyperLogLog (HLL), the prevailing standard, has a well-known error spike in its transition region and requires 6 bits per bucket, with data structure size scaling as B*log(log(cardinality)). We present DynamicLogLog (DLL), which uses a shared exponent across all buckets, storing only relative leading-zero counts. This yields three benefits: (1) only 4 bits per bucket (33% memory reduction), (2) an early exit mask that rejects >99.9% of elements at high cardinality before any bucket access (over 10x faster than HLL when bandwidth-constrained), and (3) a flat error profile via Dynamic Linear Counting (DLC) and a Logarithmic Hybrid Blend that eliminates HLL's transition artifact. Squaring the maximum representable cardinality requires only a single additional bit of global state. At 2,048 buckets with 512k simulations, DLL4's hybrid estimate achieves 1.830% mean and 1.834% peak absolute error using 1,024 bytes, compared to 1.84% mean and 34.1% peak for HLL using 1,536 bytes. DLC achieves 1.90% mean without correction factors. DynamicUltraLogLog (UDLL6), a fusion of DLL and UltraLogLog, achieves ULL-level accuracy at 75% of the memory. History-corrected variants (Hybrid+n) and Layered DLC (LDLC) provide further improvements using per-state correction tables and anti-phase error cancellation.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑