The retrieval-augmented generation pipeline can be decomposed into three operational phases: segmentation (partitioning documents into retrievable units), encoding (mapping units to dense vector representations), and retrieval (identifying the top-k units most relevant to a query). The segmentation phase — commonly referred to as "chunking" — is empirically the most consequential for downstream generation quality, yet it receives the least rigorous treatment in production RAG deployments.

We formalize the segmentation problem as an optimization over the space of possible partitionings of a document D into segments S = {s1, s2, ..., sn}, where each segment si is a contiguous token span. The objective is to maximize the expected information utility U(si, q) for the distribution of downstream queries q ∼ Q, subject to constraints on segment granularity and the embedding model's context window C.

The Six Segmentation Strategies