What is Chunk Overlap?

Chunk Overlap is the repeated text shared between adjacent document chunks so that information near a split boundary remains available during retrieval.

How It Works

Chunk overlap is an optional boundary-recovery mechanism, not a required percentage of chunk size. Repeating source text can recover evidence split by an artificial window, but it also enlarges the index, creates near-duplicate candidates, and reduces unique evidence under a fixed context budget. Start with a zero-overlap baseline, then test absolute token counts on boundary-sensitive queries while holding the unique retrieved-token budget constant. Preserve canonical offsets so repeated text maps to one source span, and report evidence gain separately from duplicate-context ratio.

Key Characteristics

  • Preserves local context around chunk boundaries
  • Optional rather than mandatory: zero overlap is the control condition
  • Measured as absolute repeated tokens for comparable and auditable ablations
  • Evaluated by unique evidence recovered, duplicate-context ratio, index growth, and latency
  • Canonical-offset preserving: repeated copies resolve to one original evidence span
  • Policy-dependent: structural boundaries, sentence windows, or parent expansion may remove the need for overlap

Common Use Cases

  1. Keeping a definition and its following explanation together across a split
  2. Reducing answer failures when paragraphs are longer than the target chunk size
  3. Maintaining code comments and code lines near a chunk boundary
  4. Testing zero overlap and several absolute-token candidates on boundary-sensitive queries
  5. Rejecting overlap when it adds duplicate context without recovering unique evidence

Example

loading...
Loading code...

Frequently Asked Questions

How much chunk overlap should a RAG system use?

Do not inherit a percentage. Start with zero overlap, inspect labeled boundary failures, and test a small grid of absolute token counts. Keep the unique retrieved-token budget fixed and accept overlap only when unique evidence recovery outweighs duplicate context, index growth, and latency.

Can chunk overlap hurt retrieval?

Yes. Even modest overlap can create duplicate vectors and repeated results. Measure duplicate-context ratio and unique evidence density rather than assuming reranking will remove every duplicate.

Is overlap needed for structured data?

Often not. Records, rows, and well-bounded fields need schema, lineage, and authorization preservation more than sliding overlap. Test any exception on queries whose evidence genuinely crosses a structural boundary.

How does overlap affect citations?

Repeated copies must retain canonical source offsets and be deduplicated before citation. Citation scoring should count the original evidence span once, even when several retrieved chunks contain it.

Related Tools

Related Terms

Related Articles