TRANSMISSION // 2611.41192v1

Ledger Tries to Spend Search Effort Where It Counts

Source published

Ledger allocates approximate-neighbor search effort across queries to maximize total recall within a fixed budget. Tests on HNSW report gains, with limits.

AI-generated conceptual illustration for Ledger Tries to Spend Search Effort Where It Counts
AI-generated conceptual illustration; not documentary evidence.

A fixed search setting can spend too much effort on queries that are already easy and too little on harder ones. Ledger estimates how searches may improve and allocates effort across a batch or stream, subject to a shared budget.

Approximate nearest-neighbor (ANN) search helps systems find vectors—numerical representations of things such as text or images—that are close to a query vector. It is often used in retrieval-augmented generation (RAG), where a language model retrieves external information before answering. But queries differ in difficulty: some find good matches quickly, while others need more exploration. If a system has a fixed compute budget, how should it divide search effort to recover as many true neighbors as possible?

The paper introduces Ledger, a framework that treats this as a workload-allocation problem. Rather than trying to make every query meet the same recall target, Ledger aims to maximize the sum of recall across a batch or stream of queries within a fixed total cost. Recall means the share of a query’s exact nearest neighbors that the approximate search finds.

Estimating which queries need more effort

Ledger is designed for graph-based indexes such as HNSW, which search by navigating links between vectors. Its probe is the cheapest search setting: it descends through the graph’s upper layers and also searches the base layer at the base price. The probe’s cost counts against the budget. Information recorded during the probe, including distances to nearby vectors, supplies features that Ledger uses as clues about query difficulty.

Ledger groups queries with similar feature values in a hierarchical structure called a Ball-tree. To estimate how recall and cost change as effort increases, it uses audited queries: searches run at the highest setting and replayed to read outcomes at lower settings. An important qualification is that audit recall is measured relative to the answer from the highest-price search, not necessarily against the exact nearest neighbors. That top-price search can itself miss true neighbors, so these audit tables are estimates of relative performance, not a direct measure of exact recall. Groups with little audit data can draw on estimates from higher levels of the tree.

For a batch, Ledger uses these tables to decide which queries should receive more search effort. The allocation can be formulated as a multiple-choice knapsack problem: each query has possible settings with estimated costs and recalls, and total cost must fit the remaining budget. The paper describes exact, approximate and greedy allocation approaches, along with AnyLedger, which uses the state of searches as they progress. For a stream, OnliLedger adjusts a “tariff”: overspending relative to the budget rate raises it, making costly upgrades less attractive for later queries.

What the evaluation reports

The authors evaluate Ledger on HNSW using four vector datasets: DEEP-10M, SIFT-10M, SpaceV-10M and T2I-10M. Their workloads are built by adding noise to selected reference queries, with reference-query folds separated between training and testing. They compare Ledger variants with fixed-effort searches, methods that tune effort to recall targets, and other baselines.

In these tests, Ledger-greedy achieved about eight percentage points more recall than the best fixed-effort setting on average at matched budgets. AnyLedger was above Plain, Best-fixed-ef and Ledger-greedy on every workload over the four-fold evaluation, and averaged 1.5 points more recall than Ledger-greedy. The paper also reports that, pooled across noise levels and five budgets in its per-query analysis, the share of queries below half recall was 43% for best-fixed-ef and 29% for AnyLedger. These results describe the authors’ evaluation setup, not a prediction for every dataset or deployment.

A brute-force oracle performed better than AnyLedger on every workload. The comparison uses the true recall rows of test queries to find the best allocation among the considered settings; that information is not available to a practical allocator before searches run. The gap illustrates the cost of Ledger’s estimates, which may assign a query too much or too little effort.

The paper also reports a time trade-off. At the same recall on its datasets, Ledger-greedy took 1.4 to 2.1 times the time of Plain, while AnyLedger took 3.3 to 4.1 times the time. The authors argue the approach is most relevant when distance computations, rather than elapsed time alone, are the constrained resource.

What remains uncertain

Ledger depends on probe features and audited examples being informative about how queries will behave. If a workload shifts, its groups and tables may become less representative; the paper describes monitoring and rebuilding, but that is not evidence of performance under every kind of change. Its evaluation uses a particular index, hardware setup, datasets and synthetic workload construction. Tests in other systems and real RAG workloads would help establish how well the results transfer. Integration into existing systems and dynamic indexes are listed as future work.

The online regret guarantee also has a specific scope. The theorem assumes, among other conditions, that queries are drawn independently from the same distribution (i.i.d.), and requires a feasible budget and specified sampling and algorithm settings. Its bound separates learning overhead from approximation losses due to grouping queries and using a finite list of search settings; it does not promise that practical allocations always match the hindsight optimum.

This work is an arXiv preprint. Ledger presents a principled way to allocate search effort under a shared budget, but broader evidence is needed to know how consistently it helps in deployed systems.

Automatically matched by shared topic keywords. These links do not imply that the sources agree or establish a consensus.