Papers
Topics
Authors
Recent
Search
2000 character limit reached

Mixed Tabulation Hashing

Updated 5 July 2026
  • Mixed Tabulation is a hashing scheme that extends simple tabulation by incorporating derived characters via XOR to simulate near-fully random behavior.
  • It achieves strong concentration bounds and moment guarantees, making it effective for similarity estimation, feature hashing, and locality-sensitive hashing while remaining cache-friendly.
  • Empirical studies show that mixed tabulation outperforms simpler schemes in bias and variance, closely approximating truly random hashing with minimal computational overhead.

Mixed tabulation is a tabulation-based hashing scheme that augments simple tabulation with a small number of derived characters and then hashes both original and derived characters via XOR. In the formulation emphasized by Dahlgaard et al. and by the empirical and analytical study of practical similarity estimation and dimensionality reduction, it functions both as a concrete hash construction and as a mechanism for transferring “truly random” guarantees into practical algorithms such as one permutation hashing, feature hashing, and locality-sensitive hashing (Dahlgaard et al., 2017). Subsequent analysis based on chaoses sharpened this perspective by showing that mixed tabulation admits logarithmic moment bounds comparable to fully random hashing for broad classes of hash-based sums, thereby strengthening its theoretical standing as a practical replacement for idealized random hashing in sketching and streaming contexts (Houen et al., 2022).

1. Definition and construction

Mixed tabulation starts from simple tabulation hashing. Keys are viewed as cc characters over an alphabet Σ\Sigma, so a key x[2w]x \in [2^w] is written as

x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].

In simple tabulation, one chooses cc independent random tables

Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,

and defines

h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].

This requires only table lookups and XOR, but it is not fully random and can fail in some worst-case settings (Dahlgaard et al., 2017).

Mixed tabulation enriches this construction by deriving additional characters from the key and hashing those as well. In the version recalled in the 2017 study, one chooses parameters c,d1c,d \ge 1, writes x=(x0,,xc1)x=(x_0,\dots,x_{c-1}), and first computes derived characters using tables

T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,

via

Σ\Sigma0

where Σ\Sigma1. One then chooses Σ\Sigma2 random tables

Σ\Sigma3

and defines the final hash

Σ\Sigma4

The resulting scheme uses one first-layer set of tables to create a derived signature Σ\Sigma5 and one second-layer set of tables to hash both original and derived characters (Dahlgaard et al., 2017).

The 2017 paper gives a concrete C++ implementation for 32-bit keys with Σ\Sigma6, 8-bit characters, and 32-bit output. In that instantiation, the table sizes are chosen so that the construction remains cache-friendly. The same paper states that for 32-bit keys with Σ\Sigma7 and Σ\Sigma8, mt_T1 uses approximately Σ\Sigma9 KB and mt_T2 approximately x[2w]x \in [2^w]0 KB, for a total of about x[2w]x \in [2^w]1 KB (Dahlgaard et al., 2017).

A related formulation used in the 2022 moment analysis writes mixed tabulation as

x[2w]x \in [2^w]2

where x[2w]x \in [2^w]3, x[2w]x \in [2^w]4, and x[2w]x \in [2^w]5 are independent simple tabulation hash functions (Houen et al., 2022). This presentation makes explicit that mixed tabulation is a layered composition of tabulation schemes. In practice, the same source notes that x[2w]x \in [2^w]6 and x[2w]x \in [2^w]7 can be combined into a single simple-tabulation table mapping x[2w]x \in [2^w]8 to x[2w]x \in [2^w]9, so evaluating x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].0 takes x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].1 table lookups (Houen et al., 2022).

2. Relation to simple tabulation and design rationale

Mixed tabulation belongs to the line of work on practical hash families that aim to provide stronger guarantees than simple universal hashing while remaining much faster than cryptographic primitives. Standard simple tabulation is only 3-independent, yet prior work showed that it satisfies several pseudo-random properties sufficient for many applications. Mixed tabulation was introduced to strengthen this behavior by adding a derived-character layer that increases effective independence in a structured way while keeping table sizes small (Houen et al., 2022).

The 2017 study characterizes mixed tabulation as a scheme that “performs like a truly random hash function in many applications,” including one permutation hashing. For feature hashing, the same paper argues that mixed tabulation behaves similarly to truly random hashing on sparse input (Dahlgaard et al., 2017). The 2022 work sharpens the comparison by showing that mixed tabulation can inherit moment bounds that are, up to constants depending only on x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].2, as strong as those for fully random hashing for all moments up to logarithmic in the universe size (Houen et al., 2022).

The design rationale is therefore twofold. First, the construction preserves the low-level efficiency of table lookups and XOR. Second, the derived-character step is intended to break the worst-case dependencies that simple tabulation can exhibit. The 2022 paper states this point explicitly in technical terms: the additional level of tabulation does not break the chaos structure used in the analysis, but instead improves it by breaking the worst-case dependencies of simple tabulation (Houen et al., 2022).

A common misconception is to equate mixed tabulation with high x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].3-wise independence. The 2017 paper states that mixed tabulation is not x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].4-wise independent in the classic sense, but is shown to behave as if fully random for key sets up to a certain size, which is sufficient for OPH, FH, and the LSH constructions considered there (Dahlgaard et al., 2017). This distinction is central: the construction is not intended to realize full independence as a combinatorial object, but to provide selective full-randomness and concentration behavior adequate for concrete sketching algorithms.

3. Core theoretical guarantees

Two distinct but complementary theoretical themes emerge from the cited works. The first concerns transfer of “fully random” guarantees to algorithms operating on sparse subsets. The second concerns moment bounds for hash-based sums.

The 2017 paper recalls a result from the FOCS’15 introduction of mixed tabulation: for a large class of sketching algorithms, if mixed tabulation is used with moderate parameters x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].5, then for any subset of the universe of size at most x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].6, it behaves like a fully random function up to an error probability decaying polynomially in x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].7. In the case of one permutation hashing, the same paper summarizes this as Chernoff-style concentration bounds for Jaccard similarity estimation. More informally, for any set of keys of size at most x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].8, OPH implemented with mixed tabulation has collision and concentration behavior essentially matching the fully random case, except with probability x=(x0,x1,,xc1),xiΣ=[2w/c].x = (x_0, x_1, \ldots, x_{c-1}), \quad x_i \in \Sigma = [2^{w/c}].9 over the random choice of the hash tables (Dahlgaard et al., 2017).

For feature hashing, the 2017 study first proves an improved tail bound under truly random hashing. Let cc0 with cc1, and let cc2 be the cc3-dimensional feature-hashed vector obtained from a truly random hash cc4 and sign map cc5. Under the conditions

cc6

and

cc7

the paper states

cc8

It then derives a mixed-tabulation analogue: if both the index hash and the sign are derived from a single mixed tabulation function cc9, and if

Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,0

then

Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,1

The interpretation given in the paper is that feature hashing implemented with mixed tabulation enjoys essentially the same concentration bound as the fully random case for sparse vectors, up to an additive error probability that decays polynomially in Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,2 and exponentially in Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,3 (Dahlgaard et al., 2017).

The 2022 paper develops a more general theory in terms of hash-based sums

Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,4

with zero row sums Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,5, and parameters

Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,6

Its principal mixed-tabulation theorem states that if Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,7 is mixed tabulation with Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,8 derived characters, then for all Ti:Σ[m],i=0,,c1,T_i : \Sigma \to [m], \quad i=0,\dots,c-1,9,

h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].0

where h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].1 and

h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].2

The same source emphasizes that the structure of this bound is identical to the fully random benchmark, except for the scaling of h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].3 and h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].4 by h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].5 (Houen et al., 2022).

Under the additional condition h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].6, the 2022 paper derives a tail bound

h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].7

with h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].8 and h(x)=i=0c1Ti[xi].h(x)=\bigoplus_{i=0}^{c-1} T_i[x_i].9. The paper interprets this as saying that, for mixed tabulation with range polynomial in c,d1c,d \ge 10, all tails look like those of fully random hashing up to a constant factor in the exponent (Houen et al., 2022).

4. Use in similarity estimation, dimensionality reduction, and LSH

The most detailed application study appears in the 2017 paper, which considers one permutation hashing, feature hashing, and locality-sensitive hashing (Dahlgaard et al., 2017).

In one permutation hashing, a single hash c,d1c,d \ge 11 is split into a bin and a value,

c,d1c,d \ge 12

and a sketch records per-bin minima. A basic estimator of Jaccard similarity counts the fraction of bins where the resulting values match. In the mixed-tabulation implementation, no structural change to OPH is required; only the basic hash implementation changes. The same paper states that, from the FOCS’15 theory, OPH’s estimator remains unbiased under mixed tabulation and satisfies Chernoff-type concentration bounds equivalent to using a truly random permutation, provided each sketch processes at most c,d1c,d \ge 13 distinct keys (Dahlgaard et al., 2017).

In feature hashing, a vector c,d1c,d \ge 14 is mapped to c,d1c,d \ge 15 by hashing feature indices to buckets and assigning random signs: c,d1c,d \ge 16 The 2017 paper shows that a single mixed-tabulation function can generate both the bucket index and the sign by splitting output bits. It then proves, under sparsity and bounded c,d1c,d \ge 17, that the concentration of c,d1c,d \ge 18 around c,d1c,d \ge 19 matches the truly random case up to the additive x=(x0,,xc1)x=(x_0,\dots,x_{c-1})0 term (Dahlgaard et al., 2017).

The same paper also examines LSH schemes built on OPH. In the classic framework, x=(x0,,xc1)x=(x_0,\dots,x_{c-1})1 independent hash tables are keyed by sketches of size x=(x0,,xc1)x=(x_0,\dots,x_{c-1})2, and query efficiency depends heavily on sketch collision probabilities. The study states that when multiply-shift is used, bias in OPH similarity estimates overestimates similarities, producing fatter buckets, slightly increasing recall but significantly increasing the number of retrieved points. By contrast, mixed tabulation gives essentially unbiased similarity estimates, buckets sized as predicted by the theory for fully random hashing, and retrieved/recall ratios comparable to the 20-wise PolyHash baseline (Dahlgaard et al., 2017).

A plausible implication is that mixed tabulation is valuable not only because it preserves estimator bias and variance, but because these properties propagate to higher-level indexing structures. The 2017 paper makes this propagation explicit for LSH: the OPH bias and concentration issues of simple hash families translate directly into worse LSH performance, whereas mixed tabulation preserves the theoretical behavior expected under fully random hashing (Dahlgaard et al., 2017).

5. Empirical comparison with alternative hash functions

The 2017 paper provides an extensive comparison with multiply-shift, 2-wise and 3-wise PolyHash, MurmurHash3, CityHash, Blake2, and a 20-wise PolyHash baseline used as a proxy for truly random hashing (Dahlgaard et al., 2017). Its headline finding is that mixed tabulation is almost as fast as the multiply-mod-prime family while avoiding the bias and poor concentration that can arise for structured input.

The reported micro-benchmark timings for hashing x=(x0,,xc1)x=(x_0,\dots,x_{c-1})3 random integers and performing feature hashing on News20 with x=(x0,,xc1)x=(x_0,\dots,x_{c-1})4 are as follows:

Hash function Hash loop FH on News20
Multiply-shift 7.72 ms 55.78 ms
2-wise PolyHash 17.55 ms 82.47 ms
3-wise PolyHash 42.42 ms 120.19 ms
MurmurHash3 59.70 ms 159.44 ms
CityHash 59.06 ms 162.04 ms
Blake2 3476.31 ms 6408.40 ms
Mixed tabulation 42.98 ms 90.55 ms

From these measurements, the paper concludes that mixed tabulation is nearly as fast as 3-wise PolyHash, about x=(x0,,xc1)x=(x_0,\dots,x_{c-1})5–x=(x0,,xc1)x=(x_0,\dots,x_{c-1})6 slower than multiply-shift, around x=(x0,,xc1)x=(x_0,\dots,x_{c-1})7 faster than MurmurHash3 and CityHash, and orders of magnitude faster than Blake2 (Dahlgaard et al., 2017).

On synthetic OPH experiments with x=(x0,,xc1)x=(x_0,\dots,x_{c-1})8 and x=(x0,,xc1)x=(x_0,\dots,x_{c-1})9, multiply-shift and 2-wise PolyHash exhibit noticeable bias and much larger MSE, whereas mixed tabulation and MurmurHash3 behave essentially identically to 20-wise PolyHash, remaining unbiased and sharply concentrated around the true similarity. On more adversarial synthetic setups, the same paper reports that multiply-shift’s MSE can be T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,0–T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,1 times larger than that of mixed tabulation in OPH, and in feature hashing the MSE can be T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,2–T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,3 times larger (Dahlgaard et al., 2017).

On real-world feature hashing tasks using MNIST and News20, mixed tabulation and 20-wise PolyHash yield sharply concentrated, symmetric histograms centered near T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,4 for T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,5, while 2-wise PolyHash and multiply-shift show poor concentration. The paper gives a specific News20 example with T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,6: 2-wise PolyHash produced T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,7 as large as T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,8, while mixed tabulation’s maximum was about T1,i:ΣΣd,i=0,,c1,T_{1,i} : \Sigma \to \Sigma^d,\quad i=0,\dots,c-1,9 (Dahlgaard et al., 2017).

MurmurHash3 and CityHash are treated differently. The paper characterizes them as widely used, fast non-cryptographic hash functions with good empirical avalanche properties but no formal independence guarantees or rigorous pseudo-randomness proofs. Empirically, they behave almost indistinguishably from mixed tabulation and the 20-wise PolyHash baseline across OPH, FH, and LSH experiments, but they lack worst-case theoretical guarantees (Dahlgaard et al., 2017).

6. Analytical refinements and broader algorithmic consequences

The 2022 paper recasts the study of tabulation hashing through the language of chaoses. Its starting observation is that hash-based sums for simple tabulation can be written as sums of chaoses that are not independent. This perspective enables essentially optimal moment bounds for simple tabulation, and then lifts these results to mixed tabulation (Houen et al., 2022).

One consequence is sharper concentration for counting and sampling objects already studied in the earlier mixed-tabulation literature. The 2022 paper compares its results with the FOCS’15 selective full-randomness theorem for masked subsets Σ\Sigma00. Dahlgaard et al. had shown a concentration statement for Σ\Sigma01 with an error term involving Σ\Sigma02. Using the new moment bounds, the 2022 paper improves this to

Σ\Sigma03

which it describes as the same asymptotics as under fully random hashing (Houen et al., 2022).

The same work emphasizes that these bounds apply to all value functions Σ\Sigma04, not only to counting. It therefore places mixed tabulation on a broader footing for bin loads, threshold sampling, and weighted hash-based statistics. The paper further provides a conditional version of the moment bound with respect to a query key Σ\Sigma05, showing that concentration remains valid even after conditioning on Σ\Sigma06 (Houen et al., 2022).

For streaming and sketching, the 2022 study highlights Σ\Sigma07-partition frameworks such as HyperLogLog and one permutation hashing. It states that mixed tabulation now satisfies both requirements that such algorithms typically need: Chernoff-style behavior for partition sizes and suitable independence properties within partitions. It also notes that the improved concentration removes previous technical restrictions on Σ\Sigma08, specifically by removing some Σ\Sigma09 factors (Houen et al., 2022).

A plausible implication is that the later chaos-based analysis changes the role of mixed tabulation from a construction with several application-specific guarantees into a more general-purpose primitive for randomized algorithms whose analyses are driven by moments of hash-based sums. That inference is consistent with the paper’s summary that mixed tabulation becomes a strong candidate for a unified hash primitive in real implementations (Houen et al., 2022).

7. Practical use, limitations, and terminological ambiguity

The 2017 paper’s practical recommendation is explicit: mixed tabulation is an excellent practical basic hash function for similarity estimation via OPH, feature hashing for dimensionality reduction, and LSH schemes built on OPH or FH. The reasons it gives are speed close to simple arithmetic hashing, robustness similar to fully random hashing on all inputs rather than only sufficiently random ones, and proven guarantees unlike MurmurHash3 or CityHash (Dahlgaard et al., 2017).

Several implementation considerations are also stated there. Tables are filled with random bits, but true randomness is not required; the paper notes that it suffices in practice to fill them using a Σ\Sigma10-independent hash family, and elsewhere states that a 20-wise PolyHash is sufficient for initialization (Dahlgaard et al., 2017). The same source also remarks that mixed tabulation makes it easy to generate multiple hash values per key by computing a single wide output and splitting it into multiple words, with FOCS’15 showing that, with high probability over the choice of Σ\Sigma11, these halves behave independently (Dahlgaard et al., 2017).

The theoretical guarantees are nonetheless qualified. For feature hashing, the support-size condition

Σ\Sigma12

is required to invoke the transfer from full randomness (Dahlgaard et al., 2017). The 2022 moment bounds also incur constants Σ\Sigma13 and Σ\Sigma14 that grow like Σ\Sigma15, and the regime of interest is moments up to Σ\Sigma16 when the range is polynomial in Σ\Sigma17 (Houen et al., 2022). Both papers therefore present strong but not unlimited “fully random”-like guarantees.

A separate source of confusion is terminological. The phrase “mixed tabulation” is also used in the title "Continuous Diffusion for Mixed-Type Tabular Data" (Mueller et al., 2023), where it refers to mixed-type tabular data and not to tabulation hashing. In the hashing literature surveyed here, however, mixed tabulation denotes the specific hash construction introduced by Dahlgaard et al. and developed in subsequent work on similarity estimation, dimensionality reduction, and chaos-based concentration analysis (Dahlgaard et al., 2017, Houen et al., 2022).

In the hashing sense, mixed tabulation occupies a distinct position: it is a cache-resident, table-lookup-based hash family whose importance derives from a rare combination of empirical speed, worst-case robustness on structured input, and analytical guarantees that approximate the behavior of fully random hashing in the settings most relevant to sketching algorithms (Dahlgaard et al., 2017, Houen et al., 2022).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Mixed Tabulation.