What is AI chunk overlap?
Chunk overlap is the amount of text repeated at the boundary of two consecutive chunks when a document is split, appearing at the end of one and the start of the next, so sentences and clauses split there keep their meaning.
Unlike chunk size, which is the total length of each chunk, overlap is the part of that length shared with the neighbouring chunk. The two are tuned together.
- Topic
- Embeddings, document processing and RAG
- Also known as
- Overlap
How AI chunk overlap works
- Chunk size and overlap are set in tokens or characters.
- Each new chunk starts with the overlap amount of text from the end of the previous one.
- With structure-based splitting, context is sometimes kept by adding the preceding heading or clause to the chunk instead of overlap.
- Example calculation: with 512-token chunks and 64 tokens of overlap each chunk advances 448 tokens; the chunk count grows about 512 / 448 ≈ 1.14 times, roughly 14 per cent.
In more detail
Merging overlapping retrieved chunks
When top-k retrieval returns two adjacent overlapping chunks from the same document, feeding both verbatim wastes context tokens and can bias the LLM toward repeated sentences. Production pipelines either merge contiguous overlapping spans before prompting or rely on sentence-window/parent-chunk expansion instead of large fixed overlaps.
Top-k diversity and near-duplicate vectors
Large overlaps create near-duplicate vectors that crowd the top-k results of vector search, pushing out distinct relevant passages from other parts of the corpus. Keeping overlap modest when structural splitting is unavailable preserves recall without flooding retrieval results.
Modern alternatives: semantic chunking, late chunking and contextual headers
Advances such as semantic chunking and late chunking (encoding long documents before pooling chunk vectors) reduce reliance on literal text overlap. Similarly, contextual retrieval prepends a short document-level summary to each chunk before embedding, keeping context intact with zero token duplication at boundaries.
Commonly confused terms
| Term | How it differs |
|---|---|
| Parent-document retrieval | Sliding window chunking applies a fixed stride with token/character overlap across raw text, whereas parent-document (small-to-big) retrieval indexes small chunks for search precision and expands to their larger enclosing section at generation time without duplicating text in the index. |
| Late chunking | Late chunking encodes the full document through a long-context embedding model before pooling per-chunk vectors, preserving cross-boundary context without overlapping raw text. |
Why AI chunk overlap matters for on-premises AI
A clause often falls on a chunk boundary; without overlap one chunk holds its start and the next its end, so neither is retrieved correctly alone. The cost is a larger index and repeated content; too much overlap can put the same text into the context more than once. Overlap is therefore tuned with chunk size on the organisation's own question set. Splitting by document structure can reduce the need for it.
An insurer finds exclusion clauses in its policy terms cut at chunk boundaries; adding a small overlap and the clause heading to each chunk reduces wrong answers.
Common questions
How much chunk overlap is needed?
There is no fixed right value. Usually a small share of chunk size is chosen and tuned by testing on your own question set.
Can chunking work without overlap?
Yes. If documents are split at paragraph or clause boundaries and chunks carry heading information, the need for overlap falls.
Related terms
Sources
- Retrieval-Augmented Generation for Large Language Models: A Survey, 2023
- Financial Report Chunking for Effective Retrieval Augmented Generation, 2024
In the glossary: Glossary, A to D