Semantic chunking for RAG with a test for missing qualifiers
Sources checked 3 min read · By the Eval Suites editors
In brief
Test semantic chunking on questions whose answers cross a likely split. Use the same source documents and tag the exact spans that answer each question. Compare whether each chunker delivers all of those spans within the same context budget, then check the resulting answer.
What semantic chunking changes
Semantic chunking groups text by meaning. A breakpoint-based chunker compares neighboring sentence embeddings and starts a new chunk when their similarity drops below a threshold. A chunker that splits on headings uses document structure, while a fixed-size chunker splits at a configured length. Keep these methods distinct when you record the test configuration.[1]
A more coherent chunk can still drop a qualifier. Qu, Tu and Bao compared semantic and fixed-size chunking across document retrieval, evidence retrieval and retrieval-based answer generation. The semantic variants in their study failed to deliver consistent gains that justified the added computation. Their result gives you a reason to keep a simple baseline and measure your own corpus.[1]
Build a test around an exception at the boundary
Use this fictional Orchard Arts room policy, with one source document and three labeled lines. Line A says room reservations can be canceled up to 48 hours before the booking. Line B says workshop bookings are exempt from that rule. Line C says workshops must be canceled at least seven days ahead. The fixture asks whether a workshop that starts in three days can be canceled. The expected answer is no, with the seven-day deadline.
| Text sent to the generator | Required evidence present | What the evidence permits |
|---|---|---|
| Only line A | 0 of 2 required lines | The general rule gives no answer about the workshop. |
| Lines A and B | 1 of 2 required lines | The general rule does not apply. The workshop deadline is missing. |
| Lines B and C in one chunk or two | 2 of 2 required lines | The workshop requires seven days of notice. Three days is too late. |
The rows show expected scoring for deliberately chosen deliveries. To test a chunker, run your actual retriever and save what arrives after packing or truncation. If lines B and C both arrive in separate chunks, count both. If overlap copies B into two chunks, count B once. Chroma's chunking study uses token-level relevance so it can compare results when chunk boundaries change.[2]
Compare chunkers with the same evidence and token budget
- Freeze the source text and identify the required evidence by document ID and source span. Include single-span questions, questions that depend on a qualifier, and questions that require more than one passage.
- Build separate indexes from the same corpus. Keep the embedding model, search configuration and answer prompt fixed. Record the split rule, target size, overlap and embedding work for each index.
- Run the same questions against both indexes. Set the same final context token budget for both because an equal chunk count can represent different amounts of text. Record the actual input sent to the generator.
- For each pair, mark whether every required span reached the generator and whether the answer used it correctly. Inspect cases that change result before comparing averages.
If the candidate still misses line C, inspect the source spans on the retrieved chunks. A chunk with C may exist and simply rank too low. If the chunks reach the generator and the answer still applies the 48-hour rule, keep the same retrieval and inspect answer generation. If the change recovers qualifiers but increases indexing work, report both results and check whether the improvement is concentrated in a document type where boundary errors matter.
After choosing the chunker, use the retrieval and answer quality checklist.
Related suites
Related reading
Sources
- 1. Is Semantic Chunking Worth the Computational Cost? · Findings of NAACL 2025 · Paper · Sources checked
- 2. Evaluating Chunking Strategies for Retrieval · Chroma Research · Paper · Sources checked