Generalized Range Filtering Approximate Nearest Neighbor Search: Containment and Overlap [Technical Report]

Yingfan Liu, Tong Wu, Jiadong Xie, Yang Zhao, Jeffrey Xu Yu, Jiangtao CuiarXiv 2026

TL;DR

This paper introduces Range-Range Filtering Approximate Nearest Neighbor (RRANN) search, a generalized framework for vector search where both queries and data objects possess numeric ranges (e.g., time intervals or price brackets). The authors propose the Multi-Segment Tree Graph (MSTG), a novel index that uses a labeled, compressed graph structure to efficiently handle arbitrary range containment and overlap predicates, achieving up to a 12.5x speedup over state-of-the-art baselines.

What Problem Does This Paper Address?

Modern vector databases frequently combine vector similarity search with attribute filtering—for example, finding similar product images within a specific price range. However, existing methods typically assume attributes are single points or handle only simple range queries where the data object is a point and the query is a range.

This paper tackles a more complex, generalized problem: Range-Range Filtering Approximate Nearest Neighbor (RRANN) search. In RRANN, both the database objects and the query have range-valued attributes (such as a time interval $[l_i, r_i]$ or a price range). Users can define arbitrary range-range predicates, including containment, left/right overlaps, or a disjunction of them.

Figure 1: The atomic conditions of the RR predicates

Existing specialized indexes only support specific subsets of these predicates (like point-objects with range-queries), while general-purpose approaches suffer from high computational overhead because they fail to avoid executing expensive distance computations on unqualified vectors.

Methods

The authors introduce the Multi-Segment Tree Graph (MSTG) to efficiently navigate arbitrary range-range predicates without traversing non-satisfying nodes.

  1. Multi-Segment Tree Structure: MSTG builds segment trees based on the range attributes ($l_i$ and $r_i$) to index the data. For each tree node, a Proximity Graph (PG)—specifically Hierarchical Navigable Small World (HNSW)—is constructed.
  2. Lossless Edge Labeling Compression: A naive implementation of multiple segment trees would cause an exponential explosion in index size. To counter this, the authors introduce a Labeled MSTG. Because graphs built on incrementally changing subsets of data share massive structural similarities, MSTG reuses tree nodes and attaches a label $(b, e)$ to each graph edge. This label indicates the range of segment trees in which the edge is valid, achieving lossless compression.
  3. Handling Arbitrary Predicates: The authors prove mathematically that any complex combination of interval overlaps and containments can be broken down and solved using a maximum of two distinct MSTG indexes and two virtual graph searches.
An illustration of the merged MSTG structure.

Datasets

The authors evaluated MSTG across six real-world datasets spanning different modalities:

  • Sift & Gist: Standard computer vision image feature datasets.
  • WIT-Image: A Wikipedia-based image dataset.
  • Paper: A text-based document dataset.
  • Redcaps: An image-text multimodal dataset, where queries were generated using ChatGPT-4 and embedded via CLIP.
  • Sift50M: A large-scale subset containing 50 million vectors, used specifically to evaluate the scalability of the index.

Numeric range attributes (such as timestamps or price intervals) were mapped to these datasets using various synthetic distributions (uniform, long-tail, normal, Poisson, and Zipf).

Key Insights and Ideas

  • Exploiting Structural Similarity: The core "aha!" moment is realizing that proximity graphs built on slightly different subsets of the same dataset are highly redundant. Labeling edges with validity intervals avoids storing duplicate graphs entirely.
  • Virtual Graph Merging: Instead of physically constructing a new graph for every unique query range, MSTG virtually merges relevant pre-built PGs on the fly during the graph traversal phase, completely bypassing non-satisfying nodes.
  • The Power of Two: Despite the complexity of Allen's Interval Algebra (which defines 13 base relations between two ranges), the authors proved that a maximum of two MSTG index variants are sufficient to answer any arbitrary range-range predicate query.

Key Results

  • Massive Speedups: MSTG consistently outperformed general-purpose filtering methods (such as ACORN, Milvus, and standard post-filtering), delivering 5.2x to 12.5x higher Queries Per Second (QPS) at high accuracy levels (Recall@10 = 0.99) under a 5% query selectivity constraint.
  • Superiority in Sub-problems: When evaluated on simpler, specialized tasks, MSTG matched the performance of the state-of-the-art method for Range-Filtering (iRangeGraph) and significantly outperformed existing methods for Interval-Filtering (Hi-PNG) and Timestamp-ANN (TS-Graph).
  • Scalability: Scalability tests on the 50-million-vector dataset (Sift50M) demonstrated that MSTG scales gracefully, showing predictable, stable increases in indexing time and size while maintaining high search throughput.

Limitations and Future Work

  • Index Overhead: Although highly compressed compared to a naive multi-graph approach, MSTG still requires more index space and longer construction times than simple general-purpose methods (like post-filtering) due to its multi-segment tree architecture.
  • Static Indexing Focus: The current design is optimized for static datasets or incremental insertions. Fully dynamic workloads that involve frequent vector deletions are not yet explicitly optimized.
  • Single Attribute Limitation: The framework currently focuses on filtering a single range-valued attribute. Extending MSTG to handle multi-attribute range filtering remains an open challenge for future research.

Summary updated

BibTeX
@misc{liu2026generalized,
  author = {Yingfan Liu and Tong Wu and Jiadong Xie and Yang Zhao and Jeffrey Xu Yu and Jiangtao Cui},
  title = {{Generalized Range Filtering Approximate Nearest Neighbor Search: Containment and Overlap [Technical Report]}},
  year = {2026},
  eprint = {2605.26474},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.26474},
}
Figure