The useful part, up front

What you’ll take away

  • Chunking determines the unit that is embedded, searched and shown to the reader, so boundaries can separate an answer from the context needed to interpret it [1][3].
  • Fixed-size, sentence-based, structure-based and semantic methods trade predictability, coherence and topical focus differently; none is universally optimal [1][2].
  • Overlap can preserve continuity across boundaries but adds duplication and may crowd out distinct evidence in a fixed top-k [1][3].
  • Chunk size must be chosen jointly with embedding token limits, reader context length, retrieval depth and reranking, and tested on context-dependent questions [1][3].
01

Why split a document before searching it

Imagine a library where every book is one enormous card. To answer a small question, a librarian would have to read the whole book, even if the answer is one paragraph. Retrieval systems work similarly: they search smaller passages, called chunks, so a question can find a relevant piece without carrying an entire document into the answer step [1][2].

Splitting also helps a system stay inside model limits. Embedding and chat models accept only a limited number of tokens, and text that is too long can lose information through truncation [1]. A chunk is therefore a practical unit: small enough to embed and pass to a reader model, but large enough to contain meaning. The same passage may need to satisfy both the embedding model and the reader, so its size cannot be chosen for one model alone [1].

A finer grain can also improve representation. A long page covering many sub-topics may fit a model limit as a single unit, yet its overall meaning is mixed [1]. Dividing it lets each sub-topic be represented separately. That does not guarantee a better answer. It changes what the search can match, what context is preserved, and what irrelevant material may be retrieved alongside the useful passage [1][3].

The main methods choose boundaries from different signals. Fixed-size chunking uses a length budget; structure-based chunking uses headings or markup that group related material [1][2]. The comparison below shows why the choice matters before any search takes place. A length rule gives predictable units but may divide an explanation. A heading can keep a topic together, but a long section still needs a size check. Both approaches need inspection of the chunks they actually produce.

Fixed-size versus structure-based chunking. Length rules and structural boundaries solve different parts of chunking; token fit still needs checking [1][2].
Length rules and structural boundaries solve different parts of chunking; token fit still needs checking [1][2]. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
02

Fixed-size chunks: simple, predictable, and blind to meaning

Fixed-size chunking cuts text after a set number of words, characters or tokens, regardless of what the text is about [1][2]. Think of slicing a long loaf at equal intervals. Every slice is a similar size, which makes storage and limits easy to predict. One described starting point is 200 words or 600 characters, with a small overlap, although that is an example rather than a universal rule [1].

The strength of this method is control. A team can set a repeatable length budget and estimate how many chunks a document will produce. To verify a model's token limit, it must count the actual chunks with the relevant tokenizer; a word or character cap alone does not establish token fit [1][2]. Token-based splitting is especially useful when a language model limit is the binding constraint, while character-based splitting can be more consistent across different kinds of text [2]. Predictability matters when many documents must be processed the same way.

The weakness is blindness to meaning. A cut can fall in the middle of a sentence, a list, or an explanation, separating words that belong together [1][2]. Two chunks may also contain very different amounts of useful information even though their lengths match. Fixed-size chunks are therefore a baseline to test, not evidence that equal length means equal quality [1].

03

Sentence and recursive splitting: following the text's own hierarchy

Text already has natural layers: paragraphs contain sentences, and sentences contain words. Recursive splitting uses that hierarchy. It tries to keep a paragraph together, and only breaks it into sentences if it is too large, then into words if necessary [2][3]. This is like unpacking boxes: open the large box first, and only open smaller boxes when the contents will not fit.

Sentence-based splitting can preserve complete thoughts better than cutting at an arbitrary point [1][2]. A chunk that ends at a sentence boundary is less likely to leave a half-finished idea. Recursive methods still need a maximum size, so a very long paragraph will be divided, but the division follows the structure of the writing instead of ignoring it [2][3].

The trade-off is uneven chunk sizes. Some chunks may be short because a paragraph or section was short, while others approach the limit [3]. That variation is not a defect by itself. It reflects the source. The risk is assuming that a natural boundary always matches the question being asked. A paragraph can be coherent as writing yet still contain several different facts that a search might need to separate [1][2].

Recursive splitting fallback order. Recursive splitting tries larger units first, then smaller units if a unit exceeds the size limit [2][3].
Recursive splitting tries larger units first, then smaller units if a unit exceeds the size limit [2][3]. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
04

Structure-based chunks: headings, markup and logical blocks

Many documents announce their own organisation. Headings divide a report into sections, Markdown marks levels of importance, and code is grouped into functions or classes [1][2]. Structure-based splitting respects those signals. Instead of cutting every 500 characters, it keeps a section together or starts a new chunk at a heading [1][2].

This approach can help retrieval because related ideas are often placed under the same heading [2]. A chunk taken from one section is more likely to discuss one topic than a chunk that crosses several sections. It can also help a reader understand where a passage came from, because the heading provides context that a bare fragment may lack [1][2].

Structure is not always clean. A heading may introduce a very long section, a table may be split across pages, or a document may use formatting inconsistently [1]. A system may therefore combine methods: split at headings first, then divide any section that is still too large [1]. The lesson is to treat structure as evidence about meaning, not as a guarantee that every section is a perfect chunk [1][2].

05

Semantic chunks: grouping by meaning instead of markers

Semantic chunking tries to break text where the meaning changes, rather than where a fixed number of characters ends [1]. Imagine sorting a pile of notes by topic instead of cutting the pile into equal stacks. Sentences about the same idea stay together, and a new chunk begins when the subject shifts. The aim is to preserve context and relationships across sentences and paragraphs [1].

This can produce chunks that read as coherent units, which may help search and answering [1]. A focused chunk may make a sub-topic easier to represent, but whether it is retrieved more reliably must be checked on the actual questions. Semantic coherence and measured retrieval performance are separate considerations [1][3]. Semantic methods can also span page boundaries when a topic continues, instead of forcing a break because a page ended [1].

Semantic does not mean perfect. A chunk can still be too large for a model or too small to answer a question that needs background, and the sources do not describe a universal grouping rule for every document. Semantic chunking should therefore be compared with simpler methods on real questions, not chosen because its name sounds more intelligent [1].

06

Overlap: buying continuity with duplication

Overlap means the end of one chunk is repeated at the start of the next. If a chunk ends in the middle of an explanation, the next chunk begins with some of the same words, so the idea is less likely to be cut in half [1][3]. Think of overlapping roof tiles: each tile covers part of the previous one, leaving no gap where rain could enter.

A small overlap can preserve continuity and context, especially for narrative or conversational text [1]. One recommended starting point is 512 tokens with 25 percent overlap, equal to 128 tokens, described as a way to smooth transitions without excessive duplication [1]. Another tutorial uses overlap of one tenth of the chunk size as an arbitrary starting value to test [3]. These examples show that overlap is a tunable parameter, not a fixed law.

Duplication has costs. Overlapping chunks store and embed repeated text, can return near-duplicate results, and may crowd out different passages in a fixed number of retrieved results [1][3]. Highly structured data may need less overlap, while narrative text may benefit from more [1]. If the overlap is larger than a short chunk, it can even eliminate the intended overlap effect in some implementations, so the actual output should be inspected [1].

Overlap trade-off. Overlap preserves continuity but duplicates content and can crowd retrieved results [1][3].
Overlap preserves continuity but duplicates content and can crowd retrieved results [1][3]. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
07

When a boundary separates the question from its answer

A chunk boundary can separate a question from its answer in a simple way: the words that make a passage understandable end up in different chunks. A heading may name a topic, while the details appear after the cut. A pronoun may refer to something mentioned earlier, or a step may depend on a warning placed just before it [1][3]. The search may find one fragment, but the fragment alone may not contain enough context to answer correctly.

This is why context matters as much as keywords. A chunk containing the word a user asks about may still omit the condition, exception or definition that determines the answer [1]. Larger chunks and overlap can preserve more surrounding context, which helps queries that target specific information but need semantic richness [1]. Structure-based chunks can also help by keeping a heading with its section [1][2].

No boundary strategy removes the risk entirely. Even a well-formed chunk may lack information from another part of the document. A source-grounded answer needs support in the retrieved passages; missing context can leave the reader without enough evidence [3]. The system should retrieve the missing material or acknowledge the limitation instead of guessing an absent qualification. The tutorial instructs its reader to answer from context and decline when that context is insufficient, but an instruction is not a guarantee of model compliance [3]. Test questions whose answers depend on headings, references, lists and exceptions, not only questions matching a single sentence [1][3].

08

Chunk size: the trade between finding more and finding precisely

Chunk size controls a basic trade. Larger chunks can retain background needed to understand an answer [1]. Smaller chunks can focus on one specific idea [1][3]. Neither choice is automatically better, and this design rationale does not guarantee an improvement in measured retrieval. The useful size depends on the documents, the questions and the models involved, so compare the actual results [1].

Recall and precision describe two sides of that trade. Recall asks whether the useful passage is found at all. Precision asks whether the passages returned are actually useful rather than filled with extra material [3]. Very small chunks can miss context and lower recall for questions that need background. Very large chunks can be found, yet bring so much unrelated text that the useful part is harder to identify [1][3].

A hypothetical example makes the trade concrete. Assume, purely for illustration, a 1,000-word guide with one paragraph answering a question and nine paragraphs on other topics. A single large chunk would contain the answer but also nine irrelevant paragraphs. If the alternative uses exactly one paragraph per chunk, those ten chunks would isolate the answer paragraph, but if the question needs a heading from the previous paragraph, the small chunk might lack that context. The example is invented to show the mechanism; it is not a measured result [1][3].

Size and context layers. Chunk size must fit embedding limits and, in aggregate, the reader context budget [1][3].
Chunk size must fit embedding limits and, in aggregate, the reader context budget [1][3]. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
09

Tokens, embeddings and the limits that force a cut

A token is a small piece of text that a model processes. It is not exactly a word or a character, so counting words alone cannot guarantee that a chunk fits a model [1][2]. One model described in the sources accepts up to 8,191 tokens, which is roughly 6,000 words for common models, but that figure belongs to that model and should not be copied to others [1].

Embedding models turn a chunk into numbers that represent its meaning. The search then compares the numbers for a question with the numbers for chunks to find close matches [3]. If a chunk is too long for the embedding model, part of it may be lost. If it is too short, its numbers may represent only a fragment of the idea [1][3]. The chunk must therefore fit the embedding model and still be meaningful.

The reader model has its own limit. Retrieved chunks are combined into a prompt, so several chunks together must fit the reader's context [3]. A system can use small chunks for precise search but still overflow the reader if it retrieves too many of them. Chunk size, number of retrieved chunks and reader limit must be planned together [1][3].

10

Choosing a strategy and testing it on real questions

Start by examining the documents. Note their length, headings, lists, tables and how topics change [1][2]. Measure token counts where possible, because the average and maximum length give evidence for a size limit [1]. Then choose a simple starting strategy, such as recursive splitting that preserves paragraphs and sentences, and record the chunk size and overlap used [2][3]. A starting point is a hypothesis to test, not a final answer.

Build a small set of test questions from the documents, including questions that need a heading, a definition, an exception or steps from more than one paragraph [1][3]. Run the system with different chunk sizes and overlaps, and check whether the correct passage is retrieved and whether the answer uses only that evidence [3]. Compare fixed-size, sentence-based, structure-based and semantic options on the same questions, because a method that works for one document may fail for another [1][2].

Use a checklist before changing a live system. Confirm that chunks fit the embedding and reader limits [1][3]. Inspect actual chunks for split sentences, missing headings and excessive duplication [1]. Check for near-duplicate results in the top retrieved passages [3]. Test structured data separately from narrative text, because the best overlap may differ [1]. Keep the document title or section heading with a chunk when losing it would remove essential context [1]. Finally, change one setting at a time so the effect of chunk size, overlap or top-k can be understood [3].

Choose, inspect and retest the chunks. A practical checklist based on document profiling, model limits and iterative testing guidance [1][2][3].
A practical checklist based on document profiling, model limits and iterative testing guidance [1][2][3]. · Ameer Journal — original explanatory diagramOriginal editorial illustration; no third-party artwork reused.
Follow the evidence

Sources & further reading

Explore the references behind this guide. External pages may change after our review.

  1. Chunk Documents - Azure AI Search | Microsoft Learn
    Microsoft · Accessed 6 Nov 2026
  2. Text splitter integrations - Docs by LangChain
    LangChain · Accessed 6 Nov 2026
  3. Advanced RAG on Hugging Face documentation using LangChain · Hugging Face
    Hugging Face · Accessed 6 Nov 2026

Article updated 6 Nov 2026.

Found something we should revisit?

Good explanations get better with thoughtful feedback.

Suggest a correction