The Distributional Hypothesis › Context Window Size: What Gets Captured
Language AI HandbookAll chapters The Distributional Hypothesis › Context Window Size: What Gets CapturedOne section · Sections in this chapter9 / 16 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
The choice of window size is a model hyperparameter that affects what kind of similarity the system learns. Let's visualize how similarity estimates change as we vary window size.

Semantically related pairs like "cat"/"dog" and "run"/"walk" generally score high across all window sizes because their shared contexts appear at both close and distant offsets. Unrelated pairs like "cat"/"apple" and "run"/"banana" remain low. The window size primarily affects how much overlap accumulates in the middle range, not which pairs are fundamentally similar.
This stability across window sizes in a small corpus is partly due to our corpus design: we deliberately wrote parallel sentences. In real corpora, the relationship between window size and captured similarity type is more pronounced, and choosing the right window size for your task matters.