Papers › Efficient and robust approximate nearest neighbor search using Hierarchical Navigable...

Efficient and robust approximate nearest neighbor search using Hierarchical Navigable Small World graphs

30 Mar 2016arXiv:1603.09320archive 2025-07-28

Yu. A. Malkov, D. A. Yashunin

We present a new approach for the approximate K-nearest neighbor search based on navigable small world graphs with controllable hierarchy (Hierarchical NSW, HNSW). The proposed solution is fully graph-based, without any need for additional search structures, which are typically used at the coarse search stage of the most proximity graph techniques. Hierarchical NSW incrementally builds a multi-layer structure consisting from hierarchical set of proximity graphs (layers) for nested subsets of the stored elements. The maximum layer in which an element is present is selected randomly with an exponentially decaying probability distribution. This allows producing graphs similar to the previously studied Navigable Small World (NSW) structures while additionally having the links separated by their characteristic distance scales. Starting search from the upper layer together with utilizing the scale separation boosts the performance compared to NSW and allows a logarithmic complexity scaling. Additional employment of a heuristic for selecting proximity graph neighbors significantly increases performance at high recall and in case of highly clustered data. Performance evaluation has demonstrated that the proposed general metric space search index is able to strongly outperform previous opensource state-of-the-art vector-only approaches. Similarity of the algorithm to the skip list structure allows straightforward balanced distributed implementation.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

The archive's official repositories (nmslib/hnsw, searchivarius/nmslib, yurymalkov/hnsw) were not harvested; the 32 samples below come from 6 community repositories.

Syntology 32 code samples harvested from 6 repositories linked to this paper: 23 ran (of which 0 constructed an object rather than computing a result; 23 with no instrument failure: 0 honoured, 0 violated, 23 with no contract checked; 0 where Syntology's instrument failed) · 9 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code; here there are none.

By repository: community (archive-listed): 32 samples from 6 repositories, 23 ran (23 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

No sample is linked to this paper from 5 of its repositories that Syntology harvested for other papers:

Levels written between 2026-09-25 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

46 repositories listed; official and paper-mentioned ones first.

nmslib/hnsw officialmentioned in papermentioned on GitHubmxnetSyntology: not harvested report
searchivarius/nmslib officialmentioned in papermentioned on GitHubnot reachable when probed 2026-09-18 — repositories for recent papers often appear after camera-readySyntology: not harvested report
yurymalkov/hnsw officialmentioned in papermentioned on GitHubmxnetSyntology: not harvested report
Aktsvigun/hnsw_python mentioned on GitHubSyntology: not harvested report
Aljaksandr/libhn mentioned on GitHubmxnetSyntology: not harvested report
HaoZeSun2016/HNSW-HAMMING mentioned on GitHubmxnetSyntology: not harvested report
JuliaNeighbors/HNSW.jl mentioned on GitHubMITSyntology: not harvested report
LTLA/knncolle mentioned on GitHubMITSyntology: not harvested report
RadimBaca/HNSW mentioned on GitHubSyntology: not harvested report
RyanLiGod/HNSW-with-MA mentioned on GitHubSyntology: not harvested report
RyanLiGod/MA-NSW mentioned on GitHubSyntology: not harvested report
RyanLiGod/go-hnsw mentioned on GitHubSyntology: not harvested report
RyanLiGod/multiple_target_hnswlib mentioned on GitHubmxnetSyntology: not harvested report
ShobiStassen/PARC mentioned on GitHubMITSyntology: not harvested report
UnofficialJuliaMirror/HNSW.jl-540f64fa-c57e-11e8-081c-41422cda4629 mentioned on GitHubMITSyntology: not harvested report
ZJULearning/nsg mentioned on GitHubSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Fast Approximate Nearest Neighbor Search With The Navigating Spreading-out Graph (arXiv:1707.00143; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 1 with no instrument failure: 1 honoured, 0 violated, 0 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
datastax/jvector mentioned on GitHubApache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Accelerating Large-Scale Inference with Anisotropic Vector Quantization (arXiv:1908.10396; that paper's own run record: 7 ran (of which 0 constructed an object rather than computing a result; 7 with no instrument failure: 0 honoured, 0 violated, 7 with no contract checked; 0 where Syntology's instrument failed) · 1 unverified); nothing checks that they implement this paper's method. report
davisidarta/fastlapmap mentioned on GitHubSyntology: not harvested report
evan176/hnswgo mentioned on GitHubSyntology: not harvested report
granne/granne mentioned on GitHubMITSyntology: not harvested report
herrerik/granne mentioned on GitHubMITSyntology: not harvested report
javaCJ/HNSW_explain mentioned on GitHubApache-2.0Syntology: 5 samples, 1 ran (0 instrument-failed) · 4 unverified report
jbellis/jvector mentioned on GitHubApache-2.0Syntology: not harvested report
jean-pierreBoth/hnswlib-rs mentioned on GitHubNOASSERTIONSyntology: not harvested report
jelmerk/hnswlib mentioned on GitHubApache-2.0Syntology: not harvested report
js1010/cuhnsw mentioned on GitHubApache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Efficient Large-scale Approximate Nearest Neighbor Search on the GPU (arXiv:1702.05911; that paper's own run record: 4 ran (of which 0 constructed an object rather than computing a result; 4 with no instrument failure: 0 honoured, 0 violated, 4 with no contract checked; 0 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
kakao/n2 mentioned on GitHubApache-2.0Syntology: 9 samples, 6 ran (0 instrument-failed) · 3 unverified report
lebrosoft/hnswlib_0.3_leon mentioned on GitHubmxnetSyntology: not harvested report
lebrosoft/hnswlib_new mentioned on GitHubmxnetSyntology: not harvested report
merria28/hnswlib mentioned on GitHubmxnetSyntology: not harvested report
mimbres/neural-audio-fp mentioned on GitHubtfSyntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Billion-scale similarity search with GPUs (arXiv:1702.08734; that paper's own run record: 16 ran (of which 1 constructed an object rather than computing a result; 11 with no instrument failure: 1 honoured, 0 violated, 10 with no contract checked; 5 where Syntology's instrument failed) · 19 unverified) and Neural Audio Fingerprint for High-specific Audio Retrieval based on Contrastive Learning (arXiv:2010.11910; that paper's own run record: 1 ran (of which 0 constructed an object rather than computing a result; 0 with no instrument failure: 0 honoured, 0 violated, 0 with no contract checked; 1 where Syntology's instrument failed) · 0 unverified); nothing checks that they implement this paper's method. report
nlescoua/faiss-quickeradc mentioned on GitHubNOASSERTIONSyntology: not harvested report
nmslib/hnswlib mentioned on GitHubmxnetApache-2.0Syntology: not harvested report
nmslib/nmslib mentioned on GitHubApache-2.0Syntology: 11 samples, 11 ran (0 instrument-failed) · 0 unverified report
oddconcepts/n2o mentioned on GitHubApache-2.0Syntology: 3 samples, 1 ran (0 instrument-failed) · 2 unverified report
sararselitsky/FastPG mentioned on GitHubNOASSERTIONSyntology: not harvested report
searchivarius/NonMetricSpaceLib mentioned on GitHubApache-2.0Syntology: 1 sample, 1 ran (0 instrument-failed) · 0 unverified report
strawberrypie/hnsw_index mentioned on GitHubMITSyntology: not harvested report
technicolor-research/faiss-quickeradc mentioned on GitHubNOASSERTIONSyntology: not harvested report
unum-cloud/usearch mentioned on GitHubApache-2.0Syntology: 3 samples, 3 ran (0 instrument-failed) · 0 unverified report
vdv1g16/hnswfolder mentioned on GitHubmxnetApache-2.0Syntology: not harvested report
vioshyvo/a-multilabel-classification-framework mentioned on GitHubSyntology: not harvested report
xinyandai/pnsw mentioned on GitHubmxnetSyntology: not harvested report
xxworkspace/hnswlib mentioned on GitHubmxnetSyntology: not harvested report
milvus-io/milvus Apache-2.0Syntology: no sample linked to this paper (harvested for another paper). Syntology's graph links these samples to Manu: A Cloud Native Vector Database Management System (arXiv:2206.13843; that paper's own run record: 5 ran (of which 0 constructed an object rather than computing a result; 5 with no instrument failure: 0 honoured, 0 violated, 5 with no contract checked; 0 where Syntology's instrument failed) · 1 unverified); nothing checks that they implement this paper's method. report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.

Code Syntology ran Syntology

32 samples harvested: 23 ran (of which 0 constructed an object rather than computing a result; 23 with no instrument failure: 0 honoured, 0 violated, 23 with no contract checked; 0 where Syntology's instrument failed) · 9 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

23ran
9unverified

Licence: 0 of the 32 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 6 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 1 sample that ran, the graph records a signature this page does not show: an argument's recorded type or element kind is a printout of an object in Syntology's harness (such as a mock object, a class or a pandas printout), not the type of an input, so it does not describe the call's shape. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

javaCJ/HNSW_explain community (archive-listed) 5 samples, 1 ran (0 instrument-failed) · 4 unverified
get_fn benchmarks/benchmark_script.py ran Apache-2.0 (permissive) · c329b3648ba301d2 · report fixture: signature base:str/0/str, args:Args/0/? · returned str · level recorded 2026-09-26
get_dataset in 285 papers benchmarks/benchmark_script.py unverified Apache-2.0 (permissive) · 00fd55582acb50eb · report
get_dataset in 285 papers benchmarks/youtube_reproduce.py unverified Apache-2.0 (permissive) · e835d9076670deaf · report
get_queries benchmarks/benchmark_script.py unverified Apache-2.0 (permissive) · 52763ab12190a56b · report
get_queries benchmarks/youtube_reproduce.py unverified Apache-2.0 (permissive) · 0a70bd6ca6481e54 · report
kakao/n2 community (archive-listed) 9 samples, 6 ran (0 instrument-failed) · 3 unverified
get_dataset_fn benchmarks/download_dataset.py ran Apache-2.0 (permissive) · 706485776c880850 · report fixture: returned str · level recorded 2026-09-26
knn_recall benchmarks/metrics.py ran Apache-2.0 (permissive) · db909965da54b5b6 · report fixture: signature dataset_distances:list/1/float, run_distances:list/1/float, count:int/0/int, epsilon:float/0/float · returned float · level recorded 2026-09-26
knn_threshold benchmarks/metrics.py ran Apache-2.0 (permissive) · 42b99a41e74dbeeb · report fixture: signature data:ndarray/1/float, count:int/0/int, epsilon:float/0/float · returned float64 · level recorded 2026-09-26
load_test_data in 21 papers benchmarks/benchmark_script.py ran Apache-2.0 (permissive) · 4e54de2be24f817c · report fixture: signature db:dict/0/?, which:str/0/str · returned tuple · level recorded 2026-09-26
load_train_data in 8 papers benchmarks/benchmark_script.py ran Apache-2.0 (permissive) · 08e39aef547dffd7 · report fixture: signature db:dict/0/? · returned ndarray · level recorded 2026-09-26
pdist in 21 papers
census: 5 implementations from 5 papers, 5 distinct outputs across 3 buckets, one shared input per bucket
benchmarks/metrics.py ran Apache-2.0 (permissive) · 54a1c6f06f1a932f · report fixture: signature a:ndarray/1/float, b:ndarray/1/float, metric:str/0/str · returned float64 · level recorded 2026-09-26
compare in 20 papers benchmarks/compare.py unverified Apache-2.0 (permissive) · 7f2e786868a36028 · report
parse in 85 papers benchmarks/compare.py unverified Apache-2.0 (permissive) · 8ab19cdee9a46e74 · report
parse in 85 papers benchmarks/visualize.py unverified Apache-2.0 (permissive) · 9765c8d022e20684 · report
nmslib/nmslib community (archive-listed) 11 samples, 11 ran (0 instrument-failed) · 0 unverified
clear in 5 papers previous_releases_scripts/genplot.py ran fingerprinted Apache-2.0 (permissive) · f38de72dd78893f4 · report fixture: signature str:str/0/str · returned str · level recorded 2026-09-25
dict_param_to_nsmlib_bin_str benchmark/misc_utils.py ran Apache-2.0 (permissive) · 18e581112ad83723 · report fixture: signature params:dict/0/? · returned str · level recorded 2026-09-25
genPGFPlot previous_releases_scripts/genplot.py ran Apache-2.0 (permissive) · 1c950e4966ec9598 · report fixture: signature experiments:dict/0/?, methStyles:dict/0/?, outputFile:str/0/str, xAxisField:str/0/str, yAxisField:str/0/str, axisType:int/0/int, noLegend:bool/0/bool, printXaxis:str/0/str, printYaxis:str/0/str, title:str/0/str · returned str · level recorded 2026-09-25
getAxisLatex previous_releases_scripts/genplot.py ran Apache-2.0 (permissive) · ff42ba0e2e3b9192 · report fixture: signature axisType:int/0/int · returned list · level recorded 2026-09-25
load_dense benchmark/data_utils.py ran Apache-2.0 (permissive) · d4eb67b43f42acff · report fixture: signature file_name_pref:str/0/str · returned ndarray · level recorded 2026-09-25
load_entries benchmark/make_plots.py ran fingerprinted Apache-2.0 (permissive) · 859111b60568c802 · report fixture: signature data:list/1/dict · returned list · level recorded 2026-09-25
plot_entry benchmark/make_plots.py ran Apache-2.0 (permissive) · 906dd13e8bf7767c · report fixture: signature entry:dict/0/?, out_root:PosixPath/0/? · returned PosixPath · level recorded 2026-09-25
read_dense_from_text benchmark/data_utils.py ran Apache-2.0 (permissive) · 22b1e9b52b1b0f3a · report fixture: signature file_name:str/0/str, max_qty:int/0/int · returned ndarray · level recorded 2026-09-25
sanitize in 12 papers benchmark/make_plots.py ran fingerprinted Apache-2.0 (permissive) · 4ca9f55920b86b16 · report fixture: signature s:str/0/str · returned str · level recorded 2026-09-25
split_data in 68 papers benchmark/data_utils.py ran Apache-2.0 (permissive) · 2687bda4a867ff8a · report fixture: signature all_data_matrix:ndarray/2/float, test_size:float/0/float, seed:int/0/int · returned tuple · level recorded 2026-09-25
to_int in 7 papers benchmark/misc_utils.py ran fingerprinted Apache-2.0 (permissive) · 6d8f5a668d2ace9f · report fixture: signature n:str/0/str · returned int · level recorded 2026-09-25
oddconcepts/n2o community (archive-listed) 3 samples, 1 ran (0 instrument-failed) · 2 unverified
get_fn benchmarks/benchmark_script.py ran Apache-2.0 (permissive) · 64e8a6840e30069d · report fixture: signature base:str/0/str, args:Args/0/? · returned str · level recorded 2026-09-26
get_dataset in 285 papers benchmarks/benchmark_script.py unverified Apache-2.0 (permissive) · 642902330718ba50 · report
get_queries benchmarks/benchmark_script.py unverified Apache-2.0 (permissive) · 21dfacf227bb72f7 · report
searchivarius/NonMetricSpaceLib community (archive-listed) 1 sample, 1 ran (0 instrument-failed) · 0 unverified
genPGFPlot previous_releases_scripts/nips2013/figures/genplots_nips2013.py ran Apache-2.0 (permissive) · f2e1e86c45959434 · report fixture: signature experiments:dict/0/?, searchParam:str/0/str, xAxisField:str/0/str, yAxisField:str/0/str, axisType:int/0/int, legendPos:str/0/str, printYaxis:str/0/str, title:str/0/str · returned str · level recorded 2026-09-26
unum-cloud/usearch community (archive-listed) 3 samples, 3 ran (0 instrument-failed) · 0 unverified
guess_numpy_dtype_from_filename python/usearch/io.py ran Apache-2.0 (permissive) · f51acd5adbd5e1f7 · report fixture: signature filename:str/0/str · returned type · level recorded 2026-09-26
load_matrix in 8 papers python/usearch/io.py ran Apache-2.0 (permissive) · 6232ffacb8dd099a · report fixture: signature filename:str/0/str, start_row:int/0/int, count_rows:NoneType/0/?, view:bool/0/bool, dtype:NoneType/0/? · returned ndarray · level recorded 2026-09-26
numpy_scalar_size python/usearch/io.py ran Apache-2.0 (permissive) · 5c21b4b0da32e8da · report fixture: returned int · level recorded 2026-09-26

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections