LLM-Guided ANN Index Optimization for Human-Object Interaction Retrieval

Shahrzad Esmat, Chaunte W. Lacewell, Sameh Gobriel, Nilesh Jain, Ali JannesariarXiv 2026

TL;DR

Traditional hyperparameter optimization methods fail in multi-stage vector retrieval because they incorrectly assume parameters are independent. This paper introduces a phase-aware Large Language Model (LLM) agent that optimizes tightly coupled search and reranking parameters jointly by analyzing its own trial history. Evaluated on complex visual retrieval tasks, the agent delivers up to a 36.6× throughput boost over unoptimized baselines and significantly outperforms state-of-the-art optimizers like Optuna TPE.

What Problem Does This Paper Address?

Modern vector database management systems (VDBMS) typically employ a two-stage retrieval pipeline: a fast Approximate Nearest Neighbor (ANN) search followed by a fine-grained reranking step. Crucially, the parameters governing these stages are highly interdependent. For instance, reducing the ANN search depth (efSearch) to save time forces the reranker to compensate with a higher fusion weight ($\alpha$).

Traditional Hyperparameter Optimization (HPO) techniques—such as Tree-structured Parzen Estimators (TPE) and Gaussian Process Bayesian Optimization (GP-BO)—treat these parameters as independent marginals. Consequently, they struggle to navigate the discontinuous "feasibility cliffs" where a system's throughput is only valuable if it meets a strict accuracy threshold. This paper addresses the lack of joint, context-aware optimization in multi-stage retrieval systems.

Methods

The authors propose a phase-aware LLM agent that acts as a sequential black-box optimizer over a configuration space of over 102,000 possible settings (detailed in Figure 5).

Instead of relying on a mathematical surrogate model, the agent reads its own structured trial history trajectory ($\mathcal{H}_{t-1}$) to reason about parameter interactions. The optimization budget (50 iterations) is partitioned into three distinct phases:

  1. Exploration: Focuses on broad engine coverage to find viable structural regions.
  2. Exploitation: Narrows down on the Pareto frontier to balance the candidate pool size ($k$) and fusion weight ($\alpha$).
  3. Fine-tuning: Performs coordinate-wise micro-adjustments for latency-targeted gains.

The framework utilizes a novel evaluation metric called SIEVE (Safeguarded Index Evaluation of Vector-search Efficiency), which zeroes out the score of any configuration that falls below a minimum acceptable retrieval quality floor ($\tau$), matching real-world production constraints.

Figure 2: Optimization framework: five methods over 𝑁=50 iterations (adaptive methods receive score feedback).

The underlying retrieval pipeline pairs a CLIP-based ANN search with a DINOv2-based visual reranker, as illustrated below:

Figure 1: Two-stage retrieval pipeline (CLIP ANN retrieval + DINOv2 reranking).

Datasets

The approach was validated across three benchmarks representing decreasing levels of parameter coupling:

  • HICO-DET (High Coupling): Repurposed by the authors into the first text-query Human-Object Interaction (HOI) retrieval benchmark, featuring 47,776 images and 600 compositional natural language queries (e.g., "a person riding a horse").
  • GLDv2 (Moderate Coupling): Google Landmarks Dataset v2, used for large-scale image-to-image retrieval (762,000 gallery images).
  • SIFT1M (No Coupling): A standard synthetic benchmark consisting of 1 million vectors, serving as a control variable to test the index search in isolation.

Key Insights and Ideas

  • LLM Reasoning Scales with Complexity: The LLM agent’s advantage is directly proportional to the complexity and coupling of the parameter space. On simple, uncoupled datasets like SIFT1M, the performance of all optimizers converges within 3.6%. On highly coupled datasets like HICO-DET, the LLM's structural reasoning shines.
  • The Danger of Smooth Metrics: Traditional smooth optimization metrics can mislead HPO tools. Because production systems have a hard accuracy floor, smooth models like GP-BO average out performance near the "cliff," frequently selecting configurations that fail in production.
  • Centroid-Displacement Theory: The authors prove mathematically and empirically that text queries in CLIP naturally align close to the visual centroid of compositionally structured categories, outperforming single-image reference queries by +2.32 pp mAP.

Key Results

  • Throughput and Accuracy Gains: On the HICO-DET benchmark using Intel VDMS, the LLM agent achieved a +33.3% score improvement over Optuna TPE and +34.2% over VDTuner under the SIEVE metric.
  • Baseline Comparison: The optimized configuration delivered a 15.3× throughput gain over UniIR and a 36.6× gain over the unoptimized CLIP baseline.
  • Cross-System Transferability: Without any code modifications, the LLM agent ranked first across all three datasets when deployed on a completely different vector database backend, Milvus.

Limitations and Future Work

While highly effective, the authors note that the current evaluation was bounded by a 50-iteration budget due to the high wall-clock time of rebuilding indices (~8–9 minutes per oracle call). Future work will focus on scaling the phase-aware framework to billion-vector corpora and extending the agent to multi-objective optimization scenarios where latency, throughput, and quality targets must be negotiated simultaneously.

Summary updated

BibTeX
@misc{esmat2026llm,
  author = {Shahrzad Esmat and Chaunte W. Lacewell and Sameh Gobriel and Nilesh Jain and Ali Jannesari},
  title = {{LLM-Guided ANN Index Optimization for Human-Object Interaction Retrieval}},
  year = {2026},
  eprint = {2606.05489},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.05489},
}
Figure