Evidence label: deterministic synthetic model. This page runs a small JavaScript model of a chunking and retrieval pipeline. It generates documents whose sentences carry a product (entity) vector, a shared section-type vector and a fact vector, drops the entity from sentences that refer back with a pronoun, and generates questions that name the product and target one to three consecutive sentences. Chunks are embedded by token-weighted mean pooling and ranked by cosine similarity. Nothing here calls a real embedding model; all numbers are calculated estimates for building intuition.
Play the lab
How to play
Choose a chunker, then move the chunk size, overlap and top-k sliders. The semantic threshold only affects the semantic chunker; the late chunking toggle applies to all three. Each change re-chunks and re-embeds the same corpus and re-runs the same questions, so differences come from your change. Watch recall and context tokens together, and use the recall-per-1k-tokens tile as a tie-breaker. Inject events to stress a configuration: pronoun-heavy documents, multi-sentence answers or boilerplate in every paragraph.
Missions unlock in order. Load each mission setup, fix it, and earn more stars by meeting the goal with fewer context tokens. Use New random seed to check that a winning configuration is not a fluke of one corpus.
What the model assumes
Documents have 3 to 5 sections of 2 to 4 paragraphs, each paragraph 2 to 5 sentences of 12 to 32 tokens. Sections come from six shared types, and products come from four families, so documents genuinely compete with each other. A question is answerable when the union of retrieved chunks covers its whole span. Late chunking is modelled as restoring the product and section context to every token before pooling, which is the effect long-context token embeddings aim for; standalone chunk embeddings get no such help.
What it cannot tell you
Real embeddings, real text and real questions are messier: sentence boundaries are ambiguous, PDFs lose structure, tables and code need their own rules, and the LLM's ability to use a long context is not modelled at all. The lab also does not penalise large chunks for diluted embeddings, which real systems do. Use it to understand the shape of the trade-offs, then measure on your own span-labelled questions.
Read the full explanation
- Chunking Strategies Compared: Fixed, Recursive, Semantic and Late Chunking (companion article)
- HNSW Tuning for RAG: M, efSearch and the Recall Versus Latency Trade
- Lost in the Middle: Ordering and Packing Retrieved Context for Long Prompts
All AI in Production labs · Lab catalog
- Late Chunking: Contextual Chunk Embeddings Using Long-Context Embedding Models (Günther et al., 2024)
- Is Semantic Chunking Worth the Computational Cost? (Qu, Bao and Tu, 2024)
- Lost in the Middle: How Language Models Use Long Contexts (Liu et al., TACL 2024)
- LangChain documentation: text splitters
- Anthropic: Introducing Contextual Retrieval
Views are my own and do not represent any employer, past or present.