TL;DR
This paper demonstrates that when using binary hashing for similarity search, using two different hash functions (asymmetric hashing) is significantly more powerful than using the same function for both items. Even when the underlying similarity measure is symmetric, asymmetric hashing can achieve the same accuracy with much shorter codes—sometimes exponentially shorter—without increasing computational or storage costs during search.
What Problem Does This Paper Address?
In modern data science, we often need to find "nearby" items in massive, high-dimensional datasets (like images or documents). To do this quickly, we use binary hashing: we map complex objects to short strings of 0s and 1s. Comparing these bitstrings (using Hamming distance) is incredibly fast and memory-efficient.
Traditionally, researchers have used a single hash function $f(x)$ to encode both the query and the database items. The assumption was that if the similarity between $x$ and $x'$ is symmetric, the hash function should be too. However, this symmetry imposes a strict mathematical constraint on the "representational power" of the hash. The authors ask: Can we get better results by breaking this symmetry and using two different functions, $f(x)$ and $g(x')$, to approximate the same similarity?
Methods
The authors propose an asymmetric hashing framework where the similarity between two objects is approximated by the Hamming distance between two distinct binary codes.
They explore two specific models:
- LIN:LIN: Two different linear threshold functions are learned ($f(x) = \text{sign}(W_q x)$ and $g(x) = \text{sign}(W_d x)$). One is used for queries, the other for the database.
- LIN:V: A linear threshold function is learned for queries, but for the database (which is fixed), they allow arbitrary binary codewords ($v_i$) for each item. This is the "ultimate" asymmetry—the database side isn't even constrained by a specific functional form.
To train these models, they formulate a discrete optimization problem to minimize a weighted loss function (a variant of logistic loss). Since the problem is non-convex and discrete, they use a local search strategy, alternating between updating the query bits and the database bits.
Datasets
The authors evaluated their approach on six diverse datasets:
- LabelMe & Peekaboom: Image collections represented by 512D GIST features.
- Photo-tourism: Image patches represented by 128D SIFT features.
- MNIST: 785D grayscale handwritten digits.
- Nursery: A small 8D feature dataset.
- 10-D Uniform: A synthetic dataset of points uniformly distributed in a 10-dimensional hypercube.
- Semantic 22K LabelMe: A larger-scale version (22,000 images) used to test semantic similarity rather than just Euclidean distance.
Key Insights and Ideas
- The Exponential Gap: The most striking theoretical insight is Theorem 1. The authors prove that there exist datasets where an asymmetric hash needs only $O(r)$ bits to represent similarity perfectly, while a symmetric hash would require at least $\Omega(2^r)$ bits. This proves that asymmetry isn't just a minor tweak; it's a fundamental leap in representational efficiency.
- Asymmetry is "Free": In a typical database scenario, you pre-compute hashes for the database and compute a hash for the query at runtime. Using different functions for each doesn't change the number of operations or the amount of memory used. It is essentially a "free" performance boost.
- Unconstrained Database Mappings: The LIN:V model highlights that if your database is fixed, you don't actually need a "function" to encode it. You can just optimize the bits for each entry directly to best match the query function. This provides maximum flexibility for the hashing scheme.
Key Results
- Superior Accuracy at Shorter Lengths: Across all datasets, asymmetric methods consistently outperformed state-of-the-art symmetric methods like Minimal Loss Hashing (MLH) and Kernel-Based Supervised Hashing (KSH).
- Dramatic Bit Reduction: On the LabelMe dataset, the asymmetric LIN:V model achieved the same Average Precision (AP) with just 8 bits that symmetric models required 16 bits to reach.
- Consistency: The performance gain was most pronounced for very short codes (8–24 bits), which are the most desirable for high-speed applications and memory-constrained environments.
- Semantic Retrieval: On the larger Semantic 22K LabelMe dataset, LIN:V with 64 bits substantially outperformed well-optimized symmetric competitors, showing the method scales well to semantic tasks.
Limitations and Future Work
- Optimization Strategy: The authors admit their optimization approach is "crude" (a simple local search/coordinate descent). They suggest that more sophisticated, well-founded training procedures could yield even better results.
- Generalization: While the paper addresses out-of-sample generalization for queries, the LIN:V model is specifically designed for a fixed database. If the database changes frequently, the LIN:LIN model is more appropriate, though slightly less powerful than LIN:V.
- Theoretical Scope: The theoretical proof uses a somewhat extreme construction. While real-world data shows significant gains, they aren't always as "exponential" as the theoretical worst-case scenario suggests.
Summary updated