Optimizing RAG Through an Evaluation-Based Methodology
A Qdrant technical article showing that evaluation is the only reliable compass for RAG optimisation: build a naive RAG over Qdrant docs, score it with Quotient, then iterate across chunk size, retrieval window, embedding model and LLM.
This write-up was first published at web.archive.org. Below is a summary and what we would add today.
Published as a Qdrant technical article in June 2024, with a companion workshop on YouTube and a notebook in the qdrant-rag-eval repository. The thesis is stated up front: RAG makes LLM answers more grounded, but only an evaluation strategy tells a team whether their particular RAG is actually meeting that promise.
What the article covers
The setup is deliberately simple. A naive RAG is built over Qdrant's own documentation (a pre-compiled Hugging Face dataset of 240 documents), chunked with LangChain's recursive splitter, embedded with FastEmbed and stored in Qdrant Cloud. A prebuilt evaluation dataset of questions and expected answers is used; for each question the pipeline retrieves context, the generator answers, and the whole set is submitted to Quotient, which runs the chosen metrics: context relevance, chunk relevance, faithfulness, ROUGE-L, BERT sentence similarity and BERTScore. Faithfulness is the primary target because the goal is answering questions about Qdrant without inventing anything.
Five experiments follow, each changing one variable. The baseline uses bge-small-en, 512-character chunks with 64 overlap, a retrieval window of 3 and Mistral-7B-Instruct; its chunk relevance is low and highly variable, and the worst-faithfulness examples are the ones where retrieval found nothing useful. Doubling chunk size to 1024 nudges the text-similarity metrics up but drops faithfulness and chunk relevance. Returning to small chunks and widening the window to 5 documents gives the best context relevance, chunk relevance and faithfulness. Swapping bge-small for MiniLM is worse on this corpus. Finally, replacing Mistral-7B with GPT-3.5-turbo improves every metric and produces the fewest hallucinations.
The conclusions are measured: retrieval is still the weak link, the spread in context relevance suggests a dynamic retrieval strategy, and the generation side (model, prompt) deserves its own exploration. The article's real point is the method: start from scratch, evaluate, change one thing, evaluate again.
What I would add today
The specific winners (bge-small over MiniLM, GPT-3.5 over Mistral-7B) have long been overtaken by newer models, and that is exactly the point of the article: the models are temporary, the methodology is not. I would now treat the "irrelevant retrieval predicts hallucination" finding as the single most important sentence, because it tells teams to look at retrieval before touching prompts. And I would want real user questions in the evaluation set alongside the prebuilt ones, with the unanswerable ones kept in.