Category · Data and retrieval-augmented generation
What is semantic chunking?
Semantic chunking means splitting a document into passages by meaning, by section or by change of topic, rather than at a fixed size. That way, each retrieved passage forms a coherent whole, with no idea cut in two.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- Documents are most often split along their structure, headings and paragraphs, with a slight overlap between neighbouring passages so that no idea is cut in two.
- Passage size is a compromise; too small, it loses its context, too large, it dilutes the information and costs more tokens on every answer.
- The effect of a chunking strategy is measured on retrieval recall, with the same questions, rather than chosen by intuition.
The trap to avoid
The trap is the orphan passage, which no longer makes sense outside its document, such as a line that only says the deadline is thirty days.
Related terms
- EmbeddingData and retrieval-augmented generation
- Vector databasesData and retrieval-augmented generation
- RAG (retrieval-augmented generation)Data and retrieval-augmented generation
Where this is taught
This idea comes up throughout the lessons; we work on it with your own examples during a lesson.
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.