Semantic chunking embeds sentences, measures how similar neighbours are, and cuts where similarity drops, which signals a topic change. It costs more than fixed-size splitting because every sentence needs an embedding, so check that the extra cost buys better cuts on your documents before you adopt it.
Before you start
An embedding model you can call on single sentences, and a document with at least three clear topic changes.
Embed the sentences one by one
Split the document into sentences and embed each one separately. Keep the sentence order, because the method only compares neighbours, not the whole document at once.
Use the same embedding model you use for retrieval. A different model gives different similarity scores and the test would not match production.
Find the similarity drops
Compute the cosine similarity between each pair of neighbouring sentences and list the five lowest scores. Read the sentences around each low score: a real topic change should sit there, for example a jump from pricing to warranty terms.
If the lowest scores sit inside one topic, the method is reacting to wording changes, not topic changes, and it will cut in the wrong places.
Compare with fixed-size cuts
Chunk the same document with a fixed-size splitter and count how many of the five real topic boundaries each method respects. Semantic chunking should win clearly to justify its cost.
If both methods respect the same boundaries, keep the cheaper fixed-size method.
Practice check: fictional Maple Corner guide, 3 topics
The table below is fictional practice material, worked out by hand from the stated similarity scores. It is the expected result for the practice document, not a run of any embedding model.
| Boundary | Similarity | Real topic change | Verdict |
|---|---|---|---|
| Pricing to warranty | 0.31 | Yes | Cut – correct |
| Warranty to returns | 0.38 | Yes | Cut – correct |
| Returns to shipping | 0.42 | Yes | Cut – correct |
| Inside shipping section | 0.55 | No | No cut – correct |
| Inside pricing section | 0.61 | No | No cut – correct |
All three real topic changes score below 0.45 and all same-topic pairs score above 0.5, so a threshold near 0.5 separates them cleanly on this document.
Expected result. UNTESTED: the similarity scores in the practice table are worked out by hand, not measured by running an embedding model. Embed your own sentences, list the five lowest neighbour scores, and read the sentences around them before you trust the cuts.
Limits
- Semantic chunking needs an embedding call per sentence, which adds cost and time to indexing.
- Similarity thresholds do not transfer between documents: set the threshold on your own text, not on a published example.
