A RAG system retrieves 15 candidate passages for each user query. Many passages are long (800-1,200 tokens each), resulting in 12,000-18,000 tokens of retrieved context per query. The retrieved context is often relevant but repetitive, with multiple passages covering the same topic with slight variations. How should the architect apply contextual compression to improve both efficiency and answer quality?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Here's the deal — d is correct because contextual compression — extracting only query-relevant sentences from each passage and deduplicating near-identical spans — directly addresses both the token efficiency problem and the quality problem. A smaller cheaper model (e.g., Haiku) can perform extraction efficiently, and deduplication removes redundant coverage that adds noise without adding information.
Full explanation below image
Full Explanation
D is correct because contextual compression — extracting only query-relevant sentences from each passage and deduplicating near-identical spans — directly addresses both the token efficiency problem and the quality problem. A smaller cheaper model (e.g., Haiku) can perform extraction efficiently, and deduplication removes redundant coverage that adds noise without adding information. This is a well-established RAG optimization pattern. A is wrong because truncating to the first 200 tokens assumes document structure that does not hold across all document types — the relevant information for a given query may appear anywhere in the passage, not only at the start. C is wrong because reducing retrieval k (from 15 to 5) addresses token consumption by retrieving less, but also reduces recall — relevant passages at positions 6-15 would be missed. This trades an efficiency problem for a coverage problem. B is wrong because increasing chunk size during indexing actually worsens the repetition problem by making chunks less topically focused, and it does not address existing indexed content.