EasyDeepLearn

What are 'contextual embeddings' and why are they useful?

hard

Answer

  • Anthropic's Contextual Retrieval (2024): before embedding a chunk, prepend a short LLM-generated context that situates the chunk within its parent document ('This chunk is from a Q3 2024 earnings report, discussing revenue growth in EMEA').
  • Embed the contextualized chunk.
  • Solves the 'orphan chunk' problem where standalone chunks lose important framing. 35% retrieval error reduction, up to 67% when combined with reranking.
  • Cost: one LLM call per chunk at index time — bearable with prompt caching.
Check yourself — multiple choice
  • Same as regular chunks
  • Prepend LLM-generated context to each chunk before embedding → solves orphan-chunk problem → 35-67% error reduction
  • Only training
  • Removes chunking

Contextual Retrieval: LLM-prepended context per chunk → dramatic retrieval accuracy gain.

#rag#retrieval#embeddings

Practise LLMs & GenAI

214 interview questions in this topic.

Related questions