[negative result] Contextual chunking cost 2.4× storage and did not clear the band #37
Replies: 3 comments 4 replies
Strong write-up, but I think the headline overstates what was tested. You say contextual chunking "did not clear the band" — what you tested was a template that concatenates metadata you already had in the chunk. The Anthropic recipe generates a situating sentence with a model, using the full parent document as context. That is a different operation. Your section 2 acknowledges this, and then the title does not. I do not think the result is wrong. I think it is scoped much more narrowly than the framing suggests. |
On the cost side — is 2.4× storage actually a decision-grade number? Storage is the cheapest thing in the stack. On S3 that is fractions of a cent per GB-month. It feels like the write-up is treating a rounding error as the deciding factor. |
Adding the thing the write-up does that I want everyone to copy, since it is easy to miss under the result. The last section says:
That sentence is the most valuable thing on this page. It is a pre-registration failure caught and reported by the person who committed it. The recall column going the other way would have made storage feel like a detail; storage was only decisive because the result was already negative. The fix is procedural and it is now in the PR template: name the columns that can veto a change before you run it. If storage can veto, it can veto in both directions. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What I tried
Contextual chunking — the Anthropic recipe. Prepend a generated sentence situating each chunk
in its parent document, then embed and BM25-index the augmented chunk. Notebook 01 introduces
it; I wanted to know whether to make it the default.
The result
Worse on both quality metrics, at 2.4× the storage and a per-reindex compute bill.
Why I think it did not help here
Two reasons, and I think the first is the real one.
1 · Our chunks do not lose their referent. Structural chunking already carries the document
title and the heading path into every chunk, so a chunk reading "Engineering will widen the
interval" already says which product and which incident it belongs to. Contextual chunking is a
fix for chunks that have been orphaned from their context — and ours have not been.
2 · The offline
describe()is a template, not a model. It adds source, date and entitynames, most of which are already in the chunk. With a real model generating a genuinely
situating sentence the result would likely differ, and I have not tested that.
What I would tell a client
Contextual chunking is a real technique with a reported 49% reduction in failed retrievals on
Anthropic's corpus. It is a fix for a specific failure — chunks that are unretrievable in
isolation — and you should confirm you have that failure before paying for it.
The diagnostic is cheap: sample 20 chunks, read them cold, and ask whether you could tell what
they are about. If you can, your chunking is already carrying context and this will not help.
What this cost me
About three hours, and it is the submission I am most pleased with. The storage column is what
made the decision, and I would not have looked at it if the recall column had gone the other
way — which is itself worth knowing about myself.
All reactions