On this page
What does chunk size actually change?
A small passage lets retrieval focus on a specific fact, but may omit the prerequisite needed to interpret it. A large passage preserves context while compressing several topics into one embedding. Values such as 256, 512 or 1024 tokens are not universal optimums. Document structure, query length, answer scope and the embedding model's training objective matter. Start with boundaries that respect headings, paragraphs and tables before running a broad hyperparameter search over arbitrary lengths.
When are overlap and parent–child retrieval useful?
Overlap preserves some neighboring context at the cost of repeated text appearing among results. Parent–child retrieval searches small passages and expands a selected hit into its parent section before generation. This separates retrieval precision from context completeness. However, the parent section must pass the same authorization checks: permission for one sentence is not automatically permission for an entire document. Large parents also consume substantial prompt budget. Evaluate whether the expanded evidence actually improves answer support.
Why is BM25 still useful?
When users search for an error code or a part number, exact terms can matter more than semantic proximity. BM25 uses term statistics and document length to favor discriminative matches. Embeddings capture semantic relationships but do not always preserve rare identifiers. The two methods complement each other. BM25 still depends on language analyzers, tokenization and normalization. Evaluate identifier-heavy queries separately to find out when lexical retrieval adds genuine value.
How should hybrid search results be combined?
Lexical scores and vector similarities usually use different scales, so directly adding them can overemphasise one source. RRF combines ranks rather than relying on compatible raw scores. Weighted fusion instead depends on weights selected from validation queries. A short product-code question can need a different balance from a long description. An improvement in aggregate retrieval quality need not hold across languages and query types.
Bi-encoder versus cross-encoder
A bi-encoder represents queries and documents separately, allowing documents to be indexed ahead of time. A cross-encoder processes them together for a richer relevance score at the cost of computation for every pair. Two-stage retrieval uses the first to find candidates and the second to rerank them. A small pool can discard the right document early; a large pool can increase latency. Actual traffic and document lengths shape that cost alongside candidate count.
Diversity and context selection after reranking
The top ten reranked passages may repeat nearly the same paragraph from one document. Diversity methods, including maximal marginal relevance, can help expose additional sections or sources. Forcing diversity on every query, however, may displace the strongest evidence for a narrow factual question. The selection strategy should reflect the number of facts needed: one authoritative source for a single limit, multiple current sources for a comparison. Version and authorization constraints must apply before any diversity heuristic.
What is the right unit of evaluation?
Ten similar questions derived from one document do not represent ten independent user needs. Near-duplicate documents split across tuning and test sets can also make results optimistic. Topics, languages, document families and roles expose different failures. Recall@k, MRR and nDCG describe retrieval, while the generator’s answer requires a different assessment. Long or repeated evidence can prevent an improved retrieval score from producing a better response.
Separating the contribution of retrieval changes
Changing chunking, retrieval and reranking together makes the source of an improvement unclear. Comparing fixed-length and heading-based chunks on the same questions isolates the first difference. Combining BM25 with vector retrieval and introducing a reranker are separate changes after that. Selecting settings on validation data while holding the test questions aside preserves the comparison. Memory, index-update time, context cost and p95 latency show what the quality gain costs.
When a temperature limit is assigned to the wrong product
Illustrative scenario; not a measured project result.
Suppose a service manual gives an operating limit of 60 °C for model A and 75 °C for model B. A chunk boundary separating a product name from its temperature can associate an apparently valid number with the wrong model. An overly long chunk can put both limits in the same context and create a different ambiguity. These temperatures are illustrative values, not measurements or operating instructions for an actual product.
More context is not always better
Large chunks may preserve a procedure while bringing irrelevant text into a narrow question. A reranker can reduce those candidates but adds latency. The choice therefore goes beyond chunk size or top-k: missing information, repeated evidence and the context reaching the generator change together. Comparisons on the same queries help distinguish the source of those changes.
Frequently asked questions
What is the best chunk size?
No universal value exists; select it with validation data that reflects document structure and queries.
Does every RAG system need a reranker?
No. If first-stage retrieval is strong enough, the extra latency may not pay off; test the increment.
Why use hybrid retrieval?
It combines semantic similarity with exact lexical matching for heterogeneous query types.