A 20,000-token document is sliced into overlapping chunks and laid out along the glowing spiral in reading order. Each new query hides a handful of "needle" chunks — ground truth relevant passages, marked with a gold ring — among decoys with random similarity scores. Chunks are ranked by simulated embedding similarity and the top-K highest-scoring ones pop outward and light up as they enter the model's context window.
stride = chunk_size × (1 − overlap)
num_chunks = ceil(doc_tokens / stride)
context_used = K × chunk_size
recall@K = |needles ∩ top-K| / |needles|
- Chunk size — tokens per chunk; smaller chunks are more precise but multiply the chunk count and retrieval overhead.
- Chunk overlap — shared tokens between neighbouring chunks, which protects facts that straddle a boundary at the cost of redundant tokens.
- Top-K retrieved — how many ranked chunks are actually sent into the model's context window for this query.
If context usage passes the model's context limit the readout turns red — a reminder that raising K or chunk size both trade recall for cost and overflow risk.