SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.01844 · 2018

Improving Similarity Search with High-dimensional Locality-sensitive Hashing

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1812.01844.json · badge: /api/ran/1812.01844.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
dataplayer12/Fly-LSH canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
tian-kun/Fly-LSH reimplementation (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
convlsh Ran
ran; our contract draft was wrong, not the code
tian-kun/Fly-LSH/unsupervised.py
code served (permissive licence) · get_code("7f6495ba47ed81cc")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small test data
# data should be a 2D numpy array where:
# - axis=0 represents samples
# - axis=1 represents features
# The function computes mean along axis=1 and subtracts it
data = np.random.randn(2, 4).astype(np.float32)  # 2 samples, 4 features

# hash_len is the number of hash functions (columns in random weights matrix)
hash_len = 3

ARGS = {
    "data": data,
    "hash_len": hash_len,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
flylsh Ran
ran; our contract draft was wrong, not the code
tian-kun/Fly-LSH/unsupervised.py
code served (permissive licence) · get_code("9df21b8c0d5feea3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (5, 6) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small test data
# data should be a 2D array where rows are samples and columns are features
data = np.random.randn(5, 8).astype(np.float32)

# hash_len: number of hash bits to use (should be less than embed_size)
hash_len = 3

# sampling_r: sampling ratio for projections (between 0 and 1)
sampling_r = 0.5

# embed_size: dimensionality of the embedding
embed_size = 6

ARGS = {
    "data": data,
    "hash_len": hash_len,
    "sampling_r": sampling_r,
    "embed_size": embed_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (5, 6) — shape (5, 6) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_computed Ran
ran; our contract draft was wrong, not the code
dataplayer12/Fly-LSH/lshutils.py
code served (permissive licence) · get_code("0d15c626eb46fb2b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory with test files
tmpdir = tempfile.mkdtemp()

# Create test files matching the expected naming pattern
# Files should be named like: LSH4_*, Fly8_*, WTA16_*, etc.
test_files = [
    ('LSH4_test1.txt', '0.85'),
    ('LSH4_test2.txt', '0.87'),
    ('Fly4_test1.txt', '0.82'),
    ('WTA4_test1.txt', '0.80'),
    ('LSH8_test1.txt', '0.90'),
    ('Fly8_test1.txt', '0.88'),
    ('WTA8_test1.txt', '0.86'),
    ('LSH16_test1.txt', '0.92'),
    ('Fly16_test1.txt', '0.91'),
    ('WTA16_test1.txt', '0.89'),
    ('LSH24_test1.txt', '0.93'),
    ('Fly24_test1.txt', '0.92'),
    ('WTA24_test1.txt', '0.90'),
    ('LSH32_test1.txt', '0.94'),
    ('Fly32_test1.txt', '0.93'),
    ('WTA32_test1.txt', '0.91'),
    ('LSH48_test1.txt', '0.95'),
    ('Fly48_test1.txt', '0.94'),
    ('WTA48_test1.txt', '0.92'),
    ('LSH64_test1.txt', '0.96'),
    ('Fly64_test1.txt', '0.95'),
    ('WTA64_test1.txt', '0.93'),
    ('LSH96_test1.txt', '0.97'),
    ('Fly96_test1.txt', '0.96'),
    ('WTA96_test1.txt', '0.94'),
    ('LSH128_test1.txt', '0.98'),
    ('Fly128_test1.txt', '0.97'),
    ('WTA128_test1.txt', '0.95'),
    ('LSH192_test1.txt', '0.99'),
    ('Fly192_test1.txt', '0.98'),
    ('WTA192_test1.txt', '0.96'),
    ('LSH256_test1.txt', '0.995'),
    ('Fly256_test1.txt', '0.985'),
    ('WTA256_test1.txt', '0.975'),
]

for filename, content in test_files:
    filepath = os.path.join(tmpdir, filename)
    with open(filepath, 'w') as f:
        f.write(content)

ARGS = {
    'foldername': tmpdir + '/'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
query Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tian-kun/Fly-LSH/unsupervised.py
code served (permissive licence) · get_code("c342316823ebedf1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family int, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small LSH hash matrix
# Shape: (n_samples, m_dimensions)
# Using binary values (0 or 1) since the function uses XOR operation
np.random.seed(0)
n_samples = 5
m_dimensions = 4
fly_lsh = np.random.randint(0, 2, size=(n_samples, m_dimensions))

# Query index - must be valid (0 to n_samples-1)
qidx = 0

# Number of nearest neighbors to return
n_nn = 2

ARGS = {
    "qidx": qidx,
    "n_nn": n_nn,
    "fly_lsh": fly_lsh
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We propose a new class of data-independent locality-sensitive hashing (LSH) algorithms based on the fruit fly olfactory circuit. The fundamental difference of this approach is that, instead of assigning hashes as dense points in a low dimensional space, hashes are assigned in a high dimensional space, which enhances their separability. We show theoretically and empirically that this new family of hash functions is locality-sensitive and preserves rank similarity for inputs in any `p space. We then analyze different variations on this strategy and show empirically that they outperform existing LSH methods for nearest-neighbors search on six benchmark datasets. Finally, we propose a multi-probe version of our algorithm that achieves higher performance for the same query time, or conversely, that maintains performance of prior approaches while taking significantly less indexing time and memory. Overall, our approach leverages the advantages of separability provided by high-dimensional spaces, while still remaining computationally efficient

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1812.01844")
get_code_for_paper("1812.01844")
have("1812.01844")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1812.01844.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1812.01844.svg)](https://syntology.ai/paper/1812.01844)

Connect an agent — have() is free.