Hugging Face, End to EndLesson 52 of 75

Module 6 · Embeddings, and search that understands

Chunking decides what your search can find

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 5 of 9 in this chapter

This chapter’s goalBuild and measure a semantic search over your own documents: choosing an embedding model against your language and text length, chunking deliberately, normalising vectors for the similarity you use, adding a cross-encoder reranker, and reporting recall@k on questions you wrote yourself.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch2:08Not available
Full audiobookNot availableNot available
Recall against chunk size, for two kinds of question0501001001200chunk size in tokensrecall at five, per cent—— One fact, inside one paragraph– – An answer spanning two sectionsOne corpus, one embedding model, thirty questions, and chunk size the only thing changed. The peak isin a different place for the two kinds of question, which is the argument for retrieving small chunksand passing their parent sections to the model rather than picking one size for everything.
One corpus, one embedding model, thirty questions, and chunk size the only thing changed. The peak is in a different place for the two kinds of question, which is the argument for retrieving small chunks and passing their parent sections to the model rather than picking one size for everything.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

Why a whole document is the wrong unit

Embed a 40-page manual into one 768-number vector and you get the average of everything in it. A query about one specific procedure matches weakly, because that procedure is one fortieth of what the vector describes. Meanwhile the model truncated at 512 tokens anyway, so thirty-nine of those pages were never read.

Chunking splits documents into pieces small enough to be about one thing. It is the step that decides what your system can find, and it is almost always the highest-leverage thing to change when retrieval is disappointing, more so than swapping the model.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Image Generation, in Practice exam.

Stuck on something?Ask Arjun, your AI tutor

How to cite: Addaly (2026) ‘Chunking decides what your search can find’, in Hugging Face, End to End. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/hugging-face/chunking-text-for-retrieval (Accessed: 29 November 2026).