NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Linear Hashing

Noga Alon, Martin Dietzfelbinger, Peter Bro Miltersen, Erez Petrank, Gábor Tardos

TL;DR

This paper investigates the performance of linear hash functions—a staple in data structures—by analyzing the expected size of the largest hash bucket. The authors reveal a striking dichotomy: while linear hashing over large finite fields can perform poorly (approaching worst-case universal bounds), hashing over the field of two elements ($GF(2)$) is nearly as efficient as a truly random function.

What Problem Does This Paper Address?

In computer science, we often use universal hashing to distribute data across buckets. While the "average" performance of universal hashing is well-understood (it minimizes collisions), its "fine-grained" behavior—specifically the maximum bucket size—is more elusive.

If you use a truly random function to hash $n$ items into $n$ buckets, the largest bucket is expected to be quite small: roughly $\Theta(\log n / \log \log n)$. However, the standard definition of universal hashing only guarantees a maximum bucket size of $O(\sqrt{n})$. This paper asks: where does linear hashing (a specific, widely-used class of universal hash functions) actually fall on this spectrum? Does it behave like a random function, or is it closer to the pessimistic universal bound?

Methods

The authors use rigorous probabilistic and combinatorial proofs to analyze linear and affine transformations between vector spaces over a finite field $F$.

  1. Lower Bound Construction: To show that large fields are "bad," the authors use projective geometry. They construct specific "bad sets" in the plane that, when collapsed by a linear map, result in large clusters.
  2. Upper Bound Analysis: For the "good" case (the field $GF(2)$), the authors develop a new tool regarding the covering property. They analyze the probability that a random linear mapping from a large domain to a smaller range will "cover" every element in that range.
  3. Probabilistic Bridging: They use a technique inspired by Vapnik-Chervonenkis (VC) theory to bound the probability of "bad events" (large buckets) by relating them to the covering property of intermediate transformations.

Datasets

Not discussed in the paper. As a theoretical computer science paper, the results are derived through mathematical proofs rather than empirical benchmarks on specific datasets.

Key Insights and Ideas

  • "Large Fields are Bad, Small Fields are Good": This is the central theme. The structural "rigidity" of linear maps over large fields allows an adversary to pick a set of points that aligns perfectly with the map's kernel, causing massive collisions. In contrast, the "granularity" of $GF(2)$ makes it much harder for such bad sets to exist.
  • The Geometry of Collisions: For large fields, the authors show that linear hashing essentially "collapses" lines in a random direction. A bad set is one that contains many points on many different lines. By using a projective transformation, they can turn a structured grid into a set where many "popular" lines intersect in ways that a linear map cannot avoid.
  • The Covering Lemma: A significant contribution is Theorem 2, which states that if a set $S$ in a vector space over $GF(2)$ is slightly larger than the range $R$ (by a factor of $\log |R|$), a random linear map will cover the entire range with high probability. This property is what prevents any single bucket from becoming too large.

Key Results

  • Large Fields ($|F| = n$): The expected maximum bucket size is at least $\Omega(n^{1/3})$. If $n$ is a perfect square, there exists a set where the largest bucket is always at least $\sqrt{n}$. This confirms that for large fields, linear hashing is significantly worse than a random map.
  • Small Fields ($GF(2)$): The authors significantly improved the known upper bound for the expected maximum bucket size from $O(2^{\sqrt{\log n}})$ to $O(\log n \log \log n)$.
  • Comparison to Randomness: For $GF(2)$, linear hashing is remarkably close to the $\Theta(\log n / \log \log n)$ performance of a truly random function, making it a highly robust choice for practical implementations like chained hashing.

Limitations and Future Work

  • Intermediate Fields: The paper focuses on the extremes (size 2 vs. size $n$). The behavior of linear hashing over intermediate field sizes (e.g., $GF(2^k)$ for small $k$) remains a "rough generalization" in their discussion and invites tighter bounds.
  • The Optimality Gap: For $GF(2)$, there is still a small gap between the $O(\log n \log \log n)$ upper bound and the $\Theta(\log n / \log \log n)$ benchmark. The authors leave it as an open question whether linear maps over $GF(2)$ are truly as good as random functions.
  • Other Hash Families: The authors suggest investigating whether other popular schemes, such as multiplication-based hashing or Boolean convolution, share these fine-grained occupancy properties.

Summary updated

BibTeX
@inproceedings{alon1997linear,
  author = {Noga Alon and Martin Dietzfelbinger and Peter Bro Miltersen and Erez Petrank and Gábor Tardos},
  title = {{Linear Hashing}},
  booktitle = {BRICS},
  year = {1997},
  doi = {10.7146/brics.v4i16.18808},
}

Loading related content...

Figure