Skip to content

Fast Construction of Learned Count-Min Sketch via Ternary Search

Ryusuke Inami, Yusuke Matsui

cs.DSarXiv:2608.08615

Abstract

The Learned Count-Min Sketch (LCMS) is a learned data structure that estimates element frequencies in a multiset and has been experimentally shown to outperform classical data structures in the capacity-accuracy trade-off. However, its performance depends heavily on parameter selection. Because systematic optimization has not been adequately discussed, previous approaches relied on inefficient brute-force methods. In this study, we propose a method to rapidly optimize the parameters of the original LCMS. We experimentally confirmed that when the machine learning model performs well enough, using a single hash function is sufficient to optimize the weighted error metric. Based on this, we introduce a ternary search approach to efficiently find the optimal proportion of Unique Buckets. Our method achieves the same performance as brute-force approaches while speeding up parameter optimization by 216-729 times when the machine learning model's performance is sufficient. Furthermore, even when the model's performance is suboptimal, our approach still determines appropriate parameters 221-740 times faster than the brute-force approach.

Create a lesson