Practical Hash Functions for Similarity Estimation and Dimensionality Reduction

11/23/2017
by   Søren Dahlgaard, et al.
0

Hashing is a basic tool for dimensionality reduction employed in several aspects of machine learning. However, the perfomance analysis is often carried out under the abstract assumption that a truly random unit cost hash function is used, without concern for which concrete hash function is employed. The concrete hash function may work fine on sufficiently random input. The question is if it can be trusted in the real world when faced with more structured input. In this paper we focus on two prominent applications of hashing, namely similarity estimation with the one permutation hashing (OPH) scheme of Li et al. [NIPS'12] and feature hashing (FH) of Weinberger et al. [ICML'09], both of which have found numerous applications, i.e. in approximate near-neighbour search with LSH and large-scale classification with SVM. We consider mixed tabulation hashing of Dahlgaard et al.[FOCS'15] which was proved to perform like a truly random hash function in many applications, including OPH. Here we first show improved concentration bounds for FH with truly random hashing and then argue that mixed tabulation performs similar for sparse input. Our main contribution, however, is an experimental comparison of different hashing schemes when used inside FH, OPH, and LSH. We find that mixed tabulation hashing is almost as fast as the multiply-mod-prime scheme ax+b mod p. Mutiply-mod-prime is guaranteed to work well on sufficiently random data, but we demonstrate that in the above applications, it can lead to bias and poor concentration on both real-world and synthetic data. We also compare with the popular MurmurHash3, which has no proven guarantees. Mixed tabulation and MurmurHash3 both perform similar to truly random hashing in our experiments. However, mixed tabulation is 40 faster than MurmurHash3, and it has the proven guarantee of good performance on all possible input.

READ FULL TEXT
research
05/03/2022

Understanding the Moments of Tabulation Hashing via Chaoses

Simple tabulation hashing dates back to Zobrist in 1970 and is defined a...
research
08/27/2023

Locally Uniform Hashing

Hashing is a common technique used in data processing, with a strong imp...
research
05/04/2023

A Sparse Johnson-Lindenstrauss Transform using Fast Hashing

The Sparse Johnson-Lindenstrauss Transform of Kane and Nelson (SODA 2012...
research
07/17/2020

Frequency Estimation in Data Streams: Learning the Optimal Hashing Scheme

We present a novel approach for the problem of frequency estimation in d...
research
05/22/2018

Fully Understanding the Hashing Trick

Feature hashing, also known as the hashing trick, introduced by Weinber...
research
08/19/2020

The Power of Hashing with Mersenne Primes

The classic way of computing a k-universal hash function is to use a ran...
research
05/01/2019

Fast hashing with Strong Concentration Bounds

Previous work on tabulation hashing of Pǎtraşcu and Thorup from STOC'11 ...

Please sign up or login with your details

Forgot password? Click here to reset