B
pending
The Missing Context Problem in RAG — And Anthropic's Fix
Grounded / Real
Inflated / Uruttu
Original Content
Anthropic wrote about a way to decrease RAG retrieval error rate by 67%.
It’s called Contextual Retrieval and it improves RAG by adding meaningful context to each chunk before embedding and indexing with BM25.
First, for each chunk of your document, a concise explanation of key details is generated. For example—
In a medical study database, a chunk "Patient A showed symptoms of fatigue" becomes -- "In a 2022 clinical trial, Patient A (Group 1, receiving Drug X) showed symptoms of fatigue."
These details situate every single chunk within the whole document.
While creating the vectordb, embeddings are calculated on these contextualised chunks.
Then, BM25 is also applied to capture exact keyword matches.
BM25 is a ranking function that improves text retrieval by measuring word relevance using TF-IDF while also accounting for doct length and saturation effects.
At query time, both methods are used to retrieve relevant chunks, which are ranked, deduplicated, reranked and passed to the model.
Contextual Retrieval reduces retrieval failures by 49%, and combining it with reranking boosts the reduction to 67%.
♻️ Share it with anyone who works with production-ready RAG pipelines :)
P.S. Liten AI writes for you on any website – emails, forms, DMs, Liten takes care of it all.
Try a 10-sec online demo here: https://www.liten.tech/
Link to the full article: https://lnkd.in/gubfPfvN
#AI #LLMs #RAG
Validated Content
This post is largely accurate and closely follows Anthropic's own published research (September 2024, "Contextual Retrieval").
Confirmed accurate:
- The 49% and 67% figures are correct — Anthropic's own benchmarks reported that combining Contextual Embeddings + Contextual BM25 reduced the top-20-chunk retrieval failure rate by 49% (from 5.7% to 2.9%), and adding a reranker on top pushed the reduction to 67% (from 5.7% to 1.9%). This is confirmed across numerous independent sources summarizing the original Anthropic post.
- The core mechanism is described accurately: for each chunk, a short contextualizing explanation is generated (situating it within the whole document) before embedding — this matches Anthropic's actual method and even their own published prompt template.
- BM25's role and definition — used alongside embeddings, based on TF-IDF-style term weighting with adjustments for document length and term-frequency saturation — is an accurate, standard description of BM25.
- The retrieval → rank → deduplicate → rerank → pass-to-model pipeline matches Anthropic's described architecture.
- The example (patient chunk vs. contextualized chunk) is not a verbatim quote from Anthropic's post but is a reasonable illustrative example consistent with how the technique works.
Worth noting as caveats (not stated in the post, but relevant):
- The 35% figure (contextual embeddings alone, without BM25) is the intermediate step Anthropic also reported — the post skips straight to the "hybrid" 49% number, which is fine but omits that context.
- Some independent commentators have pushed back on how generalizable the 67% headline figure is — noting it's an average across specific domains (codebases, fiction, research papers) and that results varied significantly by domain, so real-world gains may differ from the benchmark average. The post presents 67% as a flat, universal number without that nuance.
- This is genuinely an Anthropic-published technique (not third-party research about Anthropic) — so calling it something "Anthropic wrote about" is accurate framing.
Unrelated add-on: The "Liten AI" plug at the end is a separate, unverified product mention with no bearing on the RAG content.
Verdict: This is one of the more accurate posts I've checked — the technical claims closely track Anthropic's actual published results, with only minor omissions of nuance (domain variability, the 35% intermediate step) rather than factual errors.