AI / LlamaIndex Interview Questions
Why is chunk size important in LlamaIndex?
Chunk size determines how large each Node is when a Document is split, and it directly shapes both retrieval quality and cost, so getting it wrong in either direction hurts the pipeline.
Chunks that are too large tend to mix multiple topics together, which dilutes the embedding, making it a fuzzy average that doesn't match any single topic well, and it also wastes context window space with irrelevant text once retrieved. Chunks that are too small lose surrounding context, so a Node might contain a sentence fragment that's technically similar to the query but meaningless without its neighbors, and you also end up with far more Nodes to embed and store, raising cost.
There's no universal correct value; it depends on document structure and query style, which is why LlamaIndex exposes chunk_size and chunk_overlap as tunable parameters, and why techniques like sentence-window or auto-merging retrieval exist specifically to sidestep the fixed-size trade-off.
More Related questions...