Papers
Topics
Authors
Recent
Search
2000 character limit reached

FANNS: Filtered Approximate Nearest Neighbor Search

Updated 8 July 2026
  • FANNS is a retrieval paradigm that extends traditional ANN search by incorporating structured metadata filters over hybrid vector-scalar data.
  • It encompasses diverse approaches such as pre-filtering, post-filtering, and hybrid indexing, each tailored to different filter selectivities and query complexities.
  • Research in FANNS spans algorithmic taxonomies, modern benchmarking, and FPGA-accelerated systems to optimize recall, query speed, and system integration.

Searching arXiv for FANNS and related papers to ground the article in current literature. arXiv_search(query="FANNS filtered approximate nearest neighbor search FPGA vector search", max_results=10) FANNS most commonly denotes Filtered Approximate Nearest Neighbor Search, an extension of ANN retrieval in which the top-kk vectors must be close to a query and satisfy structured attribute predicates over hybrid vector-scalar data (Lin et al., 10 May 2025, Iff et al., 29 Jul 2025, Shi et al., 9 Sep 2025, Amanbayev et al., 11 Feb 2026). A distinct 2023 systems paper uses FANNS as the proper name of an FPGA-accelerated Approximate Nearest Neighbor Search framework for vector search on FPGAs (Jiang et al., 2023). The literature therefore uses the term both for a retrieval problem class and for a hardware system, with the former organizing most recent benchmark, taxonomy, and vector-database work.

1. Problem definition and formalization

In the problem-level usage, FANNS augments ordinary ANN search with metadata constraints. One formalization defines a database of items

Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),

where viv_i is a dd-dimensional embedding and ai,1,,ai,ma_{i,1},\dots,a_{i,m} are attributes, and a query

Qj=(qj,kj,fj),Q_j = (q_j, k_j, f_j),

where qjq_j is the query embedding, kjk_j is the requested result count, and fjf_j is a filter function over attributes (Iff et al., 29 Jul 2025). A closely related survey formalizes a hybrid dataset as

D={(s1,v1),,(sn,vn)},\mathcal{D} = \{(\mathbf{s}_{1}, \mathbf{v}_{1}), \dots, (\mathbf{s}_{n}, \mathbf{v}_{n})\},

with scalar tuple Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),0, vector Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),1, scalar filter Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),2, and hybrid query

Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),3

where Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),4 is the vector similarity function (Lin et al., 10 May 2025).

The exact problem is to retrieve the nearest neighbors among only the points that satisfy the filter. The survey on vector-scalar hybrid data defines exact filtered nearest neighbor search over the filtered subset

Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),5

and then treats FANNS as its approximate relaxation, typically evaluated by recall (Lin et al., 10 May 2025). Another benchmark paper defines the FANNS goal as finding top-Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),6 points closest to a query that satisfy label constraints while ensuring both recall and QPS (Shi et al., 9 Sep 2025). Some work also distinguishes approximately filtered ANN search (AFANNS), where returned items may occasionally fail the filter (Iff et al., 29 Jul 2025).

The filter language varies across papers. One taxonomy uses EM (exact match), R (range), EMIS (exact match in set), MEM, MR, MEMIS, and C (combined filters) (Iff et al., 29 Jul 2025). Another benchmark emphasizes containment, overlap, equality, and fixed-length equality predicates over label sets (Shi et al., 9 Sep 2025). This suggests that FANNS is best understood as a family of constrained vector-retrieval problems rather than a single fixed query model.

2. Selectivity, query difficulty, and algorithmic taxonomies

A central quantity in FANNS is selectivity, but the literature uses two conventions. One paper defines selectivity as the fraction of the dataset satisfying the filter,

Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),7

and interprets low selectivity as few items matching and high selectivity as many items matching (Iff et al., 29 Jul 2025). The survey of vector-scalar hybrid data instead defines

Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),8

and explicitly notes that some papers use the opposite convention, which it says is better called specificity (Lin et al., 10 May 2025). This terminological mismatch is one source of difficulty when comparing methods.

Recent work proposes several overlapping taxonomies. A method-oriented survey classifies approaches by pre-filtering, post-filtering, in-filtering, and hybrid indexing (Iff et al., 29 Jul 2025). A unified benchmark restates the design space as filter-then-search, search-then-filter, and hybrid-search (Shi et al., 9 Sep 2025). A separate survey argues that these categories are too coarse and introduces a pruning-focused framework: VSP (Vector-Solely Pruning), VJP (Vector-Centric Joint Pruning), SSP (Scalar-Solely Pruning), and SJP (Scalar-Centric Joint Pruning) (Lin et al., 10 May 2025).

Across these taxonomies, a shared claim is that filtering changes the optimization regime. One benchmark states that pre-filtering is best when selectivity is low, post-filtering and in-filtering are best when selectivity is high, and hybrid indexing is best when selectivity is moderate (Iff et al., 29 Jul 2025). The pruning-focused survey adds that query difficulty is not determined by selectivity alone: the distribution relationship between query vectors and the filtered subset also matters, and it frames this as ID, POD, and OOD query regimes (Lin et al., 10 May 2025). A plausible implication is that “hard” filtered queries can arise either because valid candidates are rare or because they are geometrically misaligned with the natural local neighborhood.

3. Benchmarks, datasets, and evaluation methodology

The benchmark literature repeatedly argues that older FANNS evaluations were fragmented, used synthetic attributes, or lacked modern embedding workloads (Iff et al., 29 Jul 2025, Shi et al., 9 Sep 2025). One 2025 benchmark introduces arxiv-for-fanns, derived from over 2.7 million arXiv abstracts, with a 4096-dimensional normalized embedding generated by stella_en_400M_v5 and 11 real-world attributes including submitter, main_categories, sub_categories, license, update_date, and authors (Iff et al., 29 Jul 2025). It provides three dataset scales—small: 1k items, medium: 100k items, and large: over 2.7 million items—together with three sets of 10,000 queries for EM, R, and EMIS filters (Iff et al., 29 Jul 2025).

A complementary systems paper introduces MoReVec, a relational benchmark with Movies and Reviews tables, 768-dimensional Ii=(vi,ai,1,,ai,m),I_i = (v_i, a_{i,1}, \dots, a_{i,m}),9-normalized text embeddings generated using gte-base-en-v1.5, and metadata such as year, genre, avgrating, numvotes, movierating, totalvotes, and quality (Amanbayev et al., 11 Feb 2026). It is instantiated at three scales: Small with Movies viv_i0 and Reviews viv_i1, Medium with Movies viv_i2 and Reviews viv_i3, and Large with Movies viv_i4 and Reviews viv_i5 (Amanbayev et al., 11 Feb 2026). That paper evaluates 28,000 filtered kNN queries per dataset, including unfiltered runs, under scalar-inequality predicates on avgrating and totalvotes (Amanbayev et al., 11 Feb 2026).

A broader experimental benchmark uses 6 real-world datasetsarXiv, TripClick, LAION1M, YFCC, YouTube Audio, and YouTube Video—and varies Containment, Overlap, Equality, and Fixed-Length Equality workloads, as well as query label length, selectivity, top-viv_i6, and dataset size (Shi et al., 9 Sep 2025). The survey of vector-scalar hybrid data reviews additional representative datasets such as SIFT-1M, GIST-1M, Deep-10M, MNIST-8M, MTG, GloVe-Twitter, GloVe-Crawl, LAION-1M, and YouTube, emphasizing variation in dimensionality, scale, and whether scalar attributes are synthetic or organic (Lin et al., 10 May 2025).

Evaluation is usually organized around recall@k and QPS (Iff et al., 29 Jul 2025, Shi et al., 9 Sep 2025). One systems paper extends ANN-Benchmarks to support filtered vector search (Amanbayev et al., 11 Feb 2026). Another introduces Global-Local Selectivity (GLS) to measure correlation between filters and local neighborhoods: viv_i7

viv_i8

It reports that mean GLS is near viv_i9 on MoReVec across attributes and selectivities, implying that metadata is mostly independent of the embedding space in that benchmark (Amanbayev et al., 11 Feb 2026).

4. Representative methods and empirical behavior

The method landscape is heterogeneous. A recent taxonomy and benchmark evaluates ACORN, CAPS, FDANN (Filtered-DiskANN), NHQ in kgraph and nsw variants, UNG, and SeRF, while also surveying Rii, MA-NSW, PASE, AnalyticDB-V, Milvus, HQANN, AIRSHIP, HQI, VBASE, ARKGraph, dd0-WST, iRangeGraph, and UNIFY (Iff et al., 29 Jul 2025). A separate unified benchmark studies Pre-filter Brute Force, ACORN-dd1, ACORN-1, UNG, Post-filter HNSW, Post-filter IVFPQ, Filtered-DiskANN, Stitched-DiskANN, NHQ, and CAPS (Shi et al., 9 Sep 2025).

No recent benchmark reports a universally dominant method. The arXiv-based benchmark explicitly concludes that no single FANNS method is universally best (Iff et al., 29 Jul 2025). On its medium-scale dataset, ACORN is the only method applicable to all three benchmarked filter types, but it is generally outperformed by specialized methods; for EM filters the best methods are NHQ (kgraph), FDANN, and UNG; for EMIS, FDANN performs especially well on transformer embeddings (Iff et al., 29 Jul 2025). On the large-scale dataset, ACORN, both NHQ variants, and SeRF scale relatively well, whereas FDANN, CAPS, and UNG do not reach more than about 25% recall in the benchmarked settings (Iff et al., 29 Jul 2025).

Method behavior also depends strongly on predicate type. The unified benchmark reports that UNG is the default strong choice for containment and equality, while ACORN-1 or Stitched-DiskANN are preferable for overlap (Shi et al., 9 Sep 2025). It further finds that post-filter IVFPQ degrades sharply as dd2 increases, that fixed-length equality is relatively easy, and that very low selectivity is where algorithmic differences are most visible (Shi et al., 9 Sep 2025). The survey of vector-scalar hybrid data similarly stresses that methods with strong scalar pruning are preferable under highly selective filters, whereas post-filtering can be adequate when filters are unselective (Lin et al., 10 May 2025).

Some methods are sharply specialized. SeRF is described as excellent for range filtering on ordered attributes but unable to handle categorical attributes in the same way as general-purpose methods (Iff et al., 29 Jul 2025). CAPS offers the fastest index construction in one benchmark, but underperforms on transformer embeddings and drops at large scale (Iff et al., 29 Jul 2025). NHQ scales well in some settings but is technically closer to AFANNS because it may return non-matching items (Iff et al., 29 Jul 2025). This suggests that empirical comparisons must be conditioned on filter type, selectivity, vector geometry, and the exact correctness criterion.

5. Vector-database systems and execution strategies

A distinct research thread treats FANNS as a system problem inside vector databases rather than only an indexing problem (Amanbayev et al., 11 Feb 2026). That paper compares FAISS, Milvus, and pgvector, and systematizes pre-filtering, runtime-filtering, and post-filtering as generic execution strategies (Amanbayev et al., 11 Feb 2026). It explicitly excludes fusion methods such as ACORN and HQANN from that taxonomy because they are not schema-agnostic (Amanbayev et al., 11 Feb 2026).

In this systems view, raw ANN index quality does not determine end-to-end behavior. Milvus is reported to achieve superior recall stability through hybrid approximate/exact execution and a Dual-Pool traversal strategy in which valid results and invalid navigation nodes are separated into different queues (Amanbayev et al., 11 Feb 2026). The same paper reports an adaptive fallback threshold around 93% filtered out, at which point Milvus switches to brute-force search, preserving near-perfect or perfect recall at the cost of a latency floor (Amanbayev et al., 11 Feb 2026). FAISS is treated as a library baseline with an external boolean mask converted into a FAISS IDSelector, with overhead reported as < 1 ms on the large datasets (Amanbayev et al., 11 Feb 2026).

The results are explicitly counter to standard ANN folklore in one important respect: partition-based indexes (IVFFlat) outperform graph-based indexes (HNSW) for low-selectivity queries (Amanbayev et al., 11 Feb 2026). The explanation given is that HNSW traversal cost dominates and the candidate queue can be starved when few valid points exist, whereas IVFFlat can exploit cluster pruning to skip large portions of the dataset (Amanbayev et al., 11 Feb 2026). The same paper also argues that pgvector’s cost-based optimizer frequently selects suboptimal plans, often favoring approximate vector-index scans even when exact filtered scans would yield perfect recall at comparable latency (Amanbayev et al., 11 Feb 2026). A plausible implication is that production FANNS performance depends at least as much on optimizer behavior and execution fallback as on the underlying ANN primitive.

6. FANNS as an FPGA vector-search framework

In a separate hardware paper, FANNS is the proper name of an end-to-end and scalable vector search framework on FPGAs (Jiang et al., 2023). Here the acronym does not denote filtered search; it denotes an FPGA accelerator that automatically co-designs hardware and algorithm for large-scale ANN retrieval under a user-provided recall target and FPGA resource budget (Jiang et al., 2023). The framework is built around IVF-PQ, optionally with OPQ, and models six query-time stages: OPQ, IVFDist, SelCell, BuildLUT, PQDist, and SelK (Jiang et al., 2023).

The co-design problem couples algorithmic parameters—dd3, dd4, dd5, and dd6—with hardware allocation choices such as stage microarchitecture, numbers of processing elements, and memory placement (Jiang et al., 2023). FANNS enumerates valid hardware configurations under resource constraints

dd7

uses a top-down throughput model

dd8

and estimates single-PE throughput by

dd9

to evaluate millions of combinations in about an hour (Jiang et al., 2023).

The resulting architecture is a deeply pipelined streaming design with reusable hardware blocks for all six stages, FPGA-friendly 1-D array topology within stages, alternative selection microarchitectures (HPQ and HSMPQG), and support for scale-out through a hardware TCP/IP stack (Jiang et al., 2023). On SIFT100M and Deep100M, the paper reports up to ai,1,,ai,ma_{i,1},\dots,a_{i,m}0 speedup over the fixed FPGA baseline and up to ai,1,,ai,ma_{i,1},\dots,a_{i,m}1 speedup over CPU; in an eight-accelerator configuration, it reports ai,1,,ai,ma_{i,1},\dots,a_{i,m}2 better median latency and ai,1,,ai,ma_{i,1},\dots,a_{i,m}3 better P95 latency than GPUs (Jiang et al., 2023). This hardware usage is conceptually adjacent to the broader FANNS retrieval problem, but it is a different referent: a co-designed ANN accelerator rather than a metadata-filtered query formalism.

7. Scope, ambiguity, and current significance

Recent arXiv usage therefore splits the term across at least two levels. At the problem level, FANNS is a constrained retrieval primitive central to RAG, recommendation, search, and vector databases, where semantic similarity must be combined with structured predicates (Iff et al., 29 Jul 2025, Amanbayev et al., 11 Feb 2026). At the system level, FANNS can denote a specialized FPGA framework for ANN acceleration (Jiang et al., 2023). The literature also contains nearby but unrelated acronyms such as FANS and FD-FANS for fluid-antenna near-field systems, which are not part of filtered vector retrieval (Zhou et al., 1 Jul 2026).

Across surveys, benchmarks, and systems studies, three high-level conclusions recur. First, definitions and taxonomies matter, because papers differ on filter semantics, selectivity conventions, and whether approximate filtering is allowed (Lin et al., 10 May 2025, Iff et al., 29 Jul 2025). Second, no universally best method exists; performance depends on filter type, selectivity, top-ai,1,,ai,ma_{i,1},\dots,a_{i,m}4, dataset size, and embedding regime, especially with modern transformer embeddings (Iff et al., 29 Jul 2025, Shi et al., 9 Sep 2025). Third, system integration is decisive: query optimizers, fallback policies, and execution strategies can override raw index behavior (Amanbayev et al., 11 Feb 2026). This suggests that FANNS is best treated as a cross-layer research area spanning formal query models, index structures, workload-aware benchmarking, and deployment-specific systems design.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to FANNS.