When Are Learned Models Better Than Hash Functions?

07/03/2021
by   Ibrahim Sabek, et al.
0

In this work, we aim to study when learned models are better hash functions, particular for hash-maps. We use lightweight piece-wise linear models to replace the hash functions as they have small inference times and are sufficiently general to capture complex distributions. We analyze the learned models in terms of: the model inference time and the number of collisions. Surprisingly, we found that learned models are not much slower to compute than hash functions if optimized correctly. However, it turns out that learned models can only reduce the number of collisions (i.e., the number of times different keys have the same hash value) if the model is able to over-fit to the data; otherwise, it can not be better than an ordinary hash function. Hence, how much better a learned model is in avoiding collisions highly depends on the data and the ability of the model to over-fit. To evaluate the effectiveness of learned models, we used them as hash functions in the bucket chaining and Cuckoo hash tables. For bucket chaining hash table, we found that learned models can achieve 30 Cuckoo hash tables, in some datasets, learned models can increase the ratio of keys stored in their primary locations by around 10 learned models can indeed outperform hash functions but only for certain data distributions and with a limited margin.

READ FULL TEXT
POST COMMENT

Comments

There are no comments yet.

Authors

page 1

page 2

page 3

page 4

12/27/2017

Cuckoo++ Hash Tables: High-Performance Hash Tables for Networking Applications

Hash tables are an essential data-structure for numerous networking appl...
03/28/2022

Learning to Collide: Recommendation System Model Compression with Learned Hash Functions

A key characteristic of deep recommendation models is the immense memory...
02/11/2018

Binary Pebbling Algorithms for In-Place Reversal of One-Way Hash Chains

We present optimal binary pebbling algorithms for in-place reversal (bac...
07/05/2019

HashGraph – Scalable Hash Tables Using A Sparse Graph Data Structure

Hash tables are ubiquitous and used in a wide range of applications for ...
06/01/2020

DHash: Enabling Dynamic and Efficient Hash Tables

Given a specified average load factor, hash tables offer the appeal of c...
12/17/2018

Fuzzy Hashing as Perturbation-Consistent Adversarial Kernel Embedding

Measuring the similarity of two files is an important task in malware an...
09/16/2019

RVH: Range-Vector Hash for Fast Online Packet Classification

Packet classification according to multi-field ruleset is a key componen...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.