Chunking
Definition
The process of splitting large documents into smaller, manageable pieces for embedding and retrieval in RAG systems.In-Depth Explanation
Chunking is crucial for RAG performance because embedding models and LLM context windows have size limits. Strategies include fixed-size chunks, sentence-based splitting, semantic chunking, and recursive splitting that respects document structure. Chunk size affects retrieval precision—smaller chunks are more precise but may lose context, while larger chunks preserve context but may include irrelevant information.
Real-World Example
Splitting a 100-page manual into 500-token chunks with 50-token overlap to ensure no information is lost at boundaries.