Small-to-Big Retrieval
Small-to-Big is a two-level chunking strategy: small chunks are used for vector retrieval to keep semantics focused, and once a hit is found, the large chunk to which it belongs is returned as context. It directly answers the fundamental tension in RAG that "retrieval wants small chunks while generation wants large chunks", and is one of the most important engineering techniques in the chunking step.
Core Principles
Chunking for RAG faces a dilemma. If chunks are cut too large, a chunk mixes several topics and the vector representation is diluted, degrading similarity matching; if cut too small, retrieval is more precise but the context returned to the large model is incomplete, lacking surrounding text and preconditions, so answers easily take things out of context. The idea of Small-to-Big is to decouple the two: at index build time, generate vectors by sentence or small passage (say one to three sentences, tens to one or two hundred tokens), but record in each small chunk's metadata the identifier of the large chunk it belongs to, or simply store the character offsets into the original text.
At retrieval time, vector search is first run on small chunks; on a hit, the parent chunk is looked up by metadata and the whole parent chunk is spliced into the prompt. The parent-child relation can be one level (sentence to paragraph) or multiple levels (sentence to paragraph to section); more levels give more complete returned context, but positioning accuracy also depends more on the retrieval quality of small chunks. Common implementations include: a parent document reassembled from several child chunks by delimiter, child chunks mapped to a parent chunk through a unique chunk_id, or not storing the parent itself but using offsets to cut a larger window from the original text. In LlamaIndex, ParentDocumentRetriever and SentenceWindowNodeParser are classic encapsulations of this pattern, the latter indexing at sentence level and, on a hit, expanding several sentences left and right as the context window. LangChain has a similar implementation, usually maintaining the parent-child mapping via a separate document store.
Key Points
The window size must be adjustable: expanding one to three sentences left and right is a common starting point, with final validation still needed per task. Parent chunks must have a controlled token budget: when several child chunks hit, parent chunks may repeat or their total length add up, so deduplicate by parent identifier and then truncate the total. Do not vector-index the parent chunks again, which amounts to falling back to the original dilemma; the parent chunk only needs its original text kept in the document store. Align child boundaries to sentences or semantic units so that hard cuts do not leave half a sentence retrieved. Keep the heading path as metadata so the parent context is easier for the model to understand. Model scores and context separately: after retrieving several child chunks, aggregate scores by parent chunk and use the aggregate to decide which passages to send to the model, preserving fine-grained matching without losing overall relevance. Keep two stores with distinct roles: the vector store holds only child-chunk vectors and parent identifiers, while the original text lives in the document store, and on a retrieval hit the body is fetched back by identifier. Use hit counts as a quality signal: if all child chunks hit by one query fall within the same parent chunk, that passage is highly relevant and its ranking weight can be raised; if hits scatter across a dozen parent chunks, the question is often too broad and should first be decomposed. Distinguish the object when reranking: if a reranking model is used, weigh whether to score child chunks or parent chunks; scoring child chunks is usually finer, but fusing scores requires deciding how scores of multiple child chunks under the same parent are aggregated.
Common Misconceptions
Assuming that returning large chunks is always good: in fact an overlong parent chunk squeezes the context window, dilutes key information and raises cost, even introducing distracting content. Another misconception is vectorizing both parent and child chunks, causing index bloat and retrieval ambiguity. Some forget to handle deduplication when the same parent chunk is hit multiple times, so large repeated text appears in the prompt. In addition, if a parent chunk itself crosses section boundaries, the returned context mixes in irrelevant content, so chunking should respect the document's heading hierarchy.
Application Scenarios
Long-document question answering, retrieval of technical manuals and specifications, lookup of legal provisions and precedents, analysis of financial statements and research reports, customer service knowledge bases, multi-hop reasoning question answering, code documentation retrieval, comparison of meeting minutes and contract clauses. Suitable for documents with a clear hierarchy.