Text chunking divides a long document into smaller, focused units before embedding and retrieval. It addresses embedding-model context limits: text beyond the model’s context window may be ignored. In a retrieval-augmented generation pipeline, chunks let search retrieve relevant evidence for a response rather than treating a full document as one undifferentiated unit. section 6.0 section 6.3
A useful chunk preserves a semantically coherent piece of information while staying within the allowed size. Splitting a hotel description into accommodation, dining, and spa chunks lets a query for spa services retrieve the spa chunk without unrelated details. This improves retrieval precision by making the embedded unit match the information sought. section 6.3.5
Choose a strategy by balancing semantic coherence, size limits, and processing cost:
- Use paragraph-based splitting for structured documents when preserving complete thoughts and procedures matters, while watching for oversized chunks in dense papers. section 6.3.6
- Use recursive chunking for dense or long-form text. Try large natural boundaries first, then fall back through smaller boundaries until the chunk fits. section 6.3.6
- Use semantic chunking when topic boundaries and conceptual shifts should determine chunks, accepting added computation and domain-specific tuning. section 6.3.6
Recursive split with overlap
A recursive splitter can target 1,024 characters, attempting paragraphs, newlines, words, and punctuation before a character-level fallback. Add the last 50 characters of the preceding split to each later chunk to preserve continuity across boundaries. Applied to 479 research-paper records, this process produces 657 chunks ready for embedding, vector storage, and similarity search. section 6.4
Figure 6.4 Comparison of LLM Text Chunking Strategies
Compare chunking strategies visually to relate splitting choices to semantic boundaries and context constraints. section 6.3.6























