Concept guide · RAG foundations
What are fixed-size and semantic chunking?
A slower explanation for when the short interview answer is not enough. Start with the intuition, then connect it to the technical idea and the way an interviewer expects you to reason about it.
ML area
Generative AI → Fixed-size and semantic chunking
Interview format
Core · Concept
Question
GENAI-051
Start with the idea
In simple terms
Fixed-size chunking is predictable and easy to operate. Semantic or structure-aware chunking tries to keep one coherent idea together. Many systems use structure first and a hard size limit second.
Make it concrete
Split a handbook by headings and paragraphs, but divide an unusually long section at sentence boundaries so no chunk exceeds the model or index budget.
Build the answer
How to reason about it
- 1Use structure when it is reliable and a hard limit when it is not.
- 2Keep boundaries aligned with meaning, not only a character count.
- 3Version the strategy so re-indexing changes can be evaluated.
Go one level deeper
The technical explanation
Fixed-size splits make indexing and capacity planning simple, but character boundaries can cut through definitions, code, or tables. Semantic splitting can improve coherence but depends on parsers, thresholds, and document quality. A robust pipeline records the splitter version and creates regression cases for headings, lists, tables, code, and cross-page sections.
Say this in the interview
Fixed-size chunking splits by token or character limits and is simple and predictable. Semantic or structure-aware chunking uses headings, paragraphs, topic shifts, or document elements to keep coherent units. A hybrid approach often works best, with hard limits to prevent pathological chunks.
Keep preparing