🤖 AI Summary
Neural sketches suffer from poor generalization across data domains, inflexible memory allocation, and a lack of theoretical error guarantees. To address these issues, this paper proposes Lego Sketch—a modular, scalable neural sketch architecture—whose core innovation is the decoupling of memory-augmented neural networks (MANNs) into composable “memory bricks,” enabling dynamic adaptation to varying memory budgets and data stream distributions. We establish, for the first time, a provable upper bound on estimation error for neural sketches. Lego Sketch achieves unified high-accuracy frequency estimation across domains and memory constraints. Extensive experiments on diverse real-world data streams demonstrate that Lego Sketch significantly outperforms classical sketches (e.g., Count-Min, CMS) and state-of-the-art neural sketches: under identical memory budgets, it reduces average relative error by 32%–57%, thereby achieving superior trade-offs among time, space, and accuracy.
📝 Abstract
Sketches, probabilistic structures for estimating item frequencies in infinite data streams with limited space, are widely used across various domains. Recent studies have shifted the focus from handcrafted sketches to neural sketches, leveraging memory-augmented neural networks (MANNs) to enhance the streaming compression capabilities and achieve better space-accuracy trade-offs.However, existing neural sketches struggle to scale across different data domains and space budgets due to inflexible MANN configurations. In this paper, we introduce a scalable MANN architecture that brings to life the {it Lego sketch}, a novel sketch with superior scalability and accuracy. Much like assembling creations with modular Lego bricks, the Lego sketch dynamically coordinates multiple memory bricks to adapt to various space budgets and diverse data domains. Our theoretical analysis guarantees its high scalability and provides the first error bound for neural sketch. Furthermore, extensive experimental evaluations demonstrate that the Lego sketch exhibits superior space-accuracy trade-offs, outperforming existing handcrafted and neural sketches. Our code is available at https://github.com/FFY0/LegoSketch_ICML.