Skip to content
nonconvexcard

Implement SimHash LSH and measure recall

CodingAdvanced⏱ 3 hoursRAGlshimplementationrecalltradeoff

Problem

Implement SimHash with AND/OR amplification and measure the recall–speed trade-off.

  1. Verify empirically that the bit-disagreement rate estimates θ/π\theta/\pi.
  2. Sweep (k,L)(k,L) and plot recall against candidates examined.
  3. Compare with brute force and with a simple IVF baseline.
  4. Demonstrate the effect of anisotropic data on the achieved recall.

Implement it, then check the implementation against something you can verify independently.

Write it

Solve it here5 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 45s · draft saved in this browser
5 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.

Solution

Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.

Related problems

All problems
SolvedProblemFieldTypeDifficultyTime
End-to-end recall arithmetic for a RAG systemRAGNumericalBeginner15 min
Product quantisation budget arithmeticRAGNumericalBeginner30 min
Recall composes multiplicativelyRAGNumericalBeginner15 min
Implement backpropagation from scratch runDeep LearningCodingIntermediate3 hours
Implement kernel ridge regression runClassical MLCodingIntermediate1 hour