RAG Chunking Strategies Tested: Fixed vs Recursive vs Semantic Chunking

Illustration comparing fixed-size, recursive, and semantic RAG chunking strategies

RAG Chunking Strategies decide what your retriever is allowed to find. If a useful answer is split across two chunks, buried inside a large mixed-topic chunk, or detached from the heading that gives it meaning, a better prompt will not repair the damage. The failure happened before the model saw the question. Choosing the right RAG Chunking Strategies can improve retrieval quality before you change your embedding model or prompt.

This guide compares fixed-size, recursive, and semantic chunking through document boundaries, current framework guidance, and published benchmarks rather than theoretical pros and cons.

The result is less neat than “semantic is best.” One public benchmark favored fixed 512-token chunks, while a clinical study found an adaptive method substantially beat a fixed baseline. The useful question is not “Which chunker wins?” but “Which one preserves the evidence my queries need?”

Quick answer: which RAG Chunking Strategies should you start with?

For most text-heavy RAG systems, start with recursive chunking at roughly 256–512 tokens with modest overlap, then benchmark it against a fixed-size baseline. Move to semantic chunking only when your documents have weak structure, frequent topic shifts, or measured retrieval failures that structure-aware splitting does not solve.

Use fixed-size chunking when you need a cheap, deterministic baseline.

Use recursive chunking when your content has paragraphs, headings, lists, or other natural separators.

Use semantic chunking when meaning changes do not line up with formatting and the extra ingestion cost is justified.

That recommendation is deliberately conservative. LangChain currently describes its RecursiveCharacterTextSplitter as the recommended splitter for generic text and tries separators such as double newlines, newlines, spaces, and finally individual characters. Pinecone also recommends beginning with simple chunking and iterating only when your evaluation shows it is insufficient.

Why RAG Chunking Strategies change retrieval quality

A RAG pipeline does not retrieve “the document.” It retrieves the units you created during indexing. Those units become the candidates your vector search, BM25 search, hybrid retriever, or reranker can return.

That creates a precision-versus-context trade-off.

A very small chunk can embed one idea cleanly, but it may omit the definition, exception, or previous sentence needed to answer correctly. A very large chunk may preserve the whole explanation, but its embedding represents several ideas at once. The query then has to match an averaged representation rather than a focused passage.

The boundary itself matters too.

In an earlier GenAI Trail retrieval test, fixed-size chunking split a code block in 64% of tested boundary alignments and split a table in 44%. The retriever could still find those fragments because they contained the right terms, yet the returned context was incomplete. That is a particularly nasty RAG failure: retrieval looks successful in logs while the answer is still missing the evidence it needs.

This is why chunking should be evaluated before prompt engineering. If the source passage is damaged during indexing, no system prompt can reconstruct the missing half reliably.

Test setup: what I compare

A useful comparison needs to keep the rest of the pipeline stable. Change the chunker, not the embedding model, top-k value, reranker, metadata filters, and generation prompt at the same time.

For each strategy, I care about five things: boundary integrity: Are sentences, code, tables, and sections preserved? Retrieval recall: Does top-k contain the required evidence? Context precision: How much retrieved material is actually useful? Index cost: How many chunks and repeated tokens are created? Operational complexity: Does splitting add model calls or tuning?

That framework prevents a common mistake: declaring a strategy “better” because the final answer sounded nicer once. One good answer is not a benchmark.

One more rule matters in production: log chunk IDs, source headings, token counts, and retrieval scores for failed queries. Without that trace, a chunking problem can look identical to a ranking, prompting, or model failure.

RAG Chunking Strategies #1: Fixed-size chunking

Of the basic RAG Chunking Strategies, fixed-size chunking is the simplest: it divides text after a chosen number of characters, words, or tokens. A configuration might use 512-token chunks with 50–100 tokens of overlap.

Its biggest strength is reproducibility. The same input with the same tokenizer produces predictable chunk sizes. That makes fixed chunking excellent for establishing a baseline, estimating index size, and debugging cost.

It is also fast. There is no semantic model involved in deciding where a boundary belongs.

The problem is that the splitter knows nothing about the document.

Imagine a policy paragraph that says refunds are available within 30 days, followed by a sentence saying digital goods are excluded. If the boundary lands between those sentences, one chunk can retrieve perfectly for “refund window” while losing the condition that changes the answer.

Overlap reduces this risk by repeating text across adjacent chunks, but it also grows the index and can increase near-duplicate retrieval.

Where fixed chunking performed better than expected

A public 2026 RAG chunking benchmark tested fixed 256, 512, and 1024-token chunks alongside recursive, semantic, and hybrid approaches on an Apple annual report and a dense strategy book. Fixed 512 achieved the highest reported composite score at 0.8775, narrowly ahead of fixed 1024 at 0.8726 and semantic at 0.8686.

That result should not be treated as a universal ranking. It is one corpus and one evaluation design. But it is a useful warning against assuming a more sophisticated chunker automatically produces better retrieval.

Fixed-size chunking is therefore not “the beginner option.” It is the control group every serious RAG experiment should keep.

RAG Chunking Strategies #2: Recursive chunking

Among practical RAG Chunking Strategies, recursive chunking adds structure without adding an embedding call to the splitting step.

Instead of cutting every N tokens blindly, the splitter tries preferred separators in order. LangChain starts with larger boundaries such as paragraphs, then falls back to smaller units when a section remains too large.

That makes recursive chunking a strong default for Markdown documentation, articles, knowledge-base pages, support content, and research prose with reasonable formatting.

Consider a 900-token section with four paragraphs. A fixed 512-token splitter may cut inside paragraph three. A recursive splitter can keep paragraphs one and two together, then create another chunk from paragraphs three and four, depending on the configured size.

The chunks are still bounded. They are simply less arbitrary.

The recursive chunking failure people miss

Recursive chunking only respects structure that exists.

Transcripts, OCR output, and legal text can change topic without reliable headings or paragraph breaks. In those cases, the recursive splitter has no high-quality separator to exploit.

Language matters as well. LangChain’s documentation specifically notes that languages without standard whitespace word boundaries may need punctuation-aware separator lists to avoid unnatural splits.

Recursive chunking gives you better boundaries, not automatic understanding.

LangChain provides RecursiveCharacterTextSplitter for splitting documents using ordered separators and size constraints. For implementation details and current examples, see the official LangChain text splitter documentation.

https://docs.langchain.com/oss/python/integrations/splitters/recursive_text_splitter

RAG Chunking Strategies #3: Semantic chunking

Semantic chunking is the meaning-aware option among RAG Chunking Strategies: it tries to detect a change in meaning rather than a change in formatting.

A typical pipeline embeds neighboring sentences or sentence groups and inserts a breakpoint when dissimilarity crosses a threshold. LlamaIndex’s SemanticSplitterNodeParser exposes a breakpoint percentile threshold that controls how aggressively chunks are created.

LlamaIndex provides SemanticSplitterNodeParser, which groups semantically related sentences and uses embedding similarity to determine chunk boundaries.

https://developers.llamaindex.ai/python/framework-api-reference/node_parsers/semantic_splitter/?trk=public_post_comment-text&utm

LlamaIndex’s current documentation confirms that the semantic splitter uses an embedding model and a breakpoint threshold to decide when a new semantic node should begin.

This produces variable-size chunks.

If several sentences develop one idea, semantic chunking can keep them together. If the topic changes sharply, the chunk can end early instead of being padded to a fixed size.

That sounds ideal, but it introduces two practical problems.

First, ingestion becomes more expensive because splitting itself needs embeddings or another semantic model. Second, the breakpoint threshold becomes a new tuning parameter. Too sensitive, and the system creates many tiny chunks. Too permissive, and unrelated ideas remain merged.

Semantic chunking is not automatically more accurate

The public benchmark mentioned earlier reported semantic chunking with the highest faithfulness among the three main approaches discussed here, but lower context precision than fixed 512 in that test.

A separate clinical RAG study reached a different conclusion. Researchers comparing a fixed baseline with semantic, proposition, and adaptive methods on postoperative rhinoplasty questions found the adaptive strategy substantially improved both answer accuracy and retrieval metrics over the fixed baseline.

These results reflect different corpora. RAG Chunking Strategies interact with document structure, query type, embedding behavior, and how “relevant context” is defined.

That is exactly why copying a chunk size from a tutorial is risky.

RAG Chunking Strategies compared: fixed vs recursive vs semantic

StrategySplitting signalIngestion costChunk consistencyMain advantageMain failure mode
Fixed-sizeToken/character countLowestHighFast, deterministic baselineCuts through semantic or structural units
RecursiveOrdered structural separatorsLowMedium-highPreserves paragraphs and sections cheaplyCannot detect topic shifts inside weak structure
SemanticEmbedding similarity / meaningHighestVariablePreserves topic coherenceExtra cost, threshold tuning, uneven chunk sizes

If your corpus is mostly clean Markdown, recursive chunking often gives most of the structural benefit without semantic preprocessing.

Chunk size and splitting method should be tested against your own dataset because there is no universal chunking strategy for every RAG application. Weaviate’s RAG documentation discusses both semantic-marker and text-length approaches.

https://docs.weaviate.io/weaviate/starter-guides/generative

Weaviate likewise states that there is no one-size-fits-all RAG chunking strategy.

If your corpus is conversational or poorly formatted, semantic chunking has a stronger reason to exist.

If your system changes documents constantly and re-indexes all day, fixed or recursive splitting may win simply because semantic preprocessing adds cost every time content changes.

How chunk size changes RAG Chunking Strategies

There is no universal best chunk size.

A useful starting sweep is 256, 512, and 1024 tokens, with overlap tested separately. Smaller chunks suit focused lookup; larger chunks can preserve multi-sentence procedures and explanations.

Do not optimize only Recall@k.

A 1024-token chunk can score as a retrieval hit because it contains the answer somewhere, while also wasting most of the context window on irrelevant text. Pair recall with context precision or token efficiency.

Also keep the context budget comparable. Retrieving five 1,000-token chunks is not the same experiment as retrieving five 200-token chunks. The first system is allowed to send roughly five times as much evidence to the model.

My preferred test is: fix a maximum retrieved-token budget, then see which strategy puts the highest proportion of answer-supporting text inside it.

How overlap affects RAG Chunking Strategies

Overlap is insurance against boundary loss, not a quality setting that should automatically be increased.

For a 512-token chunk, 50–100 tokens is a reasonable test baseline. Weaviate’s current guide uses the same range, but your evaluation should decide whether overlap helps.

Watch for duplicates.

If overlapping chunks both rank in the top five, repeated context can push out another useful result. The earlier GenAI Trail benchmark already showed how near-duplicates consume top-k slots.

If you increase overlap, add deduplication or diversity checks to retrieval.

A better production pattern for RAG Chunking Strategies

The three-way comparison is useful, but real production systems do not have to choose one splitter for every file type.

For HTML or Markdown, split by headings first and preserve the heading path as metadata. Then apply recursive size limits inside oversized sections. LangChain documents this pattern directly for Markdown and HTML splitting.

For code, respect functions, classes, and code fences before token limits.

For tables, keep the header with the rows it describes. Repeating a compact header is often less damaging than separating numeric values from their labels.

For transcripts, semantic boundaries may be worth the preprocessing cost because formatting provides weak signals.

For long documents, consider parent-child retrieval: embed small child chunks for precise matching, but return a larger parent section to the generator after a child matches.

This hybrid mindset is more robust than forcing one global number across PDFs, docs, code, and support tickets.

RAG Chunking Strategies evaluation checklist

Before changing your splitter, build a small labelled evaluation set from real user questions. Thirty to fifty questions can already expose major regressions, although detecting small improvements requires more data. Your existing GenAI Trail RAG benchmark uses the same measurement-first approach.

Track:

  • Recall@3, Recall@5, or the k that fits your product.
  • Mean reciprocal rank for the first useful chunk.
  • Context precision or relevant-token ratio.
  • Average retrieved tokens per query.
  • Number of chunks produced during indexing.
  • Embedding and preprocessing cost.
  • Boundary failures: split tables, code, lists, clauses, or definitions.
  • Final-answer faithfulness and citation correctness.
RAG chunking evaluation checklist and retrieval quality metrics

Then inspect the failures manually.

The most valuable row in your spreadsheet is often not the average score. It is the query where one strategy fails completely and another returns a clean, self-contained answer.

Which RAG Chunking Strategies should you choose?

Choose fixed-size chunking when you are building the baseline, your text is uniform, or ingestion speed matters more than perfect boundaries.

Choose recursive chunking when your documents have reliable structure and you want a low-cost production default. This is where I would begin for most documentation and article corpora.

Choose semantic chunking when measured failures come from topic boundaries that formatting cannot express, especially in transcripts, dense narrative text, or weakly structured documents.

Do not upgrade from fixed to semantic because semantic sounds smarter. Upgrade because your eval set shows a failure mode and semantic splitting fixes it at an acceptable cost.

Implementation examples

A minimal recursive splitter in LangChain looks like this:

from langchain_text_splitters import RecursiveCharacterTextSplitter

splitter = RecursiveCharacterTextSplitter(
    chunk_size=512,
    chunk_overlap=64,
    separators=["\n\n", "\n", " ", ""],
)

chunks = splitter.split_text(text)

For semantic chunking, LlamaIndex exposes a sentence-based semantic splitter:

from llama_index.core.node_parser import SemanticSplitterNodeParser

splitter = SemanticSplitterNodeParser.from_defaults(
    embed_model=embed_model,
    buffer_size=1,
    breakpoint_percentile_threshold=95,
)

nodes = splitter.get_nodes_from_documents(documents)

Treat those settings as experiment starting points, not production truths. The tokenizer, embedding model, language, content type, and user questions all change the result.

Example workflow for implementing and testing RAG chunking strategies

Three mistakes that make RAG Chunking Strategies tests useless

The first is changing the retriever at the same time. If you switch from fixed to semantic chunking and also add a reranker, you cannot tell which change improved recall.

The second is evaluating only final answers. A stronger LLM can sometimes hide a retrieval defect by guessing from its pretrained knowledge. Score the retrieved evidence separately.

The third is tuning against the same questions you use to report results. Keep a held-out set. Otherwise you are optimizing your splitter to a test rather than to future traffic.

FAQ

Is semantic chunking better than recursive chunking?

Not universally. Semantic chunking can preserve topic coherence when structure is weak, but it costs more during ingestion and requires threshold tuning. Recursive chunking is cheaper and often strong on well-structured documents. Test both on your own queries.

Is 512 tokens the best chunk size for RAG?

No. It is a useful baseline because several practical guides and benchmarks test around that size, but there is no universal optimum. Your corpus and query distribution should decide.

Does chunk overlap improve RAG accuracy?

It can reduce boundary loss, but excessive overlap duplicates indexed text and may crowd top-k retrieval with similar chunks. Measure overlap as its own parameter.

Can I use different RAG Chunking Strategies in one knowledge base?

Yes. In many systems that is preferable. Markdown can use heading-aware recursive splitting, code can use syntax-aware splitting, and transcripts can use semantic chunking while sharing the same retrieval layer.

What should I measure first?

Start with retrieval recall and manual inspection of the returned chunks. If the correct evidence is missing, fix indexing or retrieval before spending time on prompt tuning.

Final takeaway

RAG Chunking Strategies shape the evidence your system can retrieve. Fixed-size chunking establishes the baseline, recursive chunking preserves structure cheaply, and semantic chunking can help when messy formatting hides topic boundaries.

The important lesson from the benchmarks is not that one method won. It is that different corpora produce different winners.

Start simple. Preserve structure. Measure retrieval before generation. Keep a fixed baseline even after you move to a smarter splitter. And when a RAG answer is wrong, inspect the chunk that reached the model before blaming the model itself.