Evaluating and Tuning Vector Search

Harry · 13 Sep 2026 · 1 views

Metric Definitions

Score your retrieval before tuning it.

  • Recall@k - Of the truly relevant items, what fraction appears in the top k?
  • Precision@k - Of the top k results, what fraction is relevant?
  • Latency - Time per query at your intended load.
  • Memory - Index size relative to raw vectors.

Build a Test Set

Create a few dozen real questions with known answers from your corpus. Run every retrieval change against that set so improvements are measurable, not guessed.

Tuning HNSW

# larger efSearch improves recall at higher cost
hnsw.hnsw.efSearch = 128
hnsw.hnsw.efConstruction = 200

Raising M and efConstruction at build time improves graph quality; raising efSearch improves recall at query time.

Trading Recall for Speed

  • Raise nprobe for IVF indexes.
  • Add quantization only when memory is the bottleneck.
  • Prefer recall@5 over recall@1 targets.
  • Benchmark at your real data size; small tests lie.

Key Points

  • Measure recall and latency before and after each change.
  • A fixed test set turns tuning into science.
  • efSearch and efConstruction control HNSW behaviour.
  • Only add quantization when memory forces you to.
Share this post:

Comments (0)

Please login or register to comment.