What is chunk overlap, and why is it used?
Overlap repeats a small slice of text at the end of one chunk at the start of the next. It prevents a sentence or idea cut at a boundary from being split with no chunk containing it whole, at the cost of some duplicated storage.
Explain it simply
Imagine photocopying a long notice by cutting it into strips. If a sentence falls exactly on a cut, each strip has half of it and neither makes sense alone.
Overlap fixes that. If chunks are 300 tokens with 50 tokens of overlap, the last 50 tokens of chunk 1 are also the first 50 of chunk 2. A sentence near the boundary then appears whole in at least one chunk.
The cost is more chunks, a bigger index and sometimes near-duplicate results in the top matches, which you may want to deduplicate. Too much overlap wastes space and does not help further. Many teams use roughly 10 to 20 percent of chunk size, then adjust. Splitting at sentence or paragraph boundaries reduces the need for overlap.
Example
Chunk 1: [ ......................... "...refunds are issued within" ]
Chunk 2: [ "within 7 working days of approval..." ......................... ]
^ overlapping words keep the sentence intactWhat to say in the interview
"Overlap duplicates a little text across adjacent chunks so ideas aren't severed at boundaries. I keep it modest, split on natural boundaries first, and deduplicate near-identical retrieved chunks."