This is one of those questions that sounds scoped until you realize every component is basically its own sub-question.
Walk through the RAG pipeline component by component, clearly stating for each: the design choice, the evaluation metric(s), whether evaluation is offline or online, and how to obtain ground-truth data. Emphasize trade-offs and justify decisions based on scale, latency, and cost. Conclude with an end-to-end evaluation strategy that ties component metrics to overall system performance.
Pro tip: Frame evaluation as a continuous feedback loop: use offline metrics for rapid iteration, online metrics for real-world validation, and user feedback to continuously improve ground truth. Highlight that ground-truth collection is often the hardest part and propose scalable methods like weak supervision and human-in-the-loop.
Describe the ingestion pipeline (e.g., document loaders, preprocessing) and chunking strategy (fixed-size, semantic, recursive). For evaluation, use offline metrics like chunk coherence and retrieval hit rate on a labeled set; collect ground truth via human annotation of relevant chunks for sample queries.
Choose embedding model (e.g., OpenAI embeddings) and vector database (e.g., Pinecone, FAISS). Evaluate embedding quality offline via retrieval metrics (recall@k, MRR) on a benchmark dataset; ground truth from human relevance judgments or existing QA datasets. Online, monitor retrieval latency and cache hit rate.
Implement retrieval (e.g., dense, hybrid) and reranking (e.g., cross-encoder). Offline evaluation: precision@k, NDCG for reranker; ground truth from human-annotated relevance. Online: A/B test different retrievers/rerankers measuring user engagement (CTR, dwell time).
Generate answers with LLM, then post-process (e.g., citation, formatting). Offline evaluation: faithfulness, answer relevance, fluency using metrics like BLEU, ROUGE, BERTScore, or LLM-as-judge; ground truth from human-written answers. Online: user feedback (thumbs up/down), task success rate.
Combine component metrics into holistic evaluation: offline end-to-end QA accuracy, online A/B tests for business metrics (e.g., conversion). Collect ground truth via continuous human annotation, user feedback, and synthetic data generation. Use results to iterate on weak components.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.