← All questions
RAGHard· Retrieval· Optimization· Modeling

Choose k for a system you have never seen, without a gr...

By calculating the log-slope c from the recall curve and the penalty β from the accuracy drop of a single distractor, you can mathematically derive the optimal k. While the assumption of independent distractor scores is a simplification, it provides a robust starting point. Note that near-duplicate passages are positively correlated, which suggests the true penalty per document is smaller than the model predicts at large k, making deduplication a critical intervention.

Code playground (Python)