← All questions
RAGMedium· Evaluation· Retrieval Strategy· Relevance Filtering

You added a relevance gate using the retriever’s cosine...

The thresholding of the maximum retrieval objective over the whole index is flawed because it measures topical density rather than whether the retrieved document actually contains an answer. An unanswerable question will still return a nearest neighbor, causing the gate to fail. A better approach is to use a small classifier trained on answer-containment, which is computationally inexpensive compared to the generator’s prefill.

Code playground (Python)