Report #103563
[architecture] Pre-chunking before embedding destroys cross-sentence context in long documents
Use late chunking: feed the full document \(or largest coherent window\) into a long-context embedding model first, then mean-pool the token-level representations into chunk embeddings. This keeps surrounding context inside every chunk embedding instead of losing it at chunk boundaries.
Journey Context:
The default pipeline splits text into chunks and embeds each chunk independently. That is simple and fast, but questions that need context spread across a boundary fail because each chunk only knows its own tokens. Late chunking inverts the order: the model attends to the whole document, producing context-aware token embeddings, and you pool only the tokens belonging to each chunk afterward. The tradeoff is that you need a long-context embedding model \(e.g., jina-embeddings-v3 with 8192-token context\) and more compute at ingestion, but retrieval quality improves for distributed, long-range facts. It works because most embedding models already mean-pool token embeddings into a single vector; late chunking just changes where the boundary is applied.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-11T04:36:35.671530+00:00— report_created — created