A document can be represented by a high-dimensional vector.
Comparing that vector exactly against millions of others is expensive.
SimHash replaces the vector with a short binary fingerprint whose Hamming distance reflects angular similarity approximately.
Quick Read
SimHash is a locality-sensitive hashing method for cosine or angular similarity. Random hyperplanes divide the vector space. Each hyperplane contributes one bit according to which side of the plane the vector falls on. Nearby directions tend to produce similar bit strings.
One-sentence answer: SimHash is lossy because a rich vector becomes a short binary signature, preserving approximate direction while discarding most of its magnitude and coordinate-level detail.
Hyperplanes Turn Geometry Into Bits
Imagine drawing a random hyperplane through the origin.
A vector on one side receives bit 1.
A vector on the other receives bit 0.
Repeat with many random hyperplanes and each vector acquires a binary code.
Why Nearby Directions Produce Similar Codes
Two vectors with a small angle between them are less likely to be separated by a random hyperplane.
So they tend to agree on many bits.
Two distant directions disagree more often.
Hamming distance becomes a compact proxy for angular distance.
The Fingerprint Is Not a Cryptographic Hash
Cryptographic hashes deliberately make nearby inputs look unrelated.
SimHash does the opposite.
It wants nearby vectors to produce nearby fingerprints.
Similarity preservation, not collision resistance, is the design goal.
More Bits Buy More Resolution
A 16-bit fingerprint is tiny and coarse.
A 64-bit or 128-bit fingerprint preserves more angular information.
Each extra bit samples another random cut through the vector space.
Signature length becomes the representation budget.
Magnitude Can Disappear
Cosine similarity mainly cares about direction.
Two vectors pointing the same way but with very different lengths can be considered maximally similar under cosine similarity.
SimHash inherits that geometry.
If magnitude matters to the receiver, the fingerprint alone is incomplete.
Documents Can Become Weighted Feature Vectors
Words, shingles or other features receive weights.
The weighted document becomes a vector.
SimHash then compresses that vector to a fingerprint.
This makes it useful for detecting documents that are nearly the same in feature composition even when bytes differ.
Hamming Radius Becomes a Candidate Rule
After signatures are created, a system can search for fingerprints within a small Hamming distance.
Those items become candidate near-neighbours.
The threshold controls recall and workload.
False Matches and Missed Matches Are Inevitable
A short fingerprint can make unrelated vectors look close.
Similar vectors can also fall on different sides of enough random hyperplanes to look farther apart than they are.
The fingerprint is a stochastic approximation of geometry, not the geometry itself.
SimHash and MinHash Preserve Different Similarities
MinHash is naturally tied to set overlap and Jaccard similarity.
SimHash is naturally tied to angular or cosine similarity.
Choosing between them begins with the data representation and similarity measure, not with which name sounds more modern.
Near-Duplicate Search Uses SimHash as a Fast Gate
A large corpus can store compact fingerprints and quickly identify close candidates.
More expensive semantic, textual or exact comparison can then verify the shortlist.
Again the lossy representation works best as a routing layer rather than final truth.
A CivDJ View: Ask Which Geometry the Fingerprint Preserves
Forward: do close fingerprints retrieve useful neighbours?
Backward: what magnitude or coordinate detail vanished?
Rotate: would Jaccard, Euclidean or another similarity tell a different story?
The fingerprint is trustworthy only when its geometry matches the receiver’s notion of “similar”.
When SimHash Is Exactly the Right Loss
Use it when cosine-like similarity is meaningful, the corpus is large, compact binary signatures improve retrieval, and candidate matches can be checked downstream.
When SimHash Becomes Dangerous
- Magnitude matters but the geometry ignores it.
- Fingerprint length is too short.
- Hamming thresholds are tuned only on average cases.
- Similarity fingerprints are treated as cryptographic integrity checks.
- Feature weighting creates hidden bias.
- The original vector or source is discarded before verification.
Continue Through eduKateSG
Continue with How Lossy Works | MinHash, How Lossy Works | Hashing, and the companion article How Lossy Works | Locality-Sensitive Hashing.
Final Thought: A Fingerprint Can Preserve Neighbourhood Without Preserving the Object
SimHash makes high-dimensional comparison cheap by turning geometry into bits.
The intelligence lies in choosing the geometry worth keeping.