Skip to content

6200: Retrieval Strategies

⏱ 4 min readΒ·πŸ“… Last updated: 2026-10-24

Module Overview

This module covers advanced retrieval techniques for RAG systems, including hybrid search, re-ranking, and retrieval optimization. You'll learn to build high-quality retrieval pipelines that find the most relevant context.

Why This Matters:

  • Pure vector search misses keyword-specific information
  • Re-ranking can significantly improve retrieval quality
  • Hybrid search combines the best of semantic and lexical search
  • Retrieval is the bottleneck for RAG quality

Learning Objectives

After completing this module, you will be able to:

  • Hybrid Search: Combine semantic and keyword search
  • Re-ranking: Improve retrieved results with cross-encoders
  • Diversity & Boosting: Balance relevance against redundancy with MMR; weight sources with document boosts
  • Query Expansion: Enhance queries for better retrieval
  • Retrieval Logistics: Optimize chunk size, top-K, and overlap
  • Evaluation: Measure retrieval quality with precision/recall

Module Contents

Semantic + Lexical Search Fusion

  • Vector search vs keyword search (BM25)
  • Reciprocal Rank Fusion (RRF)
  • Dense vs sparse retrieval
  • Learning to rank
  • Query understanding and expansion

Experiments:

  • Implement BM25 keyword search
  • Build hybrid search pipeline
  • Compare fusion strategies
  • Measure quality improvements

6202: Re-ranking and Retrieval Logistics

Two-Stage Retrieval Optimization

  • Re-ranking with cross-encoders
  • Chunking strategies and window sizes
  • Top-K selection and tuning
  • Context window optimization
  • Retrieval evaluation metrics

Experiments:

  • Implement re-ranking pipeline
  • Compare chunking strategies
  • Optimize retrieval parameters
  • Build evaluation framework
  • 6203: Advanced Retrieval

6204: Diversification and Boosting

Selection-Side Retrieval Levers

  • The redundancy failure: one fact five times with every relevance metric green
  • Maximal Marginal Relevance: the greedy λ·rel βˆ’ (1βˆ’Ξ»)Β·redundancy dial
  • max_marginal_relevance_search: the k / fetch_k / lambda_mult contract
  • Document boosting: provenance weights that arbitrate near-ties (0.979 vs 0.988)
  • Boost placement: fused-score vs channel-scoped arithmetic and the effective Ξ±
  • Measuring diversity: intra-list similarity and distinct-fact coverage

Experiments:

  • Tune MMR lambda until the paraphrase cluster breaks
  • Compute the Ξ» crossover instead of dialing by taste
  • Apply provenance boosts to the fused score and to one channel
  • Add ILS and fact coverage to a retrieval eval

Prerequisites

Before starting this module, ensure you have:

  • Module 6100: Vector Embeddings (semantic search)
  • Module 3200: Embedding Latent Spaces (embedding models)
  • Python and information retrieval basics
  • Understanding of RAG fundamentals
  • Familiarity with search metrics

Review: PREREQUISITES.md for detailed requirements.

Assessment

Quiz

  • Format: 20 multiple-choice questions
  • Passing Score: 80% (16/20)
  • Topics: Hybrid search, re-ranking, retrieval optimization
  • Location: 6200: Retrieval - Quiz

Practice Exercises

  • Format: Retrieval pipeline projects
  • Duration: 6-8 hours
  • Topics:
    • Build hybrid search system
    • Implement re-ranking
    • Optimize chunking strategies
    • Evaluate retrieval quality
  • Location: 6200: Advanced Retrieval - Practice

This module connects to:

  • 6100: Vector Embeddings (semantic search)
  • 6300: Context (context window management)
  • 6400: Vector Databases (production retrieval)
  • 6500: MLOps Pipelines (retrieval at scale)

Time Commitment

Activity Time
Reading (6201) 3 hours
Experiments (6201) 3 hours
Reading (6202) 3 hours
Experiments (6202) 4 hours
Reading (6204) 3 hours
Experiments (6204) 2 hours
Quiz 30 minutes
Practice 6-8 hours
Total 24.5-26.5 hours

Resources

Essential Libraries:

  • LangChain (retrievers)
  • LlamaIndex (hybrid search)
  • rank-bm25 (keyword search)
  • sentence-transformers (cross-encoders)
  • ColBERT (late interaction)

Essential Papers:

  • "Dense Passage Retrieval for Open-Domain Question Answering"
  • "ColBERT: Late Interaction via BERT"
  • "Reciprocal Rank Fusion outperforms Condorcet and individual Rank Learning"

Search Method Comparison

Method Precision Recall Speed Best For
BM25 (Keyword) High Low ⭐⭐⭐⭐⭐ Exact terms
Dense (Vector) Medium High ⭐⭐⭐⭐ Semantic meaning
Hybrid (RRF) High High ⭐⭐⭐⭐ Most queries
Re-ranked Very High High ⭐⭐⭐ Final results

Fusion Strategies

Strategy Description Complexity
RRF Reciprocal Rank Fusion Low
CC Convex Combination Medium
LRR Learn to Rank High
Hybrid + Re-rank Two-stage approach High

Re-ranking Models

Model Speed Quality Best For
ms-marco-MiniLM ⭐⭐⭐⭐⭐ ⭐⭐⭐ Fast re-ranking
bge-reranker-base ⭐⭐⭐⭐ ⭐⭐⭐⭐ General purpose
cohere-rerank ⭐⭐⭐ ⭐⭐⭐⭐⭐ Production (API)
ColBERT ⭐⭐ ⭐⭐⭐⭐⭐ Maximum quality

Chunking Strategies

Strategy Description Use Case
Fixed Size Fixed length chunks Simple documents
Recursive Hierarchical splitting Complex documents
Semantic Sentence/paragraph boundaries Natural language
Question-Answer Extract Q&A pairs FAQ content
Parent-Child Small chunks, big context Long documents

Retrieval Parameters

Parameter Range Effect
Chunk Size 256-2048 Context vs specificity
Overlap 10-25% Boundary information
Top-K 5-20 Recall vs noise
Re-rank Top-K 3-10 Final selection

Tips for Success

  1. Start with hybrid search: Best bang for buck
  2. Re-rank sparingly: Only on top results
  3. Tune chunk size: Critical for quality
  4. Measure retrieval accuracy: Before end-to-end evaluation
  5. Consider your data: Structure affects chunking strategy

Common Pitfalls

  1. Chunks too small: Lose context
  2. Chunks too large: Lose specificity
  3. No overlap: Miss boundary information
  4. Over-retrieving: Too much noise in context
  5. Under-retrieving: Missing relevant information

Retrieval Evaluation Metrics

Metric Formula Target
Precision@K TP / (TP + FP) >0.8
Recall@K TP / (TP + FN) >0.9
MRR 1 / rank_of_first_relevant >0.8
NDCG@K DCG / IDCG >0.7

Hybrid Search Pipeline

Query
  ↓
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Vector Search β”‚ Keyword Search β”‚
β”‚  (Semantic)   β”‚    (BM25)      β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       ↓               ↓
    Reciprocal Rank Fusion
       ↓
    Top-K Results (e.g., 50)
       ↓
    Cross-Encoder Re-ranking
       ↓
    Top-K Results (e.g., 10)
       ↓
    Generation

When to Use Each Strategy

Scenario Best Approach
Exact term matching BM25 only
Semantic understanding Vector only
General purpose RAG Hybrid + Re-rank
Fast retrieval Vector only
Maximum quality Hybrid + Re-rank + ColBERT

Next Module: 6300: Context Management

Previous Module: 6100: Vector Embeddings

Questions? Review the PREREQUISITES.md or check Phase 6 documentation.