Course contentsShow
← Machine Learning and Deep Learning
Lesson 2028 of 3,53843. Retrieval-Augmented Generation: Advanced TechniquesFree lesson

Hit Rate and Success Rate Metrics

Evaluating whether at least one relevant document appears in the top-k results for each query.

Hit Rate and Success Rate Metrics

What you'll learn: How to measure whether your RAG system successfully retrieves at least one relevant document in its top results.

The Core Idea

After learning sophisticated ranking metrics like NDCG and MRR, you need a simpler baseline question: Did the system retrieve ANY relevant document at all? Hit Rate (also called Success Rate or Recall@K) answers this binary question for each query.

Hit Rate measures the percentage of queries where at least one relevant document appears in the top-k retrieved results. If your system returns 10 documents and even one is relevant, that query counts as a "hit." If none of the 10 are relevant, it's a "miss."

Why This Matters

Think of Hit Rate as the "did we even show up to the game?" metric. A system with high MAP or NDCG but low Hit Rate means it ranks well when it finds relevant documents, but often retrieves nothing useful at all. For RAG systems, this is critical—if no relevant context reaches your LLM, generation will fail or hallucinate.

Calculating Hit Rate

Hit Rate@K = (Number of queries with ≥1 relevant doc in top-K) / (Total queries)

If you test 100 queries at K=10:

  • 85 queries have at least one relevant document in their top 10
  • 15 queries have zero relevant documents in top 10
  • Hit Rate@10 = 85/100 = 0.85 or 85%

Unlike MRR (which cares about position) or MAP (which considers all relevant docs), Hit Rate only asks: "Did we get at least one right?"

Key Takeaway: Hit Rate@K measures the minimum viability of your retrieval system—whether it successfully finds at least one relevant document in the top-k results for each query, providing a simple pass/fail signal for retrieval quality.