ACORN-1

Definition

ACORN-1 is an HNSW-based approximate nearest neighbor algorithm designed to handle aggressive metadata filtering better than standard HNSW. It expands graph traversal to include neighbors of neighbors (multi-hop neighborhoods), reducing the chance of getting stuck in the filtered subspace.

Problem It Solves

Standard HNSW with pre-filtering (checking filter first, navigating only through passing nodes) can get stuck when filtering is highly selective — if few nodes pass the filter, the filtered subspace becomes poorly connected and greedy search reaches a dead end far from the true nearest neighbors.

ACORN-1 addresses this by expanding each traversal step to consider not just direct neighbors but also their neighbors, increasing the chance of finding filter-passing nodes and maintaining connectivity.

Trade-offs

MetricStandard HNSWACORN-1
Nodes visited (~600-dataset example)~600~14,000
Distance distributionEfficiently near-querySimilar curve, but more nodes evaluated
Filtering recallDegrades with aggressive filteringMaintained under aggressive filtering
CostLowHigher — proportional to filter selectivity

ACORN-1 evaluates ~23× more nodes than standard HNSW in the referenced benchmark. The higher cost is justified when filter selectivity makes standard HNSW miss nearby results.

Comparison with Standard HNSW Filtering Strategies

From the Vespa HNSW exploration study:

StrategyBehavior
Post-filterANN search ignores filter; applied after → can return 0 hits
Pre-filter (standard)Only filter-passing nodes counted; gets stuck when selective
Pre-filter + check firstSkip distance computations for non-passing nodes; ACORN-1 adds multi-hop
Exact search fallbackUsed when filtering fraction is below a threshold

Articles