Chunk Size and Overlap
In this article
- Predict how chunk size and chunk overlap change the number of chunks and the tokens the top 3 hands to the model.
- Explain why a small chunk can miss part of the evidence and a large chunk can bury it.
- Explain why overlap protects a cut but can fill the top 3 with repeated text.
- Choose a size and an overlap by reading what the top 3 returns for real questions, and treat a library default as a first setting to test.
Overview
Before your documents can be searched, you have to pick two numbers: how long each piece is, and how much of each piece repeats the end of the one before it. A teammate says "500 and 50, that is what everyone uses". Pieces that are too short and pieces that are too long both cost you, in different ways, and a number copied from elsewhere cannot tell you which.
Brightline, a made-up home-internet provider, runs a support assistant that answers from help pages, router manuals and a 120-page staff handbook, and those documents are cut into chunks before they can be searched. For each question, the search returns the 3 closest chunks.
After this you can predict what a size and an overlap do to the index and to the text the model reads, check whether an answer arrived whole, and treat any quoted default as a first setting to try.
Sign in to keep reading
The rest of this article opens with an account. An account also keeps your progress and quiz results on every device, and lets you follow news for up to five topics.
Still to read in this article
- Two dials on one handbook
- What the top 3 holds
- The cut and its copy
- What every chunk costs
- Picking the setting
- Sources
- Check yourself, 13 questions