r/learnmachinelearning • u/Professional_Use9214 • 4h ago
Learning RAG: what should I get right first, chunking, embeddings or retrieval evaluation?
I'm a student learning Retrieval-Augmented Generation. I understand the basic flow: split documents into chunks, embed them, store in a vector database, retrieve the top results, and pass them to an LLM. Where I'm unsure is what matters most in practice. How do you choose chunk size? When is a hybrid of keyword and vector search worth it? And how do you check that retrieval is actually good before blaming the LLM? Any beginner-friendly resources or small project ideas would help.
1
Upvotes
1
u/PLBjt 4h ago
I'd get retrieval evaluation right first, because it's the only thing that tells you whether chunking and embeddings are even worth tuning. Write 30 or so real questions, mark which chunk should answer each one, and measure recall@5 before the LLM touches anything. If the right chunk isn't in the top results, no prompt will fix it. For chunk size, start around 300 to 500 tokens with a bit of overlap and just try two or three sizes against that question set, since the best value depends a lot on how your documents are written. Hybrid search tends to pay off when questions contain exact strings like error codes or names, where BM25 beats embeddings. The tradeoff is more moving parts and a score-merging step to tune, so only add it once your eval shows the misses are keyword-shaped.